diff --git a/Cargo.lock b/Cargo.lock index 8262a058813..a3a995c3d6e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2699,7 +2699,7 @@ dependencies = [ [[package]] name = "grovedb" version = "4.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=a917d92d2477672eed73c4c08e53e93449a6a094#a917d92d2477672eed73c4c08e53e93449a6a094" +source = "git+https://github.com/dashpay/grovedb?rev=7a649386ac8a06a608a614385a2333e03cd931c3#7a649386ac8a06a608a614385a2333e03cd931c3" dependencies = [ "axum 0.8.9", "bincode", @@ -2737,7 +2737,7 @@ dependencies = [ [[package]] name = "grovedb-bulk-append-tree" version = "4.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=a917d92d2477672eed73c4c08e53e93449a6a094#a917d92d2477672eed73c4c08e53e93449a6a094" +source = "git+https://github.com/dashpay/grovedb?rev=7a649386ac8a06a608a614385a2333e03cd931c3#7a649386ac8a06a608a614385a2333e03cd931c3" dependencies = [ "bincode", "blake3", @@ -2753,7 +2753,7 @@ dependencies = [ [[package]] name = "grovedb-commitment-tree" version = "4.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=a917d92d2477672eed73c4c08e53e93449a6a094#a917d92d2477672eed73c4c08e53e93449a6a094" +source = "git+https://github.com/dashpay/grovedb?rev=7a649386ac8a06a608a614385a2333e03cd931c3#7a649386ac8a06a608a614385a2333e03cd931c3" dependencies = [ "blake3", "grovedb-bulk-append-tree", @@ -2769,7 +2769,7 @@ dependencies = [ [[package]] name = "grovedb-costs" version = "4.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=a917d92d2477672eed73c4c08e53e93449a6a094#a917d92d2477672eed73c4c08e53e93449a6a094" +source = "git+https://github.com/dashpay/grovedb?rev=7a649386ac8a06a608a614385a2333e03cd931c3#7a649386ac8a06a608a614385a2333e03cd931c3" dependencies = [ "integer-encoding", "intmap", @@ -2779,7 +2779,7 @@ dependencies = [ [[package]] name = "grovedb-dense-fixed-sized-merkle-tree" version = "4.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=a917d92d2477672eed73c4c08e53e93449a6a094#a917d92d2477672eed73c4c08e53e93449a6a094" +source = "git+https://github.com/dashpay/grovedb?rev=7a649386ac8a06a608a614385a2333e03cd931c3#7a649386ac8a06a608a614385a2333e03cd931c3" dependencies = [ "bincode", "blake3", @@ -2792,7 +2792,7 @@ dependencies = [ [[package]] name = "grovedb-element" version = "4.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=a917d92d2477672eed73c4c08e53e93449a6a094#a917d92d2477672eed73c4c08e53e93449a6a094" +source = "git+https://github.com/dashpay/grovedb?rev=7a649386ac8a06a608a614385a2333e03cd931c3#7a649386ac8a06a608a614385a2333e03cd931c3" dependencies = [ "bincode", "bincode_derive", @@ -2807,7 +2807,7 @@ dependencies = [ [[package]] name = "grovedb-epoch-based-storage-flags" version = "4.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=a917d92d2477672eed73c4c08e53e93449a6a094#a917d92d2477672eed73c4c08e53e93449a6a094" +source = "git+https://github.com/dashpay/grovedb?rev=7a649386ac8a06a608a614385a2333e03cd931c3#7a649386ac8a06a608a614385a2333e03cd931c3" dependencies = [ "grovedb-costs", "hex", @@ -2819,7 +2819,7 @@ dependencies = [ [[package]] name = "grovedb-merk" version = "4.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=a917d92d2477672eed73c4c08e53e93449a6a094#a917d92d2477672eed73c4c08e53e93449a6a094" +source = "git+https://github.com/dashpay/grovedb?rev=7a649386ac8a06a608a614385a2333e03cd931c3#7a649386ac8a06a608a614385a2333e03cd931c3" dependencies = [ "bincode", "bincode_derive", @@ -2845,7 +2845,7 @@ dependencies = [ [[package]] name = "grovedb-merkle-mountain-range" version = "4.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=a917d92d2477672eed73c4c08e53e93449a6a094#a917d92d2477672eed73c4c08e53e93449a6a094" +source = "git+https://github.com/dashpay/grovedb?rev=7a649386ac8a06a608a614385a2333e03cd931c3#7a649386ac8a06a608a614385a2333e03cd931c3" dependencies = [ "bincode", "blake3", @@ -2856,7 +2856,7 @@ dependencies = [ [[package]] name = "grovedb-path" version = "4.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=a917d92d2477672eed73c4c08e53e93449a6a094#a917d92d2477672eed73c4c08e53e93449a6a094" +source = "git+https://github.com/dashpay/grovedb?rev=7a649386ac8a06a608a614385a2333e03cd931c3#7a649386ac8a06a608a614385a2333e03cd931c3" dependencies = [ "hex", ] @@ -2864,7 +2864,7 @@ dependencies = [ [[package]] name = "grovedb-query" version = "4.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=a917d92d2477672eed73c4c08e53e93449a6a094#a917d92d2477672eed73c4c08e53e93449a6a094" +source = "git+https://github.com/dashpay/grovedb?rev=7a649386ac8a06a608a614385a2333e03cd931c3#7a649386ac8a06a608a614385a2333e03cd931c3" dependencies = [ "bincode", "byteorder", @@ -2880,7 +2880,7 @@ dependencies = [ [[package]] name = "grovedb-storage" version = "4.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=a917d92d2477672eed73c4c08e53e93449a6a094#a917d92d2477672eed73c4c08e53e93449a6a094" +source = "git+https://github.com/dashpay/grovedb?rev=7a649386ac8a06a608a614385a2333e03cd931c3#7a649386ac8a06a608a614385a2333e03cd931c3" dependencies = [ "blake3", "grovedb-costs", @@ -2899,7 +2899,7 @@ dependencies = [ [[package]] name = "grovedb-version" version = "4.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=a917d92d2477672eed73c4c08e53e93449a6a094#a917d92d2477672eed73c4c08e53e93449a6a094" +source = "git+https://github.com/dashpay/grovedb?rev=7a649386ac8a06a608a614385a2333e03cd931c3#7a649386ac8a06a608a614385a2333e03cd931c3" dependencies = [ "thiserror 2.0.18", "versioned-feature-core 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2908,7 +2908,7 @@ dependencies = [ [[package]] name = "grovedb-visualize" version = "4.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=a917d92d2477672eed73c4c08e53e93449a6a094#a917d92d2477672eed73c4c08e53e93449a6a094" +source = "git+https://github.com/dashpay/grovedb?rev=7a649386ac8a06a608a614385a2333e03cd931c3#7a649386ac8a06a608a614385a2333e03cd931c3" dependencies = [ "hex", "itertools 0.14.0", @@ -2917,7 +2917,7 @@ dependencies = [ [[package]] name = "grovedbg-types" version = "4.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=a917d92d2477672eed73c4c08e53e93449a6a094#a917d92d2477672eed73c4c08e53e93449a6a094" +source = "git+https://github.com/dashpay/grovedb?rev=7a649386ac8a06a608a614385a2333e03cd931c3#7a649386ac8a06a608a614385a2333e03cd931c3" dependencies = [ "serde", "serde_with 3.20.0", diff --git a/book/src/SUMMARY.md b/book/src/SUMMARY.md index 05719c311e4..1a7070e2ac3 100644 --- a/book/src/SUMMARY.md +++ b/book/src/SUMMARY.md @@ -61,6 +61,8 @@ - [Finalize Tasks](drive/finalize-tasks.md) - [Indexes](drive/indexes.md) - [Document Count Trees](drive/document-count-trees.md) +- [Count Index Examples](drive/count-index-examples.md) +- [Count Index Group By Examples](drive/count-index-group-by-examples.md) # Testing diff --git a/book/src/drive/count-index-examples.md b/book/src/drive/count-index-examples.md new file mode 100644 index 00000000000..2cf1de6145e --- /dev/null +++ b/book/src/drive/count-index-examples.md @@ -0,0 +1,1866 @@ +# Count Index Examples + +This chapter walks through a representative contract and shows what a count-query proof actually proves — both the path query the prover signs and the verified element the verifier extracts. Every example uses the same `widget` contract (the same one the count-query bench at [`packages/rs-drive/benches/document_count_worst_case.rs`](https://github.com/dashpay/platform/blob/v3.1-dev/packages/rs-drive/benches/document_count_worst_case.rs) populates) so the proof bytes, verified elements, and diagrams can all be cross-referenced against the same data. + +The chapter assumes you've read [Document Count Trees](./document-count-trees.md) — that chapter explains the three tree variants (`NormalTree` / `CountTree` / `ProvableCountTree`), what `Element::NonCounted` does, and how the schema's `documentsCountable` / `rangeCountable` flags select between them. Here we take that machinery as given and trace what each query *sees*. + +## The Widget Contract + +The widget document type carries three properties (`brand`, `color`, `serial`), opts into total counts at the doctype level via `documentsCountable: true`, and declares three indexes covering the count-query surface: + +```jsonc +{ + "type": "object", + "documentsCountable": true, + "properties": { + "brand": { "type": "string", "position": 0, "maxLength": 32 }, + "color": { "type": "string", "position": 1, "maxLength": 32 }, + "serial": { "type": "integer", "position": 2 } + }, + "required": ["brand", "color", "serial"], + "indices": [ + { + "name": "byBrand", + "properties": [{ "brand": "asc" }], + "countable": "countable" + }, + { + "name": "byColor", + "properties": [{ "color": "asc" }], + "countable": "countable", + "rangeCountable": true + }, + { + "name": "byBrandColor", + "properties": [{ "brand": "asc" }, { "color": "asc" }], + "countable": "countable", + "rangeCountable": true + } + ], + "additionalProperties": false +} +``` + +Three things to notice: + +1. **`documentsCountable: true`** at the document-type level upgrades the doctype's primary-key subtree (at `widget/[0]`) from `NormalTree` to `CountTree`. The unfiltered total count is one read against this element's `count_value`. +2. **`byBrand` is `countable: "countable"` only.** It doesn't opt into `rangeCountable`, so `brand > X` range counts aren't supported. But **every countable terminator's value tree is stored as a `CountTree`** regardless of `rangeCountable` (see [`add_indices_for_index_level_for_contract_operations/v0/mod.rs`](https://github.com/dashpay/platform/blob/v3.1-dev/packages/rs-drive/src/drive/document/insert/add_indices_for_index_level_for_contract_operations/v0/mod.rs)), so point-lookup count proofs (e.g. `brand == "X"` or `brand IN [...]`) get the same compact value-tree-direct shape on byBrand that they do on rangeCountable indexes. `rangeCountable` is strictly an opt-in for `AggregateCountOnRange` support — orthogonal to proof-size shape. +3. **`byColor` and `byBrandColor` are `rangeCountable: true`.** Their property-name subtrees (e.g. `widget/color`) are stored as `ProvableCountTree` rather than `NormalTree`, which is what `AggregateCountOnRange` walks for `color > floor` style queries. + +The bench populates 100 000 documents under a deterministic schedule — `row → (brand_(row % 100), color_(row / 100), serial=row)`. That gives exactly 1 000 docs per brand, exactly 100 docs per color, and exactly 1 doc per `(brand, color)` pair. Those numbers show up in every verified count below. + +## GroveDB Layout + +The contract above produces this storage shape. Tree elements (the wrapping `Element` GroveDB stores under each key) are drawn as subgraphs; children inside each tree are merk-tree nodes. The doctype root and the per-property name subtrees are separate `Element` trees nested under the contract-documents prefix, just like every other index in Drive. + +*Diagram conventions: green nodes carry a `count_value` committed to the merk root; gray are regular subtrees; dashed boxes highlight `Element::NonCounted` wrappers (children that store data but contribute `0` to their parent CountTree's count).* + +```mermaid +flowchart TB + WD["@/contract_id/0x01/widget"]:::tree + + WD --> PK["[0]: CountTree count=100000
(documentsCountable primary key)"]:::countnode + WD --> BR["brand: NormalTree
(byBrand property-name)"]:::node + WD --> CO["color: ProvableCountTree
(byColor property-name)"]:::pctnode + + BR --> B000["brand_000: CountTree count=1000"]:::countnode + BR --> B050["brand_050: CountTree count=1000"]:::countnode + BR --> BMore["... brand_001 ... brand_099
(all CountTree count=1000)"]:::countnode + + B050 --> B050_0["[0]: CountTree count=1000
(byBrand refs)"]:::countnode + B050 --> B050_C["color: NonCounted(ProvableCountTree)
(byBrandColor continuation, contributes 0)"]:::noncounted + + B050_C --> B050_C_500["color_00000500: CountTree count=1
(byBrandColor terminator)"]:::countnode + B050_C_500 --> B050_C_500_0["[0]: CountTree count=1
(byBrandColor ref)"]:::countnode + + CO --> C500["color_00000500: CountTree count=100
(byColor terminator)"]:::countnode + CO --> CMore["... color_00000000 ... color_00000999"]:::countnode + C500 --> C500_0["[0]: CountTree count=100
(byColor refs)"]:::countnode + + classDef tree fill:#21262d,color:#c9d1d9,stroke:#1f6feb,stroke-width:2px; + classDef node fill:#6e7681,color:#fff,stroke:#6e7681; + classDef countnode fill:#3fb950,color:#0d1117,stroke:#3fb950,stroke-width:2px; + classDef pctnode fill:#d29922,color:#0d1117,stroke:#d29922,stroke-width:2px; + classDef noncounted fill:#21262d,color:#c9d1d9,stroke:#fb8500,stroke-width:2px,stroke-dasharray: 6 4; +``` + +Three layout facts to internalize before reading the queries: + +- **`brand_050` is a `CountTree` with `count_value = 1000`.** That's true *because* `byBrand` is countable; the rule applies uniformly to every countability tier (see [`add_indices_for_index_level_for_contract_operations/v0/mod.rs`](https://github.com/dashpay/platform/blob/v3.1-dev/packages/rs-drive/src/drive/document/insert/add_indices_for_index_level_for_contract_operations/v0/mod.rs)). The `color` continuation that branches off this value tree is `NonCounted`-wrapped so the parent's count equals exactly the 1 000 refs in `[0]`. +- **`widget/color` is a `ProvableCountTree`**, not a regular `NormalTree`. The yellow class above marks that — each internal merk node carries its subtree's count, which is what makes `AggregateCountOnRange` a single-pass primitive. +- **`color_00000500` is a `CountTree` with `count_value = 100`** under either parent. The same element layout would result from a query against `byColor` or against `byBrandColor`'s second level; the path that gets there differs, but the destination is structurally the same. + +## How To Read The Proofs + +Every example below has four sections: + +1. **Path query** — the spec the prover hands GroveDB. `path` is the list of subtree segments to descend through (the proof carries merk-path bytes for each of these); `query items` is what to select once at the bottom; `subquery items` (when present) descends one more layer. +2. **Verified element** — what `GroveDB::verify_query` (or `verify_aggregate_count_query` for the range primitive) returns after walking the proof bytes. The `count_value_or_default` field on a `CountTree` element is what the count surface ultimately surfaces to the caller. +3. **Proof display** — the proof bytes, decoded via `bincode` into the structured `GroveDBProof` AST and rendered through its `Display` impl. This is the same view [dash-evo-tool's Proof Log screen](https://github.com/dashpay/dash-evo-tool/blob/master/src/ui/tools/proof_log_screen.rs) shows when its display mode is set to "JSON" — each layer is a separate `LayerProof` carrying its merk-tree operations (`Push` / `Parent` / `Child` over `Hash` / `KVValueHash` / `KVHash`) plus a `lower_layers` map naming the children to descend into. Wrapped in a collapsible block per example because the merk path through 4-5 grovedb layers makes for long output. +4. **Diagram** — the path the proof walks through the layout. Blue arrows trace the descent; the cyan node is the verified element; faded gray nodes show context. + +All proof-size numbers come from running the bench against a 100 000-row fixture; see [`document_count_worst_case.rs`](https://github.com/dashpay/platform/blob/v3.1-dev/packages/rs-drive/benches/document_count_worst_case.rs)'s `report_proof_sizes` / `display_proofs` / `report_group_by_matrix` helpers. The proof bytes are reproducible — run the bench, grep `[proof]` from stderr, and you'll get the same hashes shown here. + +## Queries in this Chapter + +| # | Query | Filter | Complexity | Avg time | Proof size | +|---|-------|--------|------------|----------|------------| +| 1 | [Unfiltered Total Count](#query-1--unfiltered-total-count) | *(none — total at doctype level)* | O(1) | 22.5 µs | 585 B | +| 2 | [Equal on a Single Property (`byBrand`)](#query-2--equal-on-a-single-property-bybrand) | `brand == "brand_050"` | O(log B) | 35.7 µs | 1 041 B | +| 3 | [Equal on a RangeCountable Property (`byColor`)](#query-3--equal-on-a-rangecountable-property-bycolor) | `color == "color_00000500"` | O(log C) | 54.0 µs | 1 327 B | +| 4 | [Compound Equal-only (`byBrandColor`)](#query-4--compound-equal-only-bybrandcolor) | `brand == "brand_050" AND color == "color_00000500"` | O(log B + log C') | 71.4 µs | 1 911 B | +| 5 | [`In` on `byBrand`](#query-5--in-on-bybrand) | `brand IN ["brand_000", "brand_001"]` | O(k · log B) | 40.0 µs | 1 102 B | +| 6 | [`In` on `byColor` (RangeCountable)](#query-6--in-on-bycolor-rangecountable) | `color IN ["color_00000000", "color_00000001"]` | O(k · log C) | 61.9 µs | 1 381 B | +| 7 | [Range Query (`AggregateCountOnRange`)](#query-7--range-query-aggregatecountonrange) | `color > "color_00000500"` | O(log C) | 69.2 µs | 2 072 B | +| 8 | [Compound `==` + Range (`byBrandColor`)](#query-8--compound-equal-plus-range-bybrandcolor) | `brand == "brand_050" AND color > "color_00000500"` | O(log B + log C') | 84.9 µs | 2 656 B | + +**Complexity variables.** `B` = distinct brands in the byBrand merk-tree (≈ 100 in the fixture); `C` = distinct colors in the byColor merk-tree (≈ 1 000); `C'` = distinct colors *per brand* in byBrandColor's continuation (≈ 1 000 — every brand carries the full color namespace in this fixture); `k` = number of values in the `IN` clause (2 here). Notably absent: the total document count `N` (100 000 here). Count proofs read pre-committed `count_value`s from CountTree merk roots — they never enumerate the underlying documents, so proof generation cost is `polylog(distinct index values)`, *independent* of `N`. The grove-descent overhead (5–8 layers) is treated as a constant. The `O()` column captures shape only, not constants — for instance Q3's `O(log C)` is ~50% slower than Q2's `O(log B)` because in this fixture `C ≈ 10 × B`, and byColor's `ProvableCountTree` carries extra running-count metadata per merk node on top of that (37 merk ops in L6 vs 25 for byBrand — see [Query 2](#query-2--equal-on-a-single-property-bybrand) and [Query 3](#query-3--equal-on-a-rangecountable-property-bycolor)'s proof displays). + +**Avg time** is the criterion-reported median of `cargo bench --bench document_count_worst_case -- 'document_count_worst_case/query_'` on a 100 000-row warmed fixture (no group_by — single-query latency on the prover side, including merk-proof construction and serialization). Each row reflects **10 samples × 67k–220k iterations per sample** with 2 s warm-up and 5 s measurement; the median sits within ±2 % of the mean across reruns. For `GROUP BY` variants of these queries, see [Count Index Group By Examples](./count-index-group-by-examples.md). + +Each query has the same four sections (Path query, Verified element, Proof display, Diagram) plus a per-layer merk-tree diagram starting at Layer 5 (Layers 1–4 are byte-for-byte identical across every query — they're the root → `@` → contract_id → `0x01` descent shown in full only on Query 1). The bottom of the chapter has an [at-a-glance comparison](#at-a-glance-comparison) summarizing the structural differences. + +## Query 1 — Unfiltered Total Count + +```text +select = COUNT +where = (empty) +prove = true +``` + +**Path query** (primary-key CountTree fast path; no index walk needed): + +```text +path: ["@", contract_id, 0x01, "widget"] +query items: [Key(0x00)] +``` + +**Verified element:** + +```text +path: ["@", contract_id, 0x01, "widget"] +key: 0x00 +element: CountTree { count_value_or_default: 100000 } +``` + +**Proof size:** 585 B. + +**Proof display** (`GroveDBProof::Display`): + +
+Expand to see the structured proof (4 layers) — or open interactively in the visualizer ↗ + +```text +GroveDBProofV1 { + LayerProof { + proof: Merk( + 0: Push(Hash(HASH[bd291f29893fb6f6d6201087746ca1f23a178dd08e1346cb6c127e91ae3623b3])) + 1: Push(KVValueHash(@, Tree(4ed22624752972af97fb71abf4067b23e6d296a61a02f35b2098819fde39d289), HASH[4a5a28cb1b40226aa35b2f0d502767df13268bdf4678627dbfde26a557acdf73])) + 2: Parent + 3: Push(Hash(HASH[19c924989e473a90d0848277d0b1498ccc8db3dc870cbc130e773f3d79ea5b71])) + 4: Child) + lower_layers: { + @ => { + LayerProof { + proof: Merk( + 0: Push(KVValueHash(0x4ed22624752972af97fb71abf4067b23e6d296a61a02f35b2098819fde39d289, Tree(01), HASH[5b90e1e952b7eef903cc9db2d9098e334a37f7e08cade52c6b2ea3bf4b56b645]))) + lower_layers: { + 0x4ed22624752972af97fb71abf4067b23e6d296a61a02f35b2098819fde39d289 => { + LayerProof { + proof: Merk( + 0: Push(Hash(HASH[49e7191075272395ed72cf03e973987ede6e4945e08574fe77d725f4ce7ecdf8])) + 1: Push(KVValueHash(0x01, Tree(776964676574), HASH[5d9a0fad8a3f32560f8e8950c1e84a7feabaab21b79bc72fec4482442844e2ef])) + 2: Parent) + lower_layers: { + 0x01 => { + LayerProof { + proof: Merk( + 0: Push(KVValueHash(widget, Tree(6272616e64), HASH[6c505f53f2ebf3de030cc2aca463d4b429aeb320a9fadb8ae68bb7903a22bb68]))) + lower_layers: { + widget => { + LayerProof { + proof: Merk( + 0: Push(KVValueHashFeatureTypeWithChildHash(0x00, CountTree(0000000000010000fffffffffffeffff00000000000000000000000000000000, 100000), HASH[85843d8e6353dd6caf52f659c454b4a1352f510daa965df594b27319abf1d8a1], BasicMerkNode, HASH[0e6a5047f0600cafc385ed52b516c1fbbaf4994aa50dfcbd1e824b4ad9f55fa1])) + 1: Push(KVHash(HASH[a29ee8f206a253362b6da4fcacf8643ee8e5925cd979fcd449e5906f0f9f8be3])) + 2: Parent + 3: Push(Hash(HASH[6c36729e93b1a316cbf60fe282eb630c0ed6e45db088e365110302b6c9caba86])) + 4: Child) + } + } + } + } + } + } + } + } + } + } + } + } + } +} +``` + +Each `LayerProof` is one GroveDB tree's merk proof. The descent goes: top-level GroveDB root → `@` (`DataContractDocuments` root tree) → contract id → `0x01` (documents storage prefix) → `widget` doctype → finally the `Key(0x00)` payload at the bottom, where `CountTree(…, 100000)` is the verified element with its `count_value` of 100 000 visible inside. + +
+ +The descent stops at the doctype's primary-key tree — the green node at the top of the layout. Because `documentsCountable: true` upgraded that tree to a `CountTree`, the count is one O(1) read. + +### Diagram: per-layer merk-tree structure + +Each LayerProof above is its own GroveDB sub-tree whose contents form a merk binary tree. The merk-proof operations (`Push` / `Parent` / `Child` over `KVValueHash` / `KVHash` / `Hash` nodes) describe exactly which nodes of each layer's binary tree the proof reveals — the queried key gets its full kv-hash exposed; *opaque* siblings only commit their subtree-hash so the verifier can re-hash up to the merk root. + +Cyan = the verified target. Blue = a kv-hash that's also a queried-key on the descent path (its `value = Tree(...)` is the merk-root pointer for the next layer). Gray = opaque sibling subtrees committed by hash only. + +```mermaid +flowchart TB + subgraph L1["Layer 1 — root GroveDB merk-tree"] + direction TB + L1_root["@
kv_hash=HASH[4a5a...]
value: Tree(0x4ed2…)"]:::queried + L1_left["HASH[bd29...]
(left subtree, opaque)"]:::sibling + L1_right["HASH[19c9...]
(right subtree, opaque)"]:::sibling + L1_root --> L1_left + L1_root --> L1_right + end + + subgraph L2["Layer 2 — @ subtree merk-tree (single key)"] + direction TB + L2_q["contract_id 0x4ed2…
kv_hash=HASH[5b90...]
value: Tree(0x01)"]:::queried + end + + subgraph L3["Layer 3 — contract_id subtree merk-tree"] + direction TB + L3_q["0x01
kv_hash=HASH[5d9a...]
value: Tree(widget)"]:::queried + L3_left["HASH[49e7...]
(left subtree, opaque)"]:::sibling + L3_q --> L3_left + end + + subgraph L4["Layer 4 — 0x01 documents-prefix subtree (single key)"] + direction TB + L4_q["widget
kv_hash=HASH[6c50...]
value: Tree(0x00/brand/color)"]:::queried + end + + subgraph L5["Layer 5 — widget doctype merk-tree (TARGET layer)"] + direction TB + L5_root["KVHash[a29e...]
(opaque internal kv: brand or color)"]:::sibling + L5_target["0x00
kv_hash=HASH[8584...]
value: CountTree count=100000"]:::target + L5_right["HASH[6c36...]
(right subtree, opaque)"]:::sibling + L5_root --> L5_target + L5_root --> L5_right + end + + L1_root -. "value=Tree(merk_root[5b90…])" .-> L2_q + L2_q -. "value=Tree(merk_root[5d9a…])" .-> L3_q + L3_q -. "value=Tree(merk_root[6c50…])" .-> L4_q + L4_q -. "value=Tree(merk_root[a29e…])" .-> L5_root + + classDef queried fill:#1f6feb,color:#fff,stroke:#1f6feb,stroke-width:2px; + classDef sibling fill:#6e7681,color:#fff,stroke:#6e7681; + classDef target fill:#39c5cf,color:#0d1117,stroke:#39c5cf,stroke-width:3px; +``` + +A few things this diagram makes explicit that the prose can't: + +- **Each layer is its own merk binary tree, not a single graph.** The 5 `LayerProof` blocks in the structured proof above each describe one of these binary trees. The hashes named in each block's `Push(Hash(HASH[…]))` ops are this diagram's opaque siblings; the `Push(KVValueHash(K, …))` ops are this diagram's blue / cyan nodes. +- **The "descent" between layers is via a `value: Tree(…)`.** When a queried key's value is `Tree(merk_root_hash)`, that hash IS the merk root of the next layer's binary tree. So Layer 1's `@` doesn't descend to Layer 2's `contract_id` directly — it descends to Layer 2's merk root, which in this case happens to be the only node in Layer 2. +- **Single-key layers have a 1-node merk tree.** Layers 2 and 4 contain exactly one entry (`@` contains exactly one contract id; `0x01` contains exactly one doctype here), so their merk trees have no siblings to commit. +- **The merk root of a layer can be an opaque sibling, not the queried key.** Layer 5's merk root is `KVHash[a29e...]` — a key (`brand` or `color`, we can't tell from the proof) whose kv_hash is committed but whose value isn't revealed. The queried `0x00` is reached as a child of that opaque root. This is why the merk-tree structure matters: the prover sometimes has to commit one merk-tree-depth's worth of hashes to prove the queried key's position, even if the verifier only cares about the target's value. + +## Query 2 — Equal on a Single Property (`byBrand`) + +```text +select = COUNT +where = brand == "brand_050" +prove = true +``` + +**Path query:** + +```text +path: ["@", contract_id, 0x01, "widget", "brand"] +query items: [Key("brand_050")] +``` + +**Verified element:** + +```text +path: ["@", contract_id, 0x01, "widget", "brand"] +key: "brand_050" +element: CountTree { count_value_or_default: 1000 } +``` + +**Proof size:** 1 041 B. + +**Proof display:** + +
+Expand to see the structured proof (verbatim, 5 layers) — or open interactively in the visualizer ↗ + +```text +GroveDBProofV1 { + LayerProof { + proof: Merk( + 0: Push(Hash(HASH[bd291f29893fb6f6d6201087746ca1f23a178dd08e1346cb6c127e91ae3623b3])) + 1: Push(KVValueHash(@, Tree(4ed22624752972af97fb71abf4067b23e6d296a61a02f35b2098819fde39d289), HASH[4a5a28cb1b40226aa35b2f0d502767df13268bdf4678627dbfde26a557acdf73])) + 2: Parent + 3: Push(Hash(HASH[19c924989e473a90d0848277d0b1498ccc8db3dc870cbc130e773f3d79ea5b71])) + 4: Child) + lower_layers: { + @ => { + LayerProof { + proof: Merk( + 0: Push(KVValueHash(0x4ed22624752972af97fb71abf4067b23e6d296a61a02f35b2098819fde39d289, Tree(01), HASH[5b90e1e952b7eef903cc9db2d9098e334a37f7e08cade52c6b2ea3bf4b56b645]))) + lower_layers: { + 0x4ed22624752972af97fb71abf4067b23e6d296a61a02f35b2098819fde39d289 => { + LayerProof { + proof: Merk( + 0: Push(Hash(HASH[49e7191075272395ed72cf03e973987ede6e4945e08574fe77d725f4ce7ecdf8])) + 1: Push(KVValueHash(0x01, Tree(776964676574), HASH[5d9a0fad8a3f32560f8e8950c1e84a7feabaab21b79bc72fec4482442844e2ef])) + 2: Parent) + lower_layers: { + 0x01 => { + LayerProof { + proof: Merk( + 0: Push(KVValueHash(widget, Tree(6272616e64), HASH[6c505f53f2ebf3de030cc2aca463d4b429aeb320a9fadb8ae68bb7903a22bb68]))) + lower_layers: { + widget => { + LayerProof { + proof: Merk( + 0: Push(Hash(HASH[9862894b16a0792688fdcf64edcb2ceade5c8b234649bfc6cfc6426869b0e9d9])) + 1: Push(KVValueHash(brand, Tree(6272616e645f303633), HASH[68b697da99d6ea70a83eb41794dca7ba3938d0ba98fbfaeb3cd0c19b3b5d0ff2])) + 2: Parent + 3: Push(Hash(HASH[6c36729e93b1a316cbf60fe282eb630c0ed6e45db088e365110302b6c9caba86])) + 4: Child) + lower_layers: { + brand => { + LayerProof { + proof: Merk( + 0: Push(Hash(HASH[fb5eb23b3135d9c226e61f004ffb43abae104238d8a1ea7bc60e8ec6ba271596])) + 1: Push(KVHash(HASH[3ed48a5e35cb7546d329487b0e1ab8a81d7c5bec358c37449e6cbd956e3bb069])) + 2: Parent + 3: Push(Hash(HASH[19ec5730af134e9ac980bbea92c2978212c8efe750a467ab54f073626e0ca2f5])) + 4: Push(KVHash(HASH[87bc6e7e1e465b8dcdaf95db9957a455d6bd7c75976db122f33e592fe75f1e4a])) + 5: Parent + 6: Push(Hash(HASH[a0a354f2bb59b8169253aebabb52afcc3c59c4c60da203c8887abb679d747168])) + 7: Push(KVHash(HASH[fc6b1d0237f8ff89b555e9a14480ae1c5b80d529a0f9fb5e681ea7ecd157d3da])) + 8: Parent + 9: Push(KVValueHashFeatureTypeWithChildHash(brand_050, CountTree(636f6c6f72, 1000, flags: [0, 0, 0]), HASH[53dbd6216cccdddf16f3eb0f849aed0c0cea987a718f5b43493abf0a14e83eb9], BasicMerkNode, HASH[4947457e230f87ce0f75a7f1502f64f24ee4d3e27eb5d2210680822a3b17afa4])) + 10: Child + 11: Push(KVHash(HASH[027ac8b1bc9788118b27c13d0b3c3bd3661ef6a89a775a6b6bf78aa7e6f8ed3d])) + 12: Parent + 13: Push(Hash(HASH[7a5dc3002e6cb6c92e54d554e5af85e9c2ba64ee9c5f80e6489075cc5f3f0d55])) + 14: Child + 15: Push(KVHash(HASH[3363630479f1abe6e003b1e1d50b5118e55ad2efb7a3f4b3b6df902bea72ac9a])) + 16: Parent + 17: Push(Hash(HASH[3857faef5ddb06e201f1e65cf42f15d6c9b0dc67e7f73eb182b520854e9bb648])) + 18: Child + 19: Child + 20: Child + 21: Push(KVHash(HASH[f776417ede76e6194706e483ac14ab7b3db6aa0461ec14ed5f8e5d20071363af])) + 22: Parent + 23: Push(Hash(HASH[b3fccba79c14fcc5e97ff6a3cd051228dc755e6de147bef690ba9681264b2b9f])) + 24: Child) + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } +} +``` + +The bottom layer is the byBrand property-name tree; it has 100 distinct `brand_NNN` keys, so the merk path proves `brand_050`'s position with 25 ops total (0–24). The verified payload is the inline `KVValueHashFeatureTypeWithChildHash(brand_050, CountTree(636f6c6f72, 1000, flags: [0, 0, 0]), …)` on op 9 — the `636f6c6f72` value slot is the ASCII bytes for `"color"` (the byBrandColor continuation pointer; `NonCounted`-wrapped at the storage layer so it contributes 0 to the parent count), and the `1000` is the doc count. The remaining 24 ops are the merk-binary boundary walk: each `Push(Hash(…))` is an opaque subtree the proof commits but doesn't descend into, each `Push(KVHash(…))` is an opaque internal sibling kv whose hash is committed, and each `Parent` / `Child` re-attaches them so the verifier can recompute the byBrand merk root. + +
+ +`brand_050` is itself a `CountTree` — every countable terminator's value tree carries the doc count directly, with sibling continuations wrapped `NonCounted` so they don't pollute the parent. The proof shape is the same as the rangeCountable case below, even though `byBrand` doesn't opt into `rangeCountable: true`. `rangeCountable` is the orthogonal opt-in for `AggregateCountOnRange` (Query 7), not for proof-size shape. + +```mermaid +flowchart TB + WD["@/contract_id/0x01/widget"]:::tree + WD ==> BR["brand: NormalTree"]:::path + BR ==> B050["brand_050: CountTree count=1000"]:::target + BR -.-> B000["brand_000"]:::faded + BR -.-> BMore["..."]:::faded + WD -.-> PK["[0]"]:::faded + WD -.-> CO["color"]:::faded + B050 -.-> B050_0["[0]: 1000 refs"]:::faded + B050 -.-> B050_C["color (NonCounted)"]:::faded + + classDef tree fill:#21262d,color:#c9d1d9,stroke:#1f6feb,stroke-width:2px; + classDef path fill:#6e7681,color:#fff,stroke:#1f6feb,stroke-width:2px; + classDef faded fill:#21262d,color:#6e7681,stroke:#484f58; + classDef target fill:#39c5cf,color:#0d1117,stroke:#39c5cf,stroke-width:3px; + + linkStyle 0 stroke:#1f6feb,stroke-width:3px; + linkStyle 1 stroke:#1f6feb,stroke-width:3px; +``` + +### Diagram: per-layer merk-tree structure (Layer 5+) + +Layers 1–4 are byte-for-byte identical to Query 1's diagram (root → `@` → contract_id → `0x01`). The descent diverges at Layer 5, where this query takes the `brand` branch (rather than `0x00`) and descends one extra grove layer to land on the verified target. + +```mermaid +flowchart TB + subgraph L5["Layer 5 — widget doctype merk-tree (proof view for `brand`)"] + direction TB + L5_q["brand
kv_hash=HASH[68b6...]
value: Tree (descent into byBrand)"]:::queried + L5_left["HASH[9862...]
(left subtree, opaque)"]:::sibling + L5_right["HASH[6c36...]
(right subtree, opaque)"]:::sibling + L5_q --> L5_left + L5_q --> L5_right + end + + subgraph L6["Layer 6 — byBrand merk-tree (TARGET layer)"] + direction TB + L6_target["brand_050
kv_hash=HASH[53db...]
value: CountTree count=1000
child_hash=HASH[4947...]"]:::target + L6_boundary["Boundary commitments (24 merk ops):
6 KVHash opaque sibling brands
+ 6 Hash subtree commitments
(prove brand_050's position in byBrand's
binary merk tree of ~100 brand entries)"]:::sibling + L6_target --> L6_boundary + end + + L5_q -. "value=Tree(merk_root[byBrand])" .-> L6_target + + classDef queried fill:#1f6feb,color:#fff,stroke:#1f6feb,stroke-width:2px; + classDef sibling fill:#6e7681,color:#fff,stroke:#6e7681; + classDef target fill:#39c5cf,color:#0d1117,stroke:#39c5cf,stroke-width:3px; +``` + +The boundary commitments at L6 are what scale linearly with the byBrand tree's depth — they bind `brand_050` to its claimed position so the verifier can recompute byBrand's merk root. The verified target itself is just one `KVValueHashFeatureTypeWithChildHash` op whose `count_value_or_default = 1000` is the answer. + +## Query 3 — Equal on a RangeCountable Property (`byColor`) + +```text +select = COUNT +where = color == "color_00000500" +prove = true +``` + +**Path query:** + +```text +path: ["@", contract_id, 0x01, "widget", "color"] +query items: [Key("color_00000500")] +``` + +**Verified element:** + +```text +path: ["@", contract_id, 0x01, "widget", "color"] +key: "color_00000500" +element: CountTree { count_value_or_default: 100 } +``` + +**Proof size:** 1 327 B. + +**Proof display:** + +
+Expand to see the structured proof (verbatim, 5 layers; note `KVHashCount` ops in the byColor `ProvableCountTree` layer) — or open interactively in the visualizer ↗ + +```text +GroveDBProofV1 { + LayerProof { + proof: Merk( + 0: Push(Hash(HASH[bd291f29893fb6f6d6201087746ca1f23a178dd08e1346cb6c127e91ae3623b3])) + 1: Push(KVValueHash(@, Tree(4ed22624752972af97fb71abf4067b23e6d296a61a02f35b2098819fde39d289), HASH[4a5a28cb1b40226aa35b2f0d502767df13268bdf4678627dbfde26a557acdf73])) + 2: Parent + 3: Push(Hash(HASH[19c924989e473a90d0848277d0b1498ccc8db3dc870cbc130e773f3d79ea5b71])) + 4: Child) + lower_layers: { + @ => { + LayerProof { + proof: Merk( + 0: Push(KVValueHash(0x4ed22624752972af97fb71abf4067b23e6d296a61a02f35b2098819fde39d289, Tree(01), HASH[5b90e1e952b7eef903cc9db2d9098e334a37f7e08cade52c6b2ea3bf4b56b645]))) + lower_layers: { + 0x4ed22624752972af97fb71abf4067b23e6d296a61a02f35b2098819fde39d289 => { + LayerProof { + proof: Merk( + 0: Push(Hash(HASH[49e7191075272395ed72cf03e973987ede6e4945e08574fe77d725f4ce7ecdf8])) + 1: Push(KVValueHash(0x01, Tree(776964676574), HASH[5d9a0fad8a3f32560f8e8950c1e84a7feabaab21b79bc72fec4482442844e2ef])) + 2: Parent) + lower_layers: { + 0x01 => { + LayerProof { + proof: Merk( + 0: Push(KVValueHash(widget, Tree(6272616e64), HASH[6c505f53f2ebf3de030cc2aca463d4b429aeb320a9fadb8ae68bb7903a22bb68]))) + lower_layers: { + widget => { + LayerProof { + proof: Merk( + 0: Push(Hash(HASH[9862894b16a0792688fdcf64edcb2ceade5c8b234649bfc6cfc6426869b0e9d9])) + 1: Push(KVHash(HASH[a29ee8f206a253362b6da4fcacf8643ee8e5925cd979fcd449e5906f0f9f8be3])) + 2: Parent + 3: Push(KVValueHash(color, ProvableCountTree(636f6c6f725f3030303030353131, 100000), HASH[79569d595db75bbf2e9dca93a15c90b7eecf7b299632668ec410e2076d27f71c])) + 4: Child) + lower_layers: { + color => { + LayerProof { + proof: Merk( + 0: Push(Hash(HASH[864c8a53cdfc17560ea304fe40ae87570699a6920eae3dcb6075f71ca2d79b02])) + 1: Push(KVHashCount(HASH[3684347a67ceedad2ff4a7fce6ae303086543c1f146f5865dfdc23612308c05b], 51100)) + 2: Parent + 3: Push(Hash(HASH[56422e033fcffda5514eaef88096da995646207f3f5e349a6840003b4297098e])) + 4: Push(KVHashCount(HASH[aa27604017cfc457ccd56aabeb4686a988b0b073d1c1c03a4fdf78164c31c8ea], 25500)) + 5: Parent + 6: Push(Hash(HASH[09bcdaa37a5ae46f9059a7c026bf9cdf1c2d1ddecfcfe72fafe73f30abf2bccc])) + 7: Push(KVHashCount(HASH[525df42449bd5e881d55f94c11be2b1c95cd112123864fc249e6c170ea026f5a], 12700)) + 8: Parent + 9: Push(Hash(HASH[ffe58ba46b2d1f91b04e9c78185b474828f8ad165757847d9178020e55ad6c26])) + 10: Push(KVHashCount(HASH[abbcbcef405f19e0a096a902993b3c76c77c59abdb8a3dcc95369e8c17b401c7], 6300)) + 11: Parent + 12: Push(Hash(HASH[472879d66cf8e01e77bf4828d6a6f530a016cf7a99d712deb00c8fa5920b8495])) + 13: Push(KVHashCount(HASH[3ac3896404268efc1bbfc9a2a8925adcc9eff7248fc7ca3aaec6f62587cdaffd], 3100)) + 14: Parent + 15: Push(Hash(HASH[1c40306956f164e416e74a69ce0fff8c7ca152904ad47f44c6142c7822d3d2fb])) + 16: Push(KVHashCount(HASH[494935a3d102495beb504953539d204ecd5b5ca8f5a03aa4a3cdbf16a3926335], 700)) + 17: Parent + 18: Push(KVValueHashFeatureTypeWithChildHash(color_00000500, CountTree(00, 100, flags: [0, 0, 0]), HASH[47b0ade593a2e4e99e7d7363f5d1f692882007397f025226f19d097ca2f407fa], ProvableCountedMerkNode(100), HASH[4f7f13f56e087e7b19751c067671b75cda83156231cd3186f7c4172dccc8e97b])) + 19: Push(KVHashCount(HASH[4866192fb6beda0888f828d7bbf008fa725a1141cf19ae3b1e9d245c6cb12c7c], 300)) + 20: Parent + 21: Push(Hash(HASH[f56dd41a87f9b487ee9893c310a8bdd2fe70eb573e2e22e048cef7e3dec5fc1d])) + 22: Child + 23: Child + 24: Push(KVHashCount(HASH[a646e152e4bfb609f5372833f5b8c001b4e523c3154f6fea43b154fe04c6e120], 1500)) + 25: Parent + 26: Push(Hash(HASH[f434d46bb16f841310d2e120a259ad1aca2d679fd330ac0fd13d145c11a6b335])) + 27: Child + 28: Child + 29: Child + 30: Child + 31: Child + 32: Child + 33: Push(KVHashCount(HASH[c32ae0189f148c2390791534ff4bc205fabb53a7c7d15f109a4354170045308c], 100000)) + 34: Parent + 35: Push(Hash(HASH[1a1c99166d7b1e1eb9087404f3bfae82d749a3a7a763da654f48c5d314e21e76])) + 36: Child) + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } +} +``` + +This is the most interesting layer in the chapter. The byColor property-name tree (`widget/color`) is a `ProvableCountTree`, so every internal merk node carries its subtree's running count — visible here as `KVHashCount(HASH[…], N)` ops where `N` is the count contribution of that subtree (the values `51100, 25500, 12700, 6300, 3100, 700, 300, 1500, 100000` show up in the literal output above). The verified element (`color_00000500`) lands on op 18 in the middle of these `KVHashCount` ops, and the surrounding ops walk the binary boundary path so the prover can recompute the parent merk hash. For a point-lookup query like this, the `ProvableCountTree` machinery is overkill — it carries running counts the verifier doesn't need. Query 7 is where this pays off. + +
+ +Structurally identical to Query 2 — only the property name and the count-tree depth differ. The intermediate `widget/color` tree is a `ProvableCountTree` here (vs `NormalTree` for `byBrand`), but the *proof* doesn't care about that: it descends through the property-name tree and surfaces the value-tree CountTree at the bottom. The `ProvableCountTree` upgrade matters for Query 7 (range aggregate), not for point lookup. + +```mermaid +flowchart TB + WD["@/contract_id/0x01/widget"]:::tree + WD ==> CO["color: ProvableCountTree"]:::path + CO ==> C500["color_00000500: CountTree count=100"]:::target + CO -.-> C000["color_00000000"]:::faded + CO -.-> CMore["..."]:::faded + WD -.-> PK["[0]"]:::faded + WD -.-> BR["brand"]:::faded + C500 -.-> C500_0["[0]: 100 refs"]:::faded + + classDef tree fill:#21262d,color:#c9d1d9,stroke:#1f6feb,stroke-width:2px; + classDef path fill:#d29922,color:#0d1117,stroke:#1f6feb,stroke-width:2px; + classDef faded fill:#21262d,color:#6e7681,stroke:#484f58; + classDef target fill:#39c5cf,color:#0d1117,stroke:#39c5cf,stroke-width:3px; + + linkStyle 0 stroke:#1f6feb,stroke-width:3px; + linkStyle 1 stroke:#1f6feb,stroke-width:3px; +``` + +### Diagram: per-layer merk-tree structure (Layer 5+) + +Layers 1–4 are byte-for-byte identical to Query 1. The L5 widget doctype merk-tree proof differs from Query 2: here `color` is the queried key (under an opaque `KVHash[a29e...]` root in the proof view), and the descent into Layer 6 enters a `ProvableCountTree` rather than a `NormalTree`. + +```mermaid +flowchart TB + subgraph L5["Layer 5 — widget doctype merk-tree (proof view for `color`)"] + direction TB + L5_root["KVHash[a29e...]
(opaque kv root)"]:::sibling + L5_left["HASH[9862...]
(left subtree, opaque)"]:::sibling + L5_q["color
kv_hash=HASH[7956...]
value: ProvableCountTree
(descent into byColor)"]:::queried + L5_root --> L5_left + L5_root --> L5_q + end + + subgraph L6["Layer 6 — byColor ProvableCountTree merk-tree (TARGET layer)"] + direction TB + L6_target["color_00000500
KVValueHashFeatureTypeWithChildHash:
kv_hash=HASH[47b0...]
value: CountTree count=100
feature: ProvableCountedMerkNode(100)
child_hash=HASH[4f7f...]"]:::target + L6_boundary["Boundary commitments (36 merk ops):
9 KVHashCount running totals carrying
per-subtree counts
(700, 1500, 3100, 6300, 12700,
25500, 51100, 100000, 300)
+ 9 Hash subtree commitments"]:::sibling + L6_target --> L6_boundary + end + + L5_q -. "ProvableCountTree(merk_root[byColor])" .-> L6_target + + classDef queried fill:#1f6feb,color:#fff,stroke:#1f6feb,stroke-width:2px; + classDef sibling fill:#6e7681,color:#fff,stroke:#6e7681; + classDef target fill:#39c5cf,color:#0d1117,stroke:#39c5cf,stroke-width:3px; +``` + +Same structural shape as Query 2 (point lookup → CountTree), but the boundary commitments carry `KVHashCount(HASH, N)` ops instead of plain `KVHash(HASH)`. The running totals are dead weight for this point lookup — the verifier never reads them — but they're the same commitments Query 7 will integrate over. + +## Query 4 — Compound Equal-only (`byBrandColor`) + +```text +select = COUNT +where = brand == "brand_050" AND color == "color_00000500" +prove = true +``` + +**Path query:** + +```text +path: ["@", contract_id, 0x01, "widget", "brand", "brand_050", "color"] +query items: [Key("color_00000500")] +``` + +**Verified element:** + +```text +path: ["@", contract_id, 0x01, "widget", "brand", "brand_050", "color"] +key: "color_00000500" +element: CountTree { count_value_or_default: 1 } +``` + +**Proof size:** 1 911 B. + +**Proof display:** + +
+Expand to see the structured proof (6 layers — the deepest descent in the chapter) — or open interactively in the visualizer ↗ + +```text +GroveDBProofV1 { + LayerProof { + proof: Merk( + 0: Push(Hash(HASH[bd291f29893fb6f6d6201087746ca1f23a178dd08e1346cb6c127e91ae3623b3])) + 1: Push(KVValueHash(@, Tree(4ed22624752972af97fb71abf4067b23e6d296a61a02f35b2098819fde39d289), HASH[4a5a28cb1b40226aa35b2f0d502767df13268bdf4678627dbfde26a557acdf73])) + 2: Parent + 3: Push(Hash(HASH[19c924989e473a90d0848277d0b1498ccc8db3dc870cbc130e773f3d79ea5b71])) + 4: Child) + lower_layers: { + @ => { + LayerProof { + proof: Merk( + 0: Push(KVValueHash(0x4ed22624752972af97fb71abf4067b23e6d296a61a02f35b2098819fde39d289, Tree(01), HASH[5b90e1e952b7eef903cc9db2d9098e334a37f7e08cade52c6b2ea3bf4b56b645]))) + lower_layers: { + 0x4ed22624752972af97fb71abf4067b23e6d296a61a02f35b2098819fde39d289 => { + LayerProof { + proof: Merk( + 0: Push(Hash(HASH[49e7191075272395ed72cf03e973987ede6e4945e08574fe77d725f4ce7ecdf8])) + 1: Push(KVValueHash(0x01, Tree(776964676574), HASH[5d9a0fad8a3f32560f8e8950c1e84a7feabaab21b79bc72fec4482442844e2ef])) + 2: Parent) + lower_layers: { + 0x01 => { + LayerProof { + proof: Merk( + 0: Push(KVValueHash(widget, Tree(6272616e64), HASH[6c505f53f2ebf3de030cc2aca463d4b429aeb320a9fadb8ae68bb7903a22bb68]))) + lower_layers: { + widget => { + LayerProof { + proof: Merk( + 0: Push(Hash(HASH[9862894b16a0792688fdcf64edcb2ceade5c8b234649bfc6cfc6426869b0e9d9])) + 1: Push(KVValueHash(brand, Tree(6272616e645f303633), HASH[68b697da99d6ea70a83eb41794dca7ba3938d0ba98fbfaeb3cd0c19b3b5d0ff2])) + 2: Parent + 3: Push(Hash(HASH[6c36729e93b1a316cbf60fe282eb630c0ed6e45db088e365110302b6c9caba86])) + 4: Child) + lower_layers: { + brand => { + LayerProof { + proof: Merk( + 0: Push(Hash(HASH[fb5eb23b3135d9c226e61f004ffb43abae104238d8a1ea7bc60e8ec6ba271596])) + 1: Push(KVHash(HASH[3ed48a5e35cb7546d329487b0e1ab8a81d7c5bec358c37449e6cbd956e3bb069])) + 2: Parent + 3: Push(Hash(HASH[19ec5730af134e9ac980bbea92c2978212c8efe750a467ab54f073626e0ca2f5])) + 4: Push(KVHash(HASH[87bc6e7e1e465b8dcdaf95db9957a455d6bd7c75976db122f33e592fe75f1e4a])) + 5: Parent + 6: Push(Hash(HASH[a0a354f2bb59b8169253aebabb52afcc3c59c4c60da203c8887abb679d747168])) + 7: Push(KVHash(HASH[fc6b1d0237f8ff89b555e9a14480ae1c5b80d529a0f9fb5e681ea7ecd157d3da])) + 8: Parent + 9: Push(KVValueHash(brand_050, CountTree(636f6c6f72, 1000, flags: [0, 0, 0]), HASH[53dbd6216cccdddf16f3eb0f849aed0c0cea987a718f5b43493abf0a14e83eb9])) + 10: Child + 11: Push(KVHash(HASH[027ac8b1bc9788118b27c13d0b3c3bd3661ef6a89a775a6b6bf78aa7e6f8ed3d])) + 12: Parent + 13: Push(Hash(HASH[7a5dc3002e6cb6c92e54d554e5af85e9c2ba64ee9c5f80e6489075cc5f3f0d55])) + 14: Child + 15: Push(KVHash(HASH[3363630479f1abe6e003b1e1d50b5118e55ad2efb7a3f4b3b6df902bea72ac9a])) + 16: Parent + 17: Push(Hash(HASH[3857faef5ddb06e201f1e65cf42f15d6c9b0dc67e7f73eb182b520854e9bb648])) + 18: Child + 19: Child + 20: Child + 21: Push(KVHash(HASH[f776417ede76e6194706e483ac14ab7b3db6aa0461ec14ed5f8e5d20071363af])) + 22: Parent + 23: Push(Hash(HASH[b3fccba79c14fcc5e97ff6a3cd051228dc755e6de147bef690ba9681264b2b9f])) + 24: Child) + lower_layers: { + brand_050 => { + LayerProof { + proof: Merk( + 0: Push(Hash(HASH[2190c6fcd140792fd12be66cd631f97475b9ab3f19417a26d94798115ee46160])) + 1: Push(KVValueHash(color, NonCounted(ProvableCountTree(636f6c6f725f3030303030353131, 1000, flags: [0, 0, 0])), HASH[b1cedc48940faedea8b64bff8c8113344acdb1fd8eff37c567099b167b3c5861])) + 2: Parent) + lower_layers: { + color => { + LayerProof { + proof: Merk( + 0: Push(Hash(HASH[7e2704a94ce3e08ee1e8249a7272e1860251f66b9816581f6191010bc0f15dfe])) + 1: Push(KVHashCount(HASH[ccfe3e95a84b22305b9815064d7d4e54b6ab0ca8efab26ca408391f2fad2b83e], 511)) + 2: Parent + 3: Push(Hash(HASH[3dac20af894289bb36212087f48cfdd2c05713c5e134804638428a8d0ac8c905])) + 4: Push(KVHashCount(HASH[1a3db8540380b26ead4be363cd35a4a0036ec9a92cf3c9527db540f0878ab168], 255)) + 5: Parent + 6: Push(Hash(HASH[61f333ba1ad78624c009fa514ac69407a1438cb7d7807e9d5de1d75223137235])) + 7: Push(KVHashCount(HASH[94e2ea0c17ffbf050dcba5e04928ae2ecf9fe21567e7fac5b93ad30040df8dfe], 127)) + 8: Parent + 9: Push(Hash(HASH[a8571229cee7010a54ae9890a410edd246c079930d672fb4cdcd4a13c2bcc437])) + 10: Push(KVHashCount(HASH[6b04a6eb8e698272ec0ff801c76dc9d65a1d47ef5ae1beb9747058cdda05e2d6], 63)) + 11: Parent + 12: Push(Hash(HASH[8c12a68cebf211bbbd3937519662a7c3ed5bce92cf1e99869548c06a5639de15])) + 13: Push(KVHashCount(HASH[9533ef417b8eed113b81bb2d7e56c81012d11835819a59769deebfc1a7e0eafd], 31)) + 14: Parent + 15: Push(Hash(HASH[2f385d9fd5157a78a1cb1456050d3fb87f809e30b93a1963582edcedd31bfd0e])) + 16: Push(KVHashCount(HASH[74ad467d4132703ae845149ce86de7c71d9c6fc7472e76e9bb1b81bc182abe53], 7)) + 17: Parent + 18: Push(KVValueHashFeatureTypeWithChildHash(color_00000500, CountTree(00, 1, flags: [0, 0, 0]), HASH[7f1d988845d9c82b9d1146f2188b09bf704d31647ee2a26054e69ed897de3750], ProvableCountedMerkNode(1), HASH[078e3476060013c48bfc77330dc75d4fedc585469f581a66dc6b7b32f6d4d60a])) + 19: Push(KVHashCount(HASH[48fc5c3cca2265eaeb5b86505f628660ffae9deee96cda8c26d7139f22ce0410], 3)) + 20: Parent + 21: Push(Hash(HASH[c6e38bf64efcfd1d46d4ccd7937858870c7406f3abf31ca36148860d12c6b950])) + 22: Child + 23: Child + 24: Push(KVHashCount(HASH[67ab38f74160b7c15e62a37fee3d0c193156061f3b013190ce2a154e4164c7b0], 15)) + 25: Parent + 26: Push(Hash(HASH[49e4ecf80eead3552c93208b39c4fa9a5a3b64b7c63b385e53e47cb6e7bd8759])) + 27: Child + 28: Child + 29: Child + 30: Child + 31: Child + 32: Child + 33: Push(KVHashCount(HASH[e735a44484a03e4f67ef4c79f370e2b2c4b0b98d942c5b1dca53039a031354b3], 1000)) + 34: Parent + 35: Push(Hash(HASH[bf41c24632983b5858dcd20a04e0e0da6e7cacef58679e69e7859619dded444e])) + 36: Child) + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } +} +``` + +This is the deepest descent in the chapter. The path threads: +1. The two intermediate GroveDB-wrapper layers (`@` and `0x01`). +2. The widget doctype. +3. The byBrand property-name tree. +4. The byBrand value tree for `brand_050` (visible in Query 2 already, here it's an intermediate stop with `CountTree(636f6c6f72, 1000, …)` — same element, same count). +5. The byBrandColor continuation (`color` — `NonCounted(ProvableCountTree)`). +6. The byBrandColor terminator value tree, finally arriving at `color_00000500` with `CountTree(00, 1, …)` — the bench's deterministic schedule gives exactly 1 doc per `(brand, color)` pair. + +
+ +The proof descends through `byBrandColor`'s prefix value tree (`brand_050`) into its continuation (`color`, the `NonCounted`-wrapped subtree shown earlier) and resolves at the terminator value tree `color_00000500`. The count is `1` because the bench's fixture has exactly one document per `(brand, color)` pair. + +```mermaid +flowchart TB + WD["@/contract_id/0x01/widget"]:::tree + WD ==> BR["brand: NormalTree"]:::path + BR ==> B050["brand_050: CountTree count=1000"]:::path + B050 ==> B050_C["color: NonCounted(ProvableCountTree)"]:::path + B050_C ==> B050_C_500["color_00000500: CountTree count=1"]:::target + B050_C -.-> Other["other colors"]:::faded + B050 -.-> B050_0["[0]: 1000 byBrand refs"]:::faded + BR -.-> Brands["other brands"]:::faded + WD -.-> CO["color"]:::faded + WD -.-> PK["[0]"]:::faded + + classDef tree fill:#21262d,color:#c9d1d9,stroke:#1f6feb,stroke-width:2px; + classDef path fill:#6e7681,color:#fff,stroke:#1f6feb,stroke-width:2px; + classDef faded fill:#21262d,color:#6e7681,stroke:#484f58; + classDef target fill:#39c5cf,color:#0d1117,stroke:#39c5cf,stroke-width:3px; + + linkStyle 0 stroke:#1f6feb,stroke-width:3px; + linkStyle 1 stroke:#1f6feb,stroke-width:3px; + linkStyle 2 stroke:#1f6feb,stroke-width:3px; + linkStyle 3 stroke:#1f6feb,stroke-width:3px; +``` + +### Diagram: per-layer merk-tree structure (Layer 5+) + +This is the deepest descent in the chapter — four extra grove layers below the common Layers 1–4. Layer 5 enters `brand` (same as Query 2); Layer 6 lands on `brand_050` but doesn't terminate (its CountTree has a continuation child); Layer 7 is `brand_050`'s single-key sub-merk-tree carrying the byBrandColor continuation; Layer 8 is the byBrandColor terminator value tree where `color_00000500` is the actual target. + +```mermaid +flowchart TB + subgraph L5["Layer 5 — widget doctype merk-tree"] + direction TB + L5_q["brand
kv_hash=HASH[68b6...]
value: Tree (descent into byBrand)"]:::queried + L5_left["HASH[9862...]"]:::sibling + L5_right["HASH[6c36...]"]:::sibling + L5_q --> L5_left + L5_q --> L5_right + end + + subgraph L6["Layer 6 — byBrand merk-tree (intermediate stop)"] + direction TB + L6_q["brand_050
kv_hash=HASH[53db...]
value: CountTree count=1000
(continuation child via lower_layer)"]:::queried + L6_boundary["Boundary commitments (24 merk ops):
6 KVHash sibling brands + 6 Hash subtrees"]:::sibling + L6_q --> L6_boundary + end + + subgraph L7["Layer 7 — brand_050's continuation merk-tree (single key)"] + direction TB + L7_q["color
kv_hash=HASH[b1ce...]
value: NonCounted(ProvableCountTree)
(descent into byBrandColor)"]:::queried + L7_left["HASH[2190...]"]:::sibling + L7_q --> L7_left + end + + subgraph L8["Layer 8 — byBrandColor color sub-tree (TARGET layer)"] + direction TB + L8_target["color_00000500
KVValueHashFeatureTypeWithChildHash:
kv_hash=HASH[7f1d...]
value: CountTree count=1
feature: ProvableCountedMerkNode(1)
child_hash=HASH[078e...]"]:::target + L8_boundary["Boundary commitments (36 merk ops):
KVHashCount running totals
(3, 15, 1000, ...) + Hash subtrees
covering ~1000 colors under brand_050"]:::sibling + L8_target --> L8_boundary + end + + L5_q -. "Tree(merk_root[byBrand])" .-> L6_q + L6_q -. "CountTree continuation (child_hash)" .-> L7_q + L7_q -. "NonCounted(ProvableCountTree)" .-> L8_target + + classDef queried fill:#1f6feb,color:#fff,stroke:#1f6feb,stroke-width:2px; + classDef sibling fill:#6e7681,color:#fff,stroke:#6e7681; + classDef target fill:#39c5cf,color:#0d1117,stroke:#39c5cf,stroke-width:3px; +``` + +The two extra grove layers (L7 + L8) over Query 2's two-layer descent are what makes this the chapter's heaviest proof (1 911 B). The L7 layer is structurally trivial (one key) — its cost is the descent overhead, not the merk-tree boundary. L8 carries the same `ProvableCountTree` shape as Query 3's L6, but the contained key namespace is restricted to colors that co-occur with `brand_050`. + +## Query 5 — `In` on `byBrand` + +```text +select = COUNT +where = brand IN ["brand_000", "brand_001"] +prove = true +``` + +**Path query:** + +```text +path: ["@", contract_id, 0x01, "widget", "brand"] +query items: [Key("brand_000"), Key("brand_001")] +``` + +**Verified elements** (one per In value, returned in lex-asc order): + +```text +path: ["@", contract_id, 0x01, "widget", "brand"] +key: "brand_000" +element: CountTree { count_value_or_default: 1000 } + +path: ["@", contract_id, 0x01, "widget", "brand"] +key: "brand_001" +element: CountTree { count_value_or_default: 1000 } +``` + +**Proof size:** 1 102 B. + +**Proof display:** + +
+Expand to see the structured proof (5 layers, two `KVValueHash` items at the byBrand level) — or open interactively in the visualizer ↗ + +```text +GroveDBProofV1 { + LayerProof { + proof: Merk( + 0: Push(Hash(HASH[bd291f29893fb6f6d6201087746ca1f23a178dd08e1346cb6c127e91ae3623b3])) + 1: Push(KVValueHash(@, Tree(4ed22624752972af97fb71abf4067b23e6d296a61a02f35b2098819fde39d289), HASH[4a5a28cb1b40226aa35b2f0d502767df13268bdf4678627dbfde26a557acdf73])) + 2: Parent + 3: Push(Hash(HASH[19c924989e473a90d0848277d0b1498ccc8db3dc870cbc130e773f3d79ea5b71])) + 4: Child) + lower_layers: { + @ => { + LayerProof { + proof: Merk( + 0: Push(KVValueHash(0x4ed22624752972af97fb71abf4067b23e6d296a61a02f35b2098819fde39d289, Tree(01), HASH[5b90e1e952b7eef903cc9db2d9098e334a37f7e08cade52c6b2ea3bf4b56b645]))) + lower_layers: { + 0x4ed22624752972af97fb71abf4067b23e6d296a61a02f35b2098819fde39d289 => { + LayerProof { + proof: Merk( + 0: Push(Hash(HASH[49e7191075272395ed72cf03e973987ede6e4945e08574fe77d725f4ce7ecdf8])) + 1: Push(KVValueHash(0x01, Tree(776964676574), HASH[5d9a0fad8a3f32560f8e8950c1e84a7feabaab21b79bc72fec4482442844e2ef])) + 2: Parent) + lower_layers: { + 0x01 => { + LayerProof { + proof: Merk( + 0: Push(KVValueHash(widget, Tree(6272616e64), HASH[6c505f53f2ebf3de030cc2aca463d4b429aeb320a9fadb8ae68bb7903a22bb68]))) + lower_layers: { + widget => { + LayerProof { + proof: Merk( + 0: Push(Hash(HASH[9862894b16a0792688fdcf64edcb2ceade5c8b234649bfc6cfc6426869b0e9d9])) + 1: Push(KVValueHash(brand, Tree(6272616e645f303633), HASH[68b697da99d6ea70a83eb41794dca7ba3938d0ba98fbfaeb3cd0c19b3b5d0ff2])) + 2: Parent + 3: Push(Hash(HASH[6c36729e93b1a316cbf60fe282eb630c0ed6e45db088e365110302b6c9caba86])) + 4: Child) + lower_layers: { + brand => { + LayerProof { + proof: Merk( + 0: Push(KVValueHashFeatureTypeWithChildHash(brand_000, CountTree(636f6c6f72, 1000, flags: [0, 0, 0]), HASH[90ff6f6d9a3d901195982128130677243bfd27b75736206f3c8400966ef0d37b], BasicMerkNode, HASH[19b58883c492e746861db1e6ad07529a5a91cc8330af522682486db9346d6875])) + 1: Push(KVValueHashFeatureTypeWithChildHash(brand_001, CountTree(636f6c6f72, 1000, flags: [0, 0, 0]), HASH[484ca11fb4ec8f479be1f78af903ce0c9d4fe630517579fb0172c2576d6b9652], BasicMerkNode, HASH[0bf12023f8e067c12db4cec1583909a0283878d6d909c76196736299750b5879])) + 2: Parent + 3: Push(Hash(HASH[8ca09dadc802a7efe03534ce4ad991b2f191f368878754a37b5e5c03d9498dab])) + 4: Child + 5: Push(KVHash(HASH[e5297b3ebe81c6435c29f712074da5f7c90265e12ed3d4f5af1f6d900e50c9f1])) + 6: Parent + 7: Push(Hash(HASH[50f373fd01dea89c992779764dff82cc7200b492be8f5cf3721627d5323bcbff])) + 8: Child + 9: Push(KVHash(HASH[cf78c9f1b1a1204bb2e437806f52c21e331392de3436388572bd1fa4bce1cdc7])) + 10: Parent + 11: Push(Hash(HASH[4a8dc186a95c8c4a1252fb51dbc407727f588eb5bdc8313c96f5c29889e13926])) + 12: Child + 13: Push(KVHash(HASH[d00ee7653e34e47d46004929b13ded33dff069ed9cc88342cecdf66a65fd8401])) + 14: Parent + 15: Push(Hash(HASH[7f1d17b9632f0bd440dacf5e841025482bc1d8145df3650301a95a5ee71ce8c8])) + 16: Child + 17: Push(KVHash(HASH[3ed48a5e35cb7546d329487b0e1ab8a81d7c5bec358c37449e6cbd956e3bb069])) + 18: Parent + 19: Push(Hash(HASH[eaef9fc530408393bc321409414814b290309a861f474a925a922250327affc6])) + 20: Child + 21: Push(KVHash(HASH[f776417ede76e6194706e483ac14ab7b3db6aa0461ec14ed5f8e5d20071363af])) + 22: Parent + 23: Push(Hash(HASH[b3fccba79c14fcc5e97ff6a3cd051228dc755e6de147bef690ba9681264b2b9f])) + 24: Child) + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } +} +``` + +The two `Push(KVValueHashFeatureTypeWithChildHash(brand_NNN, CountTree(…, 1000, …), …))` ops are the actual verified elements — both inlined in the byBrand layer's merk proof. They share the same parent path (`@/.../widget/brand`); the verifier-side `verify_query` returns both as siblings rather than descending one more layer per value (which is what the legacy `Key([0])` shape would have forced for a normal-countable index, but no longer does — every countable terminator's value tree is a CountTree). The remaining 22 ops are the boundary-path hashes that prove `brand_000` and `brand_001` actually occupy the merk-tree positions claimed. + +
+ +The outer query enumerates `Key(in_value)` items at the property-name subtree; each resolved element is itself a value-tree `CountTree`. No subquery is set — the In values' value trees *are* the count-bearing elements. The verifier reads the per-In value from `grove_key` (rather than from `path[base_path_len]`, which is how it would for a trailing-Equal compound). The caller sums the two `count_value_or_default` reads (or surfaces them as per-group entries if `group_by = ["brand"]`). + +```mermaid +flowchart TB + WD["@/contract_id/0x01/widget"]:::tree + WD ==> BR["brand: NormalTree"]:::path + BR ==> B000["brand_000: CountTree count=1000"]:::target + BR ==> B001["brand_001: CountTree count=1000"]:::target + BR -.-> BMore["brand_002 ... brand_099"]:::faded + B000 -.-> B000_0["[0]: 1000 refs"]:::faded + B001 -.-> B001_0["[0]: 1000 refs"]:::faded + WD -.-> PK["[0]"]:::faded + WD -.-> CO["color"]:::faded + + classDef tree fill:#21262d,color:#c9d1d9,stroke:#1f6feb,stroke-width:2px; + classDef path fill:#6e7681,color:#fff,stroke:#1f6feb,stroke-width:2px; + classDef faded fill:#21262d,color:#6e7681,stroke:#484f58; + classDef target fill:#39c5cf,color:#0d1117,stroke:#39c5cf,stroke-width:3px; + + linkStyle 0 stroke:#1f6feb,stroke-width:3px; + linkStyle 1 stroke:#1f6feb,stroke-width:3px; + linkStyle 2 stroke:#1f6feb,stroke-width:3px; +``` + +### Diagram: per-layer merk-tree structure (Layer 5+) + +Same L5 shape as Query 2 (brand queried, two opaque sibling subtrees). At Layer 6 the proof inlines two `KVValueHashFeatureTypeWithChildHash(brand_NNN, ...)` ops at the byBrand layer — both verified elements share the same parent path, so no extra grove descent is needed. + +```mermaid +flowchart TB + subgraph L5["Layer 5 — widget doctype merk-tree"] + direction TB + L5_q["brand
kv_hash=HASH[68b6...]
value: Tree (descent into byBrand)"]:::queried + L5_left["HASH[9862...]"]:::sibling + L5_right["HASH[6c36...]"]:::sibling + L5_q --> L5_left + L5_q --> L5_right + end + + subgraph L6["Layer 6 — byBrand merk-tree (TWO TARGETS)"] + direction TB + L6_t1["brand_001
kv_hash=HASH[484c...]
value: CountTree count=1000
child_hash=HASH[0bf1...]"]:::target + L6_t0["brand_000
kv_hash=HASH[90ff...]
value: CountTree count=1000
child_hash=HASH[19b5...]"]:::target + L6_boundary["Boundary commitments (22 merk ops):
7 KVHash opaque sibling brands
+ 7 Hash subtree commitments
(prove the two targets' adjacent positions)"]:::sibling + L6_t1 --> L6_t0 + L6_t1 --> L6_boundary + end + + L5_q -. "Tree(merk_root[byBrand])" .-> L6_t1 + + classDef queried fill:#1f6feb,color:#fff,stroke:#1f6feb,stroke-width:2px; + classDef sibling fill:#6e7681,color:#fff,stroke:#6e7681; + classDef target fill:#39c5cf,color:#0d1117,stroke:#39c5cf,stroke-width:3px; +``` + +Marginally larger than Query 2 (1 102 B vs 1 041 B) — the extra cost is one extra `KVValueHashFeatureTypeWithChildHash` op plus one merge op. The boundary commitments shrink slightly because the two adjacent targets share part of the merk-tree path. + +## Query 6 — `In` on `byColor` (RangeCountable) + +```text +select = COUNT +where = color IN ["color_00000000", "color_00000001"] +prove = true +``` + +**Path query:** + +```text +path: ["@", contract_id, 0x01, "widget", "color"] +query items: [Key("color_00000000"), Key("color_00000001")] +``` + +**Verified elements:** + +```text +path: ["@", contract_id, 0x01, "widget", "color"] +key: "color_00000000" +element: CountTree { count_value_or_default: 100 } + +path: ["@", contract_id, 0x01, "widget", "color"] +key: "color_00000001" +element: CountTree { count_value_or_default: 100 } +``` + +**Proof size:** 1 381 B. + +**Proof display:** + +
+Expand to see the structured proof (5 layers; bottom layer carries `KVHashCount` running totals from the `ProvableCountTree`) — or open interactively in the visualizer ↗ + +```text +GroveDBProofV1 { + LayerProof { + proof: Merk( + 0: Push(Hash(HASH[bd291f29893fb6f6d6201087746ca1f23a178dd08e1346cb6c127e91ae3623b3])) + 1: Push(KVValueHash(@, Tree(4ed22624752972af97fb71abf4067b23e6d296a61a02f35b2098819fde39d289), HASH[4a5a28cb1b40226aa35b2f0d502767df13268bdf4678627dbfde26a557acdf73])) + 2: Parent + 3: Push(Hash(HASH[19c924989e473a90d0848277d0b1498ccc8db3dc870cbc130e773f3d79ea5b71])) + 4: Child) + lower_layers: { + @ => { + LayerProof { + proof: Merk( + 0: Push(KVValueHash(0x4ed22624752972af97fb71abf4067b23e6d296a61a02f35b2098819fde39d289, Tree(01), HASH[5b90e1e952b7eef903cc9db2d9098e334a37f7e08cade52c6b2ea3bf4b56b645]))) + lower_layers: { + 0x4ed22624752972af97fb71abf4067b23e6d296a61a02f35b2098819fde39d289 => { + LayerProof { + proof: Merk( + 0: Push(Hash(HASH[49e7191075272395ed72cf03e973987ede6e4945e08574fe77d725f4ce7ecdf8])) + 1: Push(KVValueHash(0x01, Tree(776964676574), HASH[5d9a0fad8a3f32560f8e8950c1e84a7feabaab21b79bc72fec4482442844e2ef])) + 2: Parent) + lower_layers: { + 0x01 => { + LayerProof { + proof: Merk( + 0: Push(KVValueHash(widget, Tree(6272616e64), HASH[6c505f53f2ebf3de030cc2aca463d4b429aeb320a9fadb8ae68bb7903a22bb68]))) + lower_layers: { + widget => { + LayerProof { + proof: Merk( + 0: Push(Hash(HASH[9862894b16a0792688fdcf64edcb2ceade5c8b234649bfc6cfc6426869b0e9d9])) + 1: Push(KVHash(HASH[a29ee8f206a253362b6da4fcacf8643ee8e5925cd979fcd449e5906f0f9f8be3])) + 2: Parent + 3: Push(KVValueHash(color, ProvableCountTree(636f6c6f725f3030303030353131, 100000), HASH[79569d595db75bbf2e9dca93a15c90b7eecf7b299632668ec410e2076d27f71c])) + 4: Child) + lower_layers: { + color => { + LayerProof { + proof: Merk( + 0: Push(KVValueHashFeatureTypeWithChildHash(color_00000000, CountTree(00, 100, flags: [0, 0, 0]), HASH[ce582ad80dab7f822798cbdcd4a7e2d454339ef5da50af688e31acb463f13bc6], ProvableCountedMerkNode(100), HASH[ad2891a5a377d25ef300546faaa2acef14cb3431490a86ed1d16d5fd69ec9e3f])) + 1: Push(KVValueHashFeatureTypeWithChildHash(color_00000001, CountTree(00, 100, flags: [0, 0, 0]), HASH[c4024227f61350e128189bbfdb9cb3de893aef09626680a3d2336f991c1dbb14], ProvableCountedMerkNode(300), HASH[45e2452816d75b27baa9d1b8a82a251ce218d949d003bceb2e22ce1988312c4d])) + 2: Parent + 3: Push(Hash(HASH[cb34b6fa0bd36bf67c93768f3bdbadc7c5f4f143215222ff8bc8bbff5df0dc93])) + 4: Child + 5: Push(KVHashCount(HASH[2e045e449ad64fe27461182e3f335ee8fb65183c18a3fd3e4ff175c9e767b04b], 700)) + 6: Parent + 7: Push(Hash(HASH[8d73c136c1428e6cca5c6579faeb12b9cc4e7094bdbdba383097d2d05032a414])) + 8: Child + 9: Push(KVHashCount(HASH[a9f7d6ebc19c3405af2ef32cbdf4f4ec0d4a96592bb5d389f9ab0462389c6fb5], 1500)) + 10: Parent + 11: Push(Hash(HASH[e131726e58ca916c5d2c3fdff06be027b7bca567b45a1854b38774b7eb429b47])) + 12: Child + 13: Push(KVHashCount(HASH[c982b92207e31779affbc3c4495d175948ca647b9c15740c0cb0f6b7fede6d0d], 3100)) + 14: Parent + 15: Push(Hash(HASH[c8f1d0d58823e8fb60dbd838fdd5b984c6940e1d4d4976473e8718a638dcd64c])) + 16: Child + 17: Push(KVHashCount(HASH[8dbbcf0d3b51cfa3f8c40c815b8904b650fd51e3bb55ae40f741f7341248ac38], 6300)) + 18: Parent + 19: Push(Hash(HASH[28f1a2ab09b0920e50bdfd4d062412ba9c1d39d33579d485360e7a0941675a43])) + 20: Child + 21: Push(KVHashCount(HASH[6bf705340b0ff3872a4f692fc10bae0dd9e63fa2726bb3fd284fbfc273ef24af], 12700)) + 22: Parent + 23: Push(Hash(HASH[8ebe73647e431636fe22547384c36bfd83d77a0e109dd3e3f5a69e691c860f9e])) + 24: Child + 25: Push(KVHashCount(HASH[b2fa1534ef346372a7d2df562fe4fc4938bd07bc72af5a147529478af878972d], 25500)) + 26: Parent + 27: Push(Hash(HASH[db461b2f973111b65f34f31313ccff5530b24fa17bc7e5313d4794783336df24])) + 28: Child + 29: Push(KVHashCount(HASH[3684347a67ceedad2ff4a7fce6ae303086543c1f146f5865dfdc23612308c05b], 51100)) + 30: Parent + 31: Push(Hash(HASH[e8c957f1d52f9ae3932f1f8d3e3d7f761569b52b29ffd7dc3f4c0c976405b3b4])) + 32: Child + 33: Push(KVHashCount(HASH[c32ae0189f148c2390791534ff4bc205fabb53a7c7d15f109a4354170045308c], 100000)) + 34: Parent + 35: Push(Hash(HASH[1a1c99166d7b1e1eb9087404f3bfae82d749a3a7a763da654f48c5d314e21e76])) + 36: Child) + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } +} +``` + +Same layer count as Query 5 (5 layers) and same inline-two-elements pattern at the bottom. The difference is in the merk-tree node *type* surrounding the verified elements: byColor's bottom layer is a `ProvableCountTree`, so each sibling's merk-path operation is a `KVHashCount(HASH[...], N)` (carrying the sibling's running count) rather than the plain `KVHash(HASH[...])` you see in Query 5's byBrand layer. The boundary-proof ops here read like a histogram of the byColor tree's per-subtree counts (700, 1500, 3100, 6300, 12700, 25500, 51100, 100000) — that's the same information Query 7 will sum over directly without descending to any specific value tree. + +
+ +Same query shape as Query 5 — outer `Key`-per-In-value, no subquery, per-In `CountTree`s resolved at the bottom. The difference vs Query 5 is the *property-name* tree above is a `ProvableCountTree` instead of `NormalTree`. That doesn't change the proof's structural shape, but it does mean a future `color > X` range query against this property has a fast path Query 5's `brand` doesn't. + +```mermaid +flowchart TB + WD["@/contract_id/0x01/widget"]:::tree + WD ==> CO["color: ProvableCountTree"]:::path + CO ==> C000["color_00000000: CountTree count=100"]:::target + CO ==> C001["color_00000001: CountTree count=100"]:::target + CO -.-> CMore["color_00000002 ... color_00000999"]:::faded + C000 -.-> C000_0["[0]: 100 refs"]:::faded + C001 -.-> C001_0["[0]: 100 refs"]:::faded + WD -.-> PK["[0]"]:::faded + WD -.-> BR["brand"]:::faded + + classDef tree fill:#21262d,color:#c9d1d9,stroke:#1f6feb,stroke-width:2px; + classDef path fill:#d29922,color:#0d1117,stroke:#1f6feb,stroke-width:2px; + classDef faded fill:#21262d,color:#6e7681,stroke:#484f58; + classDef target fill:#39c5cf,color:#0d1117,stroke:#39c5cf,stroke-width:3px; + + linkStyle 0 stroke:#1f6feb,stroke-width:3px; + linkStyle 1 stroke:#1f6feb,stroke-width:3px; + linkStyle 2 stroke:#1f6feb,stroke-width:3px; +``` + +### Diagram: per-layer merk-tree structure (Layer 5+) + +Same L5 shape as Query 3 (color queried under an opaque kv root). L6 inlines two `KVValueHashFeatureTypeWithChildHash` targets in the byColor `ProvableCountTree` — the difference from Query 5's L6 is the surrounding boundary ops carry `KVHashCount` running totals instead of plain `KVHash`. + +```mermaid +flowchart TB + subgraph L5["Layer 5 — widget doctype merk-tree (proof view for `color`)"] + direction TB + L5_root["KVHash[a29e...]
(opaque kv root)"]:::sibling + L5_left["HASH[9862...]"]:::sibling + L5_q["color
kv_hash=HASH[7956...]
value: ProvableCountTree (descent)"]:::queried + L5_root --> L5_left + L5_root --> L5_q + end + + subgraph L6["Layer 6 — byColor ProvableCountTree merk-tree (TWO TARGETS)"] + direction TB + L6_t1["color_00000001
kv_hash=HASH[c402...]
value: CountTree count=100
feature: ProvableCountedMerkNode(300)"]:::target + L6_t0["color_00000000
kv_hash=HASH[ce58...]
value: CountTree count=100
feature: ProvableCountedMerkNode(100)"]:::target + L6_boundary["Boundary commitments (34 merk ops):
8 KVHashCount running totals
(700, 1500, 3100, 6300, 12700,
25500, 51100, 100000)
+ Hash subtree commitments"]:::sibling + L6_t1 --> L6_t0 + L6_t1 --> L6_boundary + end + + L5_q -. "ProvableCountTree(merk_root[byColor])" .-> L6_t1 + + classDef queried fill:#1f6feb,color:#fff,stroke:#1f6feb,stroke-width:2px; + classDef sibling fill:#6e7681,color:#fff,stroke:#6e7681; + classDef target fill:#39c5cf,color:#0d1117,stroke:#39c5cf,stroke-width:3px; +``` + +The two-In-values pattern carries over from Query 5; the per-subtree counts on the boundary `KVHashCount` ops are the same data Query 7 uses as the integrand for its range aggregate. + +## Query 7 — Range Query (`AggregateCountOnRange`) + +```text +select = COUNT +where = color > "color_00000500" +prove = true +``` + +**Path query** (different primitive — note the `AggregateCountOnRange` query item): + +```text +path: ["@", contract_id, 0x01, "widget", "color"] +query items: [AggregateCountOnRange([RangeAfter("color_00000500"..)])] +``` + +**Verified payload** (different verifier — `GroveDb::verify_aggregate_count_query` returns a single `u64`, not an element list): + +```text +root_hash: 0x62ee7348f4d28dd9d7cf86a6c725fa8276cfd446f6007a6000fb0e1dfefa6468 +count: 49900 +``` + +**Proof size:** 2 072 B. + +**Proof display:** + +
+Expand to see the structured proof (5 layers; bottom layer uses `HashWithCount` + `KVDigestCount` ops instead of `KVValueHash` — the AggregateCountOnRange-specific merk primitive) — or open interactively in the visualizer ↗ + +```text +GroveDBProofV1 { + LayerProof { + proof: Merk( + 0: Push(Hash(HASH[bd291f29893fb6f6d6201087746ca1f23a178dd08e1346cb6c127e91ae3623b3])) + 1: Push(KVValueHash(@, Tree(4ed22624752972af97fb71abf4067b23e6d296a61a02f35b2098819fde39d289), HASH[4a5a28cb1b40226aa35b2f0d502767df13268bdf4678627dbfde26a557acdf73])) + 2: Parent + 3: Push(Hash(HASH[19c924989e473a90d0848277d0b1498ccc8db3dc870cbc130e773f3d79ea5b71])) + 4: Child) + lower_layers: { + @ => { + LayerProof { + proof: Merk( + 0: Push(KVValueHash(0x4ed22624752972af97fb71abf4067b23e6d296a61a02f35b2098819fde39d289, Tree(01), HASH[5b90e1e952b7eef903cc9db2d9098e334a37f7e08cade52c6b2ea3bf4b56b645]))) + lower_layers: { + 0x4ed22624752972af97fb71abf4067b23e6d296a61a02f35b2098819fde39d289 => { + LayerProof { + proof: Merk( + 0: Push(Hash(HASH[49e7191075272395ed72cf03e973987ede6e4945e08574fe77d725f4ce7ecdf8])) + 1: Push(KVValueHash(0x01, Tree(776964676574), HASH[5d9a0fad8a3f32560f8e8950c1e84a7feabaab21b79bc72fec4482442844e2ef])) + 2: Parent) + lower_layers: { + 0x01 => { + LayerProof { + proof: Merk( + 0: Push(KVValueHash(widget, Tree(6272616e64), HASH[6c505f53f2ebf3de030cc2aca463d4b429aeb320a9fadb8ae68bb7903a22bb68]))) + lower_layers: { + widget => { + LayerProof { + proof: Merk( + 0: Push(Hash(HASH[9862894b16a0792688fdcf64edcb2ceade5c8b234649bfc6cfc6426869b0e9d9])) + 1: Push(KVHash(HASH[a29ee8f206a253362b6da4fcacf8643ee8e5925cd979fcd449e5906f0f9f8be3])) + 2: Parent + 3: Push(KVValueHash(color, ProvableCountTree(636f6c6f725f3030303030353131, 100000), HASH[79569d595db75bbf2e9dca93a15c90b7eecf7b299632668ec410e2076d27f71c])) + 4: Child) + lower_layers: { + color => { + LayerProof { + proof: Merk( + 0: Push(HashWithCount(kv_hash=HASH[b2fa1534ef346372a7d2df562fe4fc4938bd07bc72af5a147529478af878972d], left=HASH[e8368be0ff72f87a2132f09d8d68d6dca140bc3c5b048d5f4f6fc8ab9b7bc554], right=HASH[db461b2f973111b65f34f31313ccff5530b24fa17bc7e5313d4794783336df24], count=25500)) + 1: Push(KVDigestCount(color_00000255, HASH[adfb158116847927badc07be9745a21be7e2660a8b75f8a310aba9025f91feec], 51100)) + 2: Parent + 3: Push(HashWithCount(kv_hash=HASH[e4f3a5c9fdf17ccb2c7508839b2fdcfd4cd878ed1d59270929ac69ef63179402], left=HASH[848d5873de457b1be03c8c7d74733b92874f2071028fdd6d30e8ca16c18a9770], right=HASH[676f04d3603911ecd1e0d2d01c2691b173df672b40daf8a7730f73c50d39e07e], count=12700)) + 4: Push(KVDigestCount(color_00000383, HASH[14f48ee200148a9c4c673809297bdfb71e79fe9902b130e7842fbdb18c2e1a31], 25500)) + 5: Parent + 6: Push(HashWithCount(kv_hash=HASH[42a257d9bc608c6b1a419f8e081b08df9056832c72e36b5dc07c4b724fb37578], left=HASH[65b3058c7b4d9bcfcf6022645f66bbaed9dbbdb74b7dbf367bbe2240263db767], right=HASH[315927383b45959aa67b32fb26b0b7c21baf6afbb1fcdc05e9c8c43a3c02b6c6], count=6300)) + 7: Push(KVDigestCount(color_00000447, HASH[dcbfdf897e1b1d83a55172b6fa463446cd5e016331ba075440f7f1091d02467b], 12700)) + 8: Parent + 9: Push(HashWithCount(kv_hash=HASH[ada831d9c38535694323d9092ab9c42e39949c9d2e4567fafd084b0f5754b0d9], left=HASH[09229789d4fdf4baba7646d3bd12e6b77b83ce19f7f1c0918b60b3c1de5bd8ea], right=HASH[ce92f20c6b464d3ff4c95f8f1ee49149aacc50298eaed2c6a2849d588bd4a667], count=3100)) + 10: Push(KVDigestCount(color_00000479, HASH[1e6eb9e928e8bb229309db3a4a2c0f3041c63e90eb646061e4f5d82b1d65a1ac], 6300)) + 11: Parent + 12: Push(HashWithCount(kv_hash=HASH[ae65499e6a1c105c878c418b09732df2dee29cf7db74c4b2e93b989710b449d0], left=HASH[94eac0807596d751092d12f27195dc72324f45999f4fc483688a9c15c554ecf3], right=HASH[fb4298cd62e8a90af17f9133fd4c106ec1da4b16be2954fc542af6ad0f6e316e], count=1500)) + 13: Push(KVDigestCount(color_00000495, HASH[cca12136fed93b88094fc80ceb5722b752860000478404c62f7862eb652e268f], 3100)) + 14: Parent + 15: Push(HashWithCount(kv_hash=HASH[db1493f4f683045aa7604c6a06c0280fecb34b352503b148eab16e245938492f], left=HASH[50f064fdcdd8e0f3e1eb86b98dc8eb6f7a8df0b26037df202b21726a05edeb79], right=HASH[d6e96c2078316fcd74e62265173c2bb52a94ad4ef0bccac569557f675307b382], count=300)) + 16: Push(KVDigestCount(color_00000499, HASH[66e2d072be547070b1d433cb0f05f09ef508ec4d4f0702db4f49e71896ad91bc], 700)) + 17: Parent + 18: Push(KVDigestCount(color_00000500, HASH[47b0ade593a2e4e99e7d7363f5d1f692882007397f025226f19d097ca2f407fa], 100)) + 19: Push(KVDigestCount(color_00000501, HASH[9146433eb6d43db2f109f5f7714146624bd646b27c7310f3c2cad7155eb7c741], 300)) + 20: Parent + 21: Push(HashWithCount(kv_hash=HASH[bbac5fc7646d820e2912c1771333ebc83b1012619347aa04cce3c4ad13c11eea], left=HASH[0000000000000000000000000000000000000000000000000000000000000000], right=HASH[0000000000000000000000000000000000000000000000000000000000000000], count=100)) + 22: Child + 23: Child + 24: Push(KVDigestCount(color_00000503, HASH[66ea1280c29a6ea350e0c6695ab80430f5d3b5dc2df0f5a4d544a918d9fba29a], 1500)) + 25: Parent + 26: Push(HashWithCount(kv_hash=HASH[4d7b5c895a6fb1e451ce85a522ecf18484fd1e406945cde8df9c75ec2152757e], left=HASH[6be0f9637caa5b6c09adb59618a8a90494e2f43a5e9948dc32d68af74528578a], right=HASH[ce1146de6de82a9767edf38a5cc11b5498e57023684acbe9e20bc3104ade94cf], count=700)) + 27: Child + 28: Child + 29: Child + 30: Child + 31: Child + 32: Child + 33: Push(KVDigestCount(color_00000511, HASH[c7fdd609ef67f184976b1bdfeb97245fdfcb33e53ff6841277def88f55bc9c41], 100000)) + 34: Parent + 35: Push(HashWithCount(kv_hash=HASH[6abc81973aeff51137a002d32ac447e6b91ebf507e34a4a13ec9d1bed4516d23], left=HASH[99323fb716110f45836334025ec154fcc56193c11ee0811bdd86320c0f8164ed], right=HASH[33b9e5cbdf27883150262112aaefda71c0b725a58c3f929ad1ce1cdd3f90aacd], count=48800)) + 36: Child) + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } +} +``` + +The bottom layer uses different merk-proof operations than every other query so far ([Query 8](#query-8--compound-equal-plus-range-bybrandcolor) shares this shape one level deeper). `AggregateCountOnRange` doesn't return individual elements; it walks the boundary of the requested range (`color > "color_00000500"`) over the `ProvableCountTree`'s internal nodes and uses two specialized operations: + +- **`HashWithCount(kv_hash, left, right, count)`** — a boundary node that hides its full subtree behind a single hash + count. The `count` field is the load-bearing piece: the verifier just sums these without descending. In this proof you can see `count=48800` at the bottom-right boundary node (everything to the right of the range cut, plus another `count=100000` showing somewhere in the in-range path), and the prover walks the cut so each `HashWithCount` covers a different chunk of the range. +- **`KVDigestCount(key, kv_hash, count)`** — a *boundary* key inside the in-range region; the prover names the key so the verifier knows exactly where the cut is, but only commits the hash + count, not the value. Note the keys here climb monotonically (`color_00000255 → 383 → 447 → 479 → 495 → 499 → 500 → 501 → 511`); each one names a binary-tree boundary node on the path from the range start (`color_00000500`) to the right edge of the tree. + +The final summed `count: 49900` is what the verifier returns. There's no `CountTree(…)` element in this proof — the running totals inside `HashWithCount` / `KVDigestCount` *are* the proof's count surface, committed into the `ProvableCountTree`'s merk root at insertion time. + +
+ +Together with [Query 8](#query-8--compound-equal-plus-range-bybrandcolor) (the compound `brand == X AND color > Y` variant), this is one of two queries in the chapter that use a different GroveDB primitive. Instead of resolving N specific keys, `AggregateCountOnRange` walks the boundary of the requested range over `widget/color`'s `ProvableCountTree` and sums the per-node counts already committed inside that tree. The proof carries the boundary merk path and the running total; the verifier returns just the count. + +The reason this works *only* with `rangeCountable: true` (Query 5's `byBrand` couldn't do the equivalent) is that `widget/color` is a `ProvableCountTree` — its internal merk nodes carry running counts. `widget/brand` is a plain `NormalTree`; it would have to enumerate every brand and sum their counts (which is what `brand IN [...]` does, but for an unbounded range that's not a feasible proof shape). + +```mermaid +flowchart TB + WD["@/contract_id/0x01/widget"]:::tree + WD ==> CO["color: ProvableCountTree
(internal merk nodes carry running counts)"]:::target + CO -.-> C500["color_00000500 (boundary)"]:::faded + CO -.-> CMore["color_00000501 ... color_00000999
(in range, summed via merk-node counts)"]:::faded + CO -.-> CBelow["color_00000000 ... color_00000499
(below range, skipped)"]:::faded + WD -.-> PK["[0]"]:::faded + WD -.-> BR["brand"]:::faded + + classDef tree fill:#21262d,color:#c9d1d9,stroke:#1f6feb,stroke-width:2px; + classDef faded fill:#21262d,color:#6e7681,stroke:#484f58; + classDef target fill:#39c5cf,color:#0d1117,stroke:#39c5cf,stroke-width:3px; + + linkStyle 0 stroke:#1f6feb,stroke-width:3px; +``` + +### Diagram: per-layer merk-tree structure (Layer 5+) + +Same L5 shape as Query 3 / Query 6 (color queried under an opaque kv root). L6 is fundamentally different from every other query: no individual elements are returned — the proof walks the boundary of the range `color > "color_00000500"` over the `ProvableCountTree` and sums per-node counts directly. The merk ops at L6 are `HashWithCount` (boundary subtree hashes carrying their full subtree count) and `KVDigestCount` (named boundary keys with hash + count, no value). + +```mermaid +flowchart TB + subgraph L5["Layer 5 — widget doctype merk-tree (proof view for `color`)"] + direction TB + L5_root["KVHash[a29e...]
(opaque kv root)"]:::sibling + L5_left["HASH[9862...]"]:::sibling + L5_q["color
kv_hash=HASH[7956...]
value: ProvableCountTree count=100000
(descent into byColor)"]:::queried + L5_root --> L5_left + L5_root --> L5_q + end + + subgraph L6["Layer 6 — byColor ProvableCountTree merk-tree (range-aggregate cut)"] + direction TB + L6_result["Aggregate count = 49900
(returned by verify_aggregate_count_query —
a single u64, not an element list)"]:::target + L6_inrange["KVDigestCount ops along the in-range path:
color_00000500 (count=100), color_00000501 (300),
color_00000503 (1500), color_00000511 (100000)"]:::sibling + L6_boundary["HashWithCount boundary nodes covering
chunks of the cut: counts
(25500, 12700, 6300, 3100, 1500, 300, 100, 700, 48800)
+ KVDigestCount path keys above the cut
(color_00000255, 383, 447, 479, 495, 499)"]:::sibling + L6_result --> L6_inrange + L6_result --> L6_boundary + end + + L5_q -. "ProvableCountTree(merk_root[byColor])" .-> L6_result + + classDef queried fill:#1f6feb,color:#fff,stroke:#1f6feb,stroke-width:2px; + classDef sibling fill:#6e7681,color:#fff,stroke:#6e7681; + classDef target fill:#39c5cf,color:#0d1117,stroke:#39c5cf,stroke-width:3px; +``` + +The `ProvableCountTree`'s value isn't to expose individual elements — it's to make the summation itself O(log n) instead of O(distinct values in range). The proof bytes are larger than Query 6's two-element point lookup (~2 KB vs ~1.4 KB) because the AggregateCountOnRange primitive has more structural overhead per result, but it scales to any size range in fixed proof bytes, where the point-lookup shape grows linearly with the number of resolved keys. + +## Query 8 — Compound Equal-plus-Range (`byBrandColor`) + +```text +select = COUNT +where = brand == "brand_050" AND color > "color_00000500" +prove = true +``` + +**Path query** (the prefix `brand == X` fixes one byBrandColor leg; the range walks the terminator's `ProvableCountTree`): + +```text +path: ["@", contract_id, 0x01, "widget", "brand", "brand_050", "color"] +query items: [AggregateCountOnRange([RangeAfter("color_00000500"..)])] +``` + +**Verified payload** (same primitive as Query 7 — `GroveDb::verify_aggregate_count_query` returns a single `u64`): + +```text +root_hash: 0x62ee7348f4d28dd9d7cf86a6c725fa8276cfd446f6007a6000fb0e1dfefa6468 +count: 499 +``` + +The bench's deterministic schedule gives every brand all 1 000 colors; the strict `>` cut at `color_00000500` leaves `color_00000501..color_00000999` = **499** colors paired with `brand_050`, each contributing exactly 1 document. + +**Proof size:** 2 656 B. + +**Proof display:** + +
+Expand to see the structured proof (8 layers — same descent as Query 4 down to `brand_050`'s color subtree, then `HashWithCount` / `KVDigestCount` ops over the byBrandColor terminator) — or open interactively in the visualizer ↗ + +```text +GroveDBProofV1 { + LayerProof { + proof: Merk( + 0: Push(Hash(HASH[bd291f29893fb6f6d6201087746ca1f23a178dd08e1346cb6c127e91ae3623b3])) + 1: Push(KVValueHash(@, Tree(4ed22624752972af97fb71abf4067b23e6d296a61a02f35b2098819fde39d289), HASH[4a5a28cb1b40226aa35b2f0d502767df13268bdf4678627dbfde26a557acdf73])) + 2: Parent + 3: Push(Hash(HASH[19c924989e473a90d0848277d0b1498ccc8db3dc870cbc130e773f3d79ea5b71])) + 4: Child) + lower_layers: { + @ => { + LayerProof { + proof: Merk( + 0: Push(KVValueHash(0x4ed22624752972af97fb71abf4067b23e6d296a61a02f35b2098819fde39d289, Tree(01), HASH[5b90e1e952b7eef903cc9db2d9098e334a37f7e08cade52c6b2ea3bf4b56b645]))) + lower_layers: { + 0x4ed22624752972af97fb71abf4067b23e6d296a61a02f35b2098819fde39d289 => { + LayerProof { + proof: Merk( + 0: Push(Hash(HASH[49e7191075272395ed72cf03e973987ede6e4945e08574fe77d725f4ce7ecdf8])) + 1: Push(KVValueHash(0x01, Tree(776964676574), HASH[5d9a0fad8a3f32560f8e8950c1e84a7feabaab21b79bc72fec4482442844e2ef])) + 2: Parent) + lower_layers: { + 0x01 => { + LayerProof { + proof: Merk( + 0: Push(KVValueHash(widget, Tree(6272616e64), HASH[6c505f53f2ebf3de030cc2aca463d4b429aeb320a9fadb8ae68bb7903a22bb68]))) + lower_layers: { + widget => { + LayerProof { + proof: Merk( + 0: Push(Hash(HASH[9862894b16a0792688fdcf64edcb2ceade5c8b234649bfc6cfc6426869b0e9d9])) + 1: Push(KVValueHash(brand, Tree(6272616e645f303633), HASH[68b697da99d6ea70a83eb41794dca7ba3938d0ba98fbfaeb3cd0c19b3b5d0ff2])) + 2: Parent + 3: Push(Hash(HASH[6c36729e93b1a316cbf60fe282eb630c0ed6e45db088e365110302b6c9caba86])) + 4: Child) + lower_layers: { + brand => { + LayerProof { + proof: Merk( + 0: Push(Hash(HASH[fb5eb23b3135d9c226e61f004ffb43abae104238d8a1ea7bc60e8ec6ba271596])) + 1: Push(KVHash(HASH[3ed48a5e35cb7546d329487b0e1ab8a81d7c5bec358c37449e6cbd956e3bb069])) + 2: Parent + 3: Push(Hash(HASH[19ec5730af134e9ac980bbea92c2978212c8efe750a467ab54f073626e0ca2f5])) + 4: Push(KVHash(HASH[87bc6e7e1e465b8dcdaf95db9957a455d6bd7c75976db122f33e592fe75f1e4a])) + 5: Parent + 6: Push(Hash(HASH[a0a354f2bb59b8169253aebabb52afcc3c59c4c60da203c8887abb679d747168])) + 7: Push(KVHash(HASH[fc6b1d0237f8ff89b555e9a14480ae1c5b80d529a0f9fb5e681ea7ecd157d3da])) + 8: Parent + 9: Push(KVValueHash(brand_050, CountTree(636f6c6f72, 1000, flags: [0, 0, 0]), HASH[53dbd6216cccdddf16f3eb0f849aed0c0cea987a718f5b43493abf0a14e83eb9])) + 10: Child + 11: Push(KVHash(HASH[027ac8b1bc9788118b27c13d0b3c3bd3661ef6a89a775a6b6bf78aa7e6f8ed3d])) + 12: Parent + 13: Push(Hash(HASH[7a5dc3002e6cb6c92e54d554e5af85e9c2ba64ee9c5f80e6489075cc5f3f0d55])) + 14: Child + 15: Push(KVHash(HASH[3363630479f1abe6e003b1e1d50b5118e55ad2efb7a3f4b3b6df902bea72ac9a])) + 16: Parent + 17: Push(Hash(HASH[3857faef5ddb06e201f1e65cf42f15d6c9b0dc67e7f73eb182b520854e9bb648])) + 18: Child + 19: Child + 20: Child + 21: Push(KVHash(HASH[f776417ede76e6194706e483ac14ab7b3db6aa0461ec14ed5f8e5d20071363af])) + 22: Parent + 23: Push(Hash(HASH[b3fccba79c14fcc5e97ff6a3cd051228dc755e6de147bef690ba9681264b2b9f])) + 24: Child) + lower_layers: { + brand_050 => { + LayerProof { + proof: Merk( + 0: Push(Hash(HASH[2190c6fcd140792fd12be66cd631f97475b9ab3f19417a26d94798115ee46160])) + 1: Push(KVValueHash(color, NonCounted(ProvableCountTree(636f6c6f725f3030303030353131, 1000, flags: [0, 0, 0])), HASH[b1cedc48940faedea8b64bff8c8113344acdb1fd8eff37c567099b167b3c5861])) + 2: Parent) + lower_layers: { + color => { + LayerProof { + proof: Merk( + 0: Push(HashWithCount(kv_hash=HASH[4f8d29f51f626326fa5a3d4aa210a07eddf53121888aa5788625ae774be9bc37], left=HASH[ec92140543f4bd56112e8eaf4cb9796b1986d56b0bf721d81fc7d6a699d16a50], right=HASH[1eb29f80ffaac4878420ecfc9337e6181c9e6fc30608fc5475cf0b808f51a31d], count=255)) + 1: Push(KVDigestCount(color_00000255, HASH[2ed4d50b30e917eceacb3356eb88057e490f9d98ebf6123d25535ff502d2da2b], 511)) + 2: Parent + 3: Push(HashWithCount(kv_hash=HASH[80de09ce45f1c62d0532139ca67a93d88a293ce8139354e0e4751381346f64e7], left=HASH[32a8b4be78632242774668fd49f8db72d5f261d964f33ed9c0780ca99708ba20], right=HASH[af60a5ba4e39fa6326fd77dff0de304cc4cbac75c0702200a97d099f33617496], count=127)) + 4: Push(KVDigestCount(color_00000383, HASH[fe27bc251ea815fbd838146098daf0662fe214425a5befaec84c960dadbff89b], 255)) + 5: Parent + 6: Push(HashWithCount(kv_hash=HASH[827791c9001bdf85512aed74a917156299ad6b1a50abe27e03939cb745000dfa], left=HASH[4b5363b3bd01883530360ef09c2b645c6f744988e24c17e432bc2c3321d41541], right=HASH[c444ec932284bb1bae3b45f3f54ed9f3922fd85aeecea01dd10341b889c41137], count=63)) + 7: Push(KVDigestCount(color_00000447, HASH[e7d9bb66af76a1b8600a9fb5d904f54825b61fb5e8004cdbfb4f42134455953a], 127)) + 8: Parent + 9: Push(HashWithCount(kv_hash=HASH[11a374adf740d562dde32325c07b28949981033d310beafc1d90a3d44fb0bd6a], left=HASH[826dab51d3fd831414ae5344e837343104f0212e1c5ca57014951beba53f89d0], right=HASH[02ebfd24b8c7fd10b74bda8856344c4fd7287ce31ebdd6e9676c9a1a6e5943cc], count=31)) + 10: Push(KVDigestCount(color_00000479, HASH[6151f4f40176302ed6a27f77fd687bbae015a09ca80ad4af6f80e7c29e8a3595], 63)) + 11: Parent + 12: Push(HashWithCount(kv_hash=HASH[b93259768b6500a9b757c4a90e981f0e3a8a848b275b862f16f5b242310cb65a], left=HASH[b1f724e4b2546d1d92059a72076868112b5b6187b6d227fa834d3ff3579f7b8c], right=HASH[fd1765117ce2a3f6deca713039d81726b05eecab4119e223753dee5fd989d610], count=15)) + 13: Push(KVDigestCount(color_00000495, HASH[034b88a8dfaf46db8b679fd72d342643d64b6937c44b06f983e5dbebd6f3b69b], 31)) + 14: Parent + 15: Push(HashWithCount(kv_hash=HASH[bd58344e0fbbca9dee08997443550d1630adc59696701fb1f99c5a7e1fdb855a], left=HASH[22ef7d33de4e1d93a27009c5a3ae849ac8713c84dbac046dc615170a6b0e89a8], right=HASH[fbc94ef6e1255b8f0fffdb496258eb03a0b54c29d9f074830159d78a86e05621], count=3)) + 16: Push(KVDigestCount(color_00000499, HASH[12672ddf0e18d172679f7ebf0ba5f6976b337066e0373ffdac8c176a6a160dcc], 7)) + 17: Parent + 18: Push(KVDigestCount(color_00000500, HASH[7f1d988845d9c82b9d1146f2188b09bf704d31647ee2a26054e69ed897de3750], 1)) + 19: Push(KVDigestCount(color_00000501, HASH[f0a8f993f517cee96055d69e48dfe51e70fe303424885194d3b7e71924af5df7], 3)) + 20: Parent + 21: Push(HashWithCount(kv_hash=HASH[3b75b6239307e1a00f8596386421e623e365d4adc8451dae07cc3bcf589efc44], left=HASH[0000000000000000000000000000000000000000000000000000000000000000], right=HASH[0000000000000000000000000000000000000000000000000000000000000000], count=1)) + 22: Child + 23: Child + 24: Push(KVDigestCount(color_00000503, HASH[aba3bbc16aa5a2413fd60261c5efe4d42c97f0f4b82fcc8e74af8562cc2fdfed], 15)) + 25: Parent + 26: Push(HashWithCount(kv_hash=HASH[64d94410c9ae982091bff1d2fe0cf3edae7af54b43f24f613ea08f465e9fa29f], left=HASH[8d2afe8b42330b1bdd677daffde7238cf93a52146e60eeec8e08b4ce095a9ad1], right=HASH[663bf105cdfa9ffd5431d8190c55a87891da0c13c74eb6a16437526c74de889c], count=7)) + 27: Child + 28: Child + 29: Child + 30: Child + 31: Child + 32: Child + 33: Push(KVDigestCount(color_00000511, HASH[fb4d7e1e5013a3c804045c72bd920ff81985ee986e87c9373c7041b78953d12e], 1000)) + 34: Parent + 35: Push(HashWithCount(kv_hash=HASH[4ba23a437c91a135eb087602db30021bbbeeba7416d4af9317c2b1a7762ab0a4], left=HASH[cd9697f159ba87524f129190317680dd33f96cf5e8a444c9caaf264fe998746c], right=HASH[f4c9e984a836b6b3739392239b4e35c28c153dd513038a6da5294a4e327c07c0], count=488)) + 36: Child) + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } +} +``` + +The descent is identical to Query 4's first six layers (root → `@` → contract_id → `0x01` → widget → byBrand → `brand_050`'s value tree → `color` continuation), then forks at the deepest layer: where Query 4 read one `KVValueHashFeatureTypeWithChildHash(color_00000500, CountTree count=1)`, Query 8 walks the `ProvableCountTree` boundary using the same `HashWithCount` / `KVDigestCount` ops Query 7 used at the doctype level. The boundary keys (`color_00000255 → 383 → 447 → 479 → 495 → 499 → 500 → 501 → 503 → 511`) name the same binary-merk-tree positions as Query 7's color subtree — predictably, since the bench's deterministic schedule means every brand's color subtree has the same shape. + +The final `count=488` at the bottom-right `HashWithCount` covers the upper portion of the in-range subtree (everything to the right of the visible cut); the in-range `KVDigestCount` ops (`color_00000501 count=3`, `color_00000503 count=15`, `color_00000511 count=1000`) cover named boundary positions inside that subtree. The `count` field on each merk node is the *subtree* count (including descendants), not just the named key's contribution — which is why `color_00000511 count=1000` and not `1`. Summing the boundary contributions yields the final `count: 499`. + +
+ +Query 8 is the "compound `==` then range" shape — and the most expensive query in the chapter. It threads through the same 4 grove layers above the byBrand tree as every other query, descends through byBrand → `brand_050`'s value tree → byBrandColor's `color` continuation (matching Query 4's path), then runs `AggregateCountOnRange` over `brand_050`'s `ProvableCountTree` (matching Query 7's primitive). The result: 8 grove layers of merk-proof bytes — 2 656 B total, ~28 % larger than Query 7's single-leg range and ~39 % larger than Query 4's point-lookup compound. + +The reason this even works is that **byBrandColor's terminator (`brand_X`'s `color` continuation) is itself a `ProvableCountTree`** (see [Document Count Trees](./document-count-trees.md)). The compound index has `rangeCountable: true`, and the `parent_value_tree_is_count_tree` flag propagates through `add_indices_for_index_level_for_contract_operations` so the continuation becomes `NonCounted(ProvableCountTree(...))` rather than `NonCounted(NormalTree(...))`. Without that, the boundary nodes wouldn't carry running counts and the verifier would have to enumerate every `(brand_050, color)` pair. + +```mermaid +flowchart TB + WD["@/contract_id/0x01/widget"]:::tree + WD ==> BR["brand: NormalTree"]:::path + BR ==> B050["brand_050: CountTree count=1000"]:::path + B050 ==> B050_C["color: NonCounted(ProvableCountTree count=1000)
(internal merk nodes carry running counts)"]:::target + B050_C -.-> CGT["color_00000501 ... color_00000999
(in range, summed via merk-node counts)"]:::faded + B050_C -.-> CBelow["color_00000000 ... color_00000500
(below range, skipped)"]:::faded + B050 -.-> B050_0["[0]: 1000 byBrand refs"]:::faded + BR -.-> Brands["other brands"]:::faded + WD -.-> CO["color"]:::faded + WD -.-> PK["[0]"]:::faded + + classDef tree fill:#21262d,color:#c9d1d9,stroke:#1f6feb,stroke-width:2px; + classDef path fill:#6e7681,color:#fff,stroke:#1f6feb,stroke-width:2px; + classDef faded fill:#21262d,color:#6e7681,stroke:#484f58; + classDef target fill:#39c5cf,color:#0d1117,stroke:#39c5cf,stroke-width:3px; + + linkStyle 0 stroke:#1f6feb,stroke-width:3px; + linkStyle 1 stroke:#1f6feb,stroke-width:3px; + linkStyle 2 stroke:#1f6feb,stroke-width:3px; + linkStyle 3 stroke:#1f6feb,stroke-width:3px; +``` + +### Diagram: per-layer merk-tree structure (Layer 5+) + +Layers 5–7 are identical to Query 4 (widget → byBrand → `brand_050`'s value tree → `color` continuation). The difference from Query 4 is entirely at Layer 8: Query 4 resolved a single `color_X` element with a `KVValueHashFeatureTypeWithChildHash` op, whereas Query 8 walks the boundary with `HashWithCount` and `KVDigestCount` ops (the same shape as Query 7's L6, just one grove layer deeper). + +```mermaid +flowchart TB + subgraph L5["Layer 5 — widget doctype merk-tree"] + direction TB + L5_q["brand
kv_hash=HASH[68b6...]
value: Tree (descent into byBrand)"]:::queried + L5_left["HASH[9862...]"]:::sibling + L5_right["HASH[6c36...]"]:::sibling + L5_q --> L5_left + L5_q --> L5_right + end + + subgraph L6["Layer 6 — byBrand merk-tree (intermediate stop)"] + direction TB + L6_q["brand_050
kv_hash=HASH[53db...]
value: CountTree count=1000
(continuation child via lower_layer)"]:::queried + L6_boundary["Boundary commitments (24 merk ops):
6 KVHash sibling brands + 6 Hash subtrees"]:::sibling + L6_q --> L6_boundary + end + + subgraph L7["Layer 7 — brand_050's continuation merk-tree (single key)"] + direction TB + L7_q["color
kv_hash=HASH[b1ce...]
value: NonCounted(ProvableCountTree count=1000)
(descent into byBrandColor terminator)"]:::queried + L7_left["HASH[2190...]"]:::sibling + L7_q --> L7_left + end + + subgraph L8["Layer 8 — byBrandColor color sub-tree (range-aggregate cut)"] + direction TB + L8_result["Aggregate count = 499
(returned by verify_aggregate_count_query)"]:::target + L8_inrange["KVDigestCount ops in the in-range path:
color_00000500 (count=1), color_00000501 (3),
color_00000503 (15), color_00000511 (1000)"]:::sibling + L8_boundary["HashWithCount boundary nodes covering
chunks of the cut (counts):
255, 127, 63, 31, 15, 3, 1, 7, 488
+ KVDigestCount path keys above the cut:
color_00000255, 383, 447, 479, 495, 499"]:::sibling + L8_result --> L8_inrange + L8_result --> L8_boundary + end + + L5_q -. "Tree(merk_root[byBrand])" .-> L6_q + L6_q -. "CountTree continuation (child_hash)" .-> L7_q + L7_q -. "NonCounted(ProvableCountTree(merk_root))" .-> L8_result + + classDef queried fill:#1f6feb,color:#fff,stroke:#1f6feb,stroke-width:2px; + classDef sibling fill:#6e7681,color:#fff,stroke:#6e7681; + classDef target fill:#39c5cf,color:#0d1117,stroke:#39c5cf,stroke-width:3px; +``` + +Query 8 sits at the intersection of Query 4 (compound descent) and Query 7 (range-aggregate primitive). Its proof carries the descent overhead of both — the boundary commitments at L6 to position `brand_050`, plus the boundary commitments at L8 to position the color cut — explaining why it's the heaviest proof in the chapter despite verifying a smaller count (499) than Query 7 (49 900). + +### Diagram: Layer 8 binary merk-tree (the range-aggregate cut) + +The 37 merk ops at Layer 8 reconstruct the entire boundary path through `brand_050`'s color `ProvableCountTree`. Unlike every other query's bottom layer (which abstracts the binary tree into one "target + opaque siblings" box), the AggregateCountOnRange primitive forces the prover to reveal the structural shape of the in-range descent — so we can draw it literally. + +Cyan = in-range contributions the verifier adds to the aggregate. Yellow-dashed = the boundary node `color_00000500`, named so the verifier can position the cut but excluded by the strict `>` operator. Gray = nodes/subtrees outside the range (boundary commitments needed to prove the rest of the tree's structure, but not summed). + +The `count` field on each node is its **subtree count** (the node itself + all descendants in the binary merk tree), not just the named key's contribution. So `color_00000511` (the root) carries `count=1000` because every key in `brand_050`'s color subtree is a descendant — not because there are 1 000 of that one key. + +```mermaid +flowchart TB + R["color_00000511 (merk root)
KVDigestCount, count=1000
contributes 1 (itself, in-range)"]:::inrange + R --> L1L["color_00000255
KVDigestCount, count=511
(out-of-range; descend right)"]:::outrange + R --> L1R["HASH[4ba2...] (opaque subtree)
HashWithCount, count=488
(color_00000512 … color_00000999)
contributes 488 (full subtree in-range)"]:::inrange + + L1L --> L2L["HASH[4f8d...] (opaque subtree)
HashWithCount, count=255
(color_00000000 … color_00000254,
all out-of-range)"]:::outrange + L1L --> L2R["color_00000383
KVDigestCount, count=255
(out-of-range)"]:::outrange + + L2R --> L3L["HASH[80de...]
HashWithCount, count=127"]:::outrange + L2R --> L3R["color_00000447
KVDigestCount, count=127"]:::outrange + + L3R --> L4L["HASH[8277...]
HashWithCount, count=63"]:::outrange + L3R --> L4R["color_00000479
KVDigestCount, count=63"]:::outrange + + L4R --> L5L["HASH[11a3...]
HashWithCount, count=31"]:::outrange + L4R --> L5R["color_00000495
KVDigestCount, count=31"]:::outrange + + L5R --> L6L["HASH[b932...]
HashWithCount, count=15"]:::outrange + L5R --> L6R["color_00000503
KVDigestCount, count=15
contributes 1 (itself, in-range)"]:::inrange + + L6R --> L7L["color_00000499
KVDigestCount, count=7
(out-of-range; descend right)"]:::outrange + L6R --> L7R["HASH[64d9...] (opaque subtree)
HashWithCount, count=7
(color_00000504 … color_00000510)
contributes 7 (full subtree in-range)"]:::inrange + + L7L --> L8L["HASH[bd58...]
HashWithCount, count=3
(color_00000496 … color_00000498,
all out-of-range)"]:::outrange + L7L --> L8R["color_00000501
KVDigestCount, count=3
contributes 1 (itself, in-range)"]:::inrange + + L8R --> L9L["color_00000500
KVDigestCount, count=1
boundary key — strict `>` excludes it
(named so the verifier can place the cut)"]:::boundary + L8R --> L9R["HASH[3b75...] (opaque subtree)
HashWithCount, count=1
(color_00000502)
contributes 1 (full subtree in-range)"]:::inrange + + classDef inrange fill:#39c5cf,color:#0d1117,stroke:#39c5cf,stroke-width:2px; + classDef outrange fill:#6e7681,color:#fff,stroke:#6e7681; + classDef boundary fill:#d29922,color:#0d1117,stroke:#d29922,stroke-width:2px,stroke-dasharray: 6 3; +``` + +The verifier's aggregation walks this tree and sums the cyan nodes' contributions: `1 (color_00000511) + 488 (H_4ba2) + 1 (color_00000503) + 7 (H_64d9) + 1 (color_00000501) + 1 (H_3b75) = 499`. Notice the asymmetry — the proof reveals a long boundary-descent path down the *left* of the tree (through KD_255 → KD_383 → KD_447 → KD_479 → KD_495 → KD_499) just to position the cut, even though none of those nodes contribute to the count. That's the structural floor for AggregateCountOnRange: the prover must commit one merk-binary-tree-depth's worth of boundary nodes per side of the range, regardless of how many keys actually fall inside it. + +For a worst-case range (`color > color_00000000`, i.e. essentially the full tree), the boundary descent collapses to one node and `H_4ba2`-like fully-in-range subtree commitments dominate. For a narrow range like this one (cutting deep into the tree), the descent path costs more than the in-range commitments. Either way the total is `O(log C')` boundary nodes — Query 8 just happens to land at the unfavourable end of the constant factor. + +The same in-order traversal also explains the keys' positions: a balanced merk binary tree over the 1 000 sorted color keys puts `color_00000511` at the root (the ~midpoint by tree-depth, not by sort order — `color_00000511` happens to land here because of grovedb-merk's AVL rotation rules on the insertion order), `color_00000255` and `color_00000383` (along with their descendants `color_00000447 / 479 / 495 / 499`) at progressive left-of-cut descents, and `color_00000503` at the right child of `color_00000495` (which is itself the right child of the descent path). The keys are sorted by in-order traversal, not by tree position, so don't expect them to look orderly in the diagram above. + +## Worked Example: How `node_hash_with_count` Rebuilds the Merk Root + +This section uses Query 8's Layer 8 to make one thing concrete: **what the verifier actually computes when it folds the proof's `Push` / `Parent` / `Child` ops up to the merk root.** It's the same machinery underpinning every other query in the chapter — Q8 just exposes the most interesting node-hash variant (`node_hash_with_count`, used by `ProvableCountTree`). + +All hashes are **Blake3-256**. The hash primitives live at [`merk/src/tree/hash.rs`](https://github.com/dashpay/grovedb/blob/master/merk/src/tree/hash.rs) in grovedb. Six functions compose every node-hash in the chapter: + +```text +value_hash(v) = Blake3( varint_len(v) || v ) +kv_hash(k, v) = Blake3( varint_len(k) || k || value_hash(v) ) +kv_digest_to_kv_hash(k, vh) = Blake3( varint_len(k) || k || vh ) +combine_hash(h1, h2) = Blake3( h1 || h2 ) +node_hash(kv_h, l, r) = Blake3( kv_h || l || r ) +node_hash_with_count(kv_h, l, r, c) + = Blake3( kv_h || l || r || c.to_be_bytes() ) +``` + +(`varint_len` is `integer_encoding::VarInt::encode_var` — the same unsigned-varint encoding used throughout grovedb. `c.to_be_bytes()` is the 8-byte big-endian encoding of the `u64` count.) + +Each proof op carries enough information to compute its subtree's `node_hash`. The reconstruction rule per op variant (from [`merk/src/proofs/tree.rs`'s `compute_hash`](https://github.com/dashpay/grovedb/blob/master/merk/src/proofs/tree.rs)): + +| Proof op | What's revealed | Subtree `node_hash` formula | +|----------|------------------|------------------------------| +| `Hash(h)` | the subtree hash directly | `h` (no recompute) | +| `KVHash(kv_h)` | the node's kv-hash only | `node_hash(kv_h, left_node_hash, right_node_hash)` | +| `KVHashCount(kv_h, c)` | kv-hash + node count | `node_hash_with_count(kv_h, left, right, c)` | +| `HashWithCount(kv_h, left, right, c)` | kv-hash + both children's node-hashes + count | `node_hash_with_count(kv_h, left, right, c)` *(no recursion — children are already pre-hashed)* | +| `KVValueHash(k, v, kv_h)` | full key+value + kv-hash | `node_hash(kv_h, left, right)` | +| `KVDigest(k, vh)` | key + value-hash | `node_hash(kv_digest_to_kv_hash(k, vh), left, right)` | +| `KVDigestCount(k, vh, c)` | key + value-hash + count | `node_hash_with_count(kv_digest_to_kv_hash(k, vh), left, right, c)` | +| `KVValueHashFeatureTypeWithChildHash(k, v, kv_h, feature, child_hash)` | key + value + kv-hash + feature type + opaque child-layer hash | combines `kv_h` with `child_hash` (via `combine_hash`), then `node_hash[_with_count]` depending on feature | + +The `left` / `right` arguments are the children's reconstructed node-hashes (computed recursively from the stack as `Parent` / `Child` ops glue the subtrees together). For nodes at the leaf level of the proof's revealed structure, both children are `NULL_HASH` (32 zero bytes). + +### The example: rebuilding `color_00000511`'s `node_hash` (Q8, Layer 8) + +At the top of Layer 8's binary merk-tree, the proof has three ops that together produce the merk root hash for `brand_050`'s color `ProvableCountTree`: + +```text +op 33: Push(KVDigestCount( + key = "color_00000511", + vh = HASH[fb4d7e1e5013a3c804045c72bd920ff81985ee986e87c9373c7041b78953d12e], + count = 1000)) +op 34: Parent (links the running left-side subtree onto color_00000511 as its left child) +op 35: Push(HashWithCount( + kv_h = HASH[4ba23a437c91a135eb087602db30021bbbeeba7416d4af9317c2b1a7762ab0a4], + left = HASH[cd9697f159ba87524f129190317680dd33f96cf5e8a444c9caaf264fe998746c], + right = HASH[f4c9e984a836b6b3739392239b4e35c28c153dd513038a6da5294a4e327c07c0], + count = 488)) +op 36: Child (links the just-pushed HashWithCount as color_00000511's right child) +``` + +Call them `KD_511`, `HWC_4ba2`. By the time we reach op 33 the left-side stack already holds `node_hash_left` — the recursively-computed node-hash of the whole left subtree rooted at `color_00000255` (255 + 1 + 255 = 511 keys, including the boundary-descent path). We'll trust that value here; it's the output of folding ops 0–32 with the same machinery applied recursively. + +**Step 1: Compute the right child's `node_hash` directly from `HWC_4ba2`.** + +Because `HashWithCount` already carries the children's node-hashes (`cd96...` and `f4c9...`) and the node's own kv-hash (`4ba2...`) and count (`488`), no recursion is needed — the verifier just plugs the four values into `node_hash_with_count`: + +```text +node_hash_right + = node_hash_with_count(kv_h=4ba2..., left=cd96..., right=f4c9..., count=488) + = Blake3( 4ba23a437c91a135eb087602db30021bbbeeba7416d4af9317c2b1a7762ab0a4 + || cd9697f159ba87524f129190317680dd33f96cf5e8a444c9caaf264fe998746c + || f4c9e984a836b6b3739392239b4e35c28c153dd513038a6da5294a4e327c07c0 + || 0x00000000000001E0 ) // 488 as big-endian u64 +``` + +That's a single Blake3 call over `32 + 32 + 32 + 8 = 104 bytes`. + +**Step 2: Compute `color_00000511`'s kv-hash from its `KVDigestCount` op.** + +The proof reveals the key (`"color_00000511"`, 14 bytes ASCII) and the value-hash (`fb4d...`, 32 bytes). `kv_digest_to_kv_hash` folds them into the node's kv-hash: + +```text +kv_h_511 + = kv_digest_to_kv_hash(key="color_00000511", value_hash=fb4d...) + = Blake3( varint_len(14) // = 0x0E (one byte) + || "color_00000511" // 14 ASCII bytes + || fb4d7e1e5013a3c804045c72bd920ff81985ee986e87c9373c7041b78953d12e ) +``` + +That's one Blake3 call over `1 + 14 + 32 = 47 bytes`. + +**Step 3: Compute `color_00000511`'s `node_hash` by folding the kv-hash with both children's node-hashes plus the running count.** + +```text +node_hash_511 + = node_hash_with_count( + kv_h = kv_h_511, // from Step 2 + left = node_hash_left, // from ops 0..32 (the descent path) + right = node_hash_right, // from Step 1 + count = 1000) + = Blake3( kv_h_511 || node_hash_left || node_hash_right || 0x00000000000003E8 ) + // 1000 as big-endian u64 +``` + +Another single Blake3 call over `32 + 32 + 32 + 8 = 104 bytes`. + +**Step 4: That's it.** `node_hash_511` is the merk root of Layer 8 — the byBrandColor `color` subtree for `brand_050`. The verifier then checks this against what Layer 7 claimed Layer 8's merk root would be (the `NonCounted(ProvableCountTree(...))` value stored against the key `"color"` inside `brand_050`'s value tree), and so on up the GroveDB layer stack until Layer 1 lands the entire chapter's `root_hash = 0x62ee7348f4d28dd9d7cf86a6c725fa8276cfd446f6007a6000fb0e1dfefa6468`. + +### Why the count is part of the hash + +The crucial structural feature is the `|| count.to_be_bytes()` tail in `node_hash_with_count`. **Without it, the proof's running counts would be unsigned hints the verifier couldn't trust** — a malicious prover could ship a `KVDigestCount(color_00000511, fb4d..., 9_999_999_999)` and there'd be no way to detect the lie without re-counting the documents (which is exactly what count proofs are supposed to avoid). + +Binding the count into the merk root via `node_hash_with_count` is what lets `AggregateCountOnRange` skip enumeration: the verifier reads the count off the boundary commitments and trusts it because changing the count would change the merk root, which is consensus-committed. + +Concretely, that's why every `ProvableCountTree`-derived op (`KVHashCount`, `KVDigestCount`, `HashWithCount`, `KVValueHashFeatureTypeWithChildHash` with feature `ProvableCountedMerkNode(_)`) routes through `node_hash_with_count` rather than the cheaper `node_hash` — see [`merk/src/proofs/tree.rs`'s `compute_hash`](https://github.com/dashpay/grovedb/blob/master/merk/src/proofs/tree.rs) and the `TreeFeatureType::ProvableCountedMerkNode` branch in particular. `NormalTree` nodes (e.g. byBrand) use plain `node_hash` — their kv-hash + child hashes don't commit a count, which is why `byBrand` can't answer `AggregateCountOnRange` queries even though it's `countable: "countable"`. + +### One last simplification + +For nodes whose proof op already carries the kv-hash (the kvh-prefixed ops — `KVHashCount`, `HashWithCount`, `KVHash`), the verifier skips Step 2 entirely. For nodes whose proof op carries only the key and value-hash (`KVDigest`, `KVDigestCount`), the verifier folds them via `kv_digest_to_kv_hash` first (one extra Blake3 call). For nodes with `KVValueHash` (full key+value), the verifier recomputes the kv-hash all the way from scratch via `kv_hash`, which means it also re-hashes the value through `value_hash`. The choice is driven by **how much of the node the proof needs to reveal**: + +- A node on the descent path that the verifier doesn't need to materialize → emit `Hash(node_hash)` (1 hash, opaque). +- A node whose existence the verifier must prove but whose value can stay opaque → emit `KVHash(kv_h)` or `KVHashCount(kv_h, c)` (kv-hash committed, value hidden). +- A boundary node whose key the verifier needs to compare against the range → emit `KVDigest(k, vh)` or `KVDigestCount(k, vh, c)` (key revealed, value still digested). +- A target whose full value the verifier must read → emit `KVValueHash(k, v, kv_h)` or the feature-typed variant. + +The user-facing trade-off is proof bytes vs information revealed. The verifier's reconstruction logic is uniform: every op feeds the same node-hash formula one variant or another. + +## At-a-Glance Comparison + +| # | Query | Primitive | Verified shape | Proof size | +|---|--------------------------------------|---------------------------|--------------------------|------------| +| 1 | `(empty)` | primary-key CountTree | 1 CountTree, count=100000| 585 B | +| 2 | `brand == X` | PointLookupProof / byBrand| 1 CountTree, count=1000 | 1 041 B | +| 3 | `color == X` | PointLookupProof / byColor| 1 CountTree, count=100 | 1 327 B | +| 4 | `brand == X AND color == Y` | PointLookupProof / byBrandColor | 1 CountTree, count=1 | 1 911 B | +| 5 | `brand IN [b0, b1]` | PointLookupProof / byBrand| 2 CountTrees, sum=2000 | 1 102 B | +| 6 | `color IN [c0, c1]` | PointLookupProof / byColor| 2 CountTrees, sum=200 | 1 381 B | +| 7 | `color > floor` | AggregateCountOnRange / byColor | u64=49900 | 2 072 B | +| 8 | `brand == X AND color > floor` | AggregateCountOnRange / byBrandColor | u64=499 | 2 656 B | + +Four takeaways: + +- **Query 1 is the cheapest.** A doctype-level total count is one merk read; everything else descends through an index tree. +- **Query 2 and Query 6 are structurally identical** despite covering different indexes (`byBrand` countable-only, `byColor` rangeCountable). The value-tree-direct shape is uniform across countability tiers — `rangeCountable: true` only matters for Queries 7 and 8. +- **Queries 7 and 8 use a fundamentally different verifier** (`verify_aggregate_count_query` vs `verify_query`). Queries 1–6 return an element list and read `count_value_or_default` per branch; Queries 7 and 8 return a pre-summed `u64`. Query 8 is just Query 7 one grove layer deeper — same primitive, applied to byBrandColor's terminator rather than byColor's. +- **Query 8 is the most expensive.** It pays for both the compound descent (Query 4's 4-extra-layer cost) *and* the range-aggregate boundary (Query 7's primitive). The verified count is far smaller than Query 7 (499 vs 49 900), but the proof bytes are 28 % larger because the merk-tree boundary at L8 has roughly the same shape regardless of how many keys the cut spans. + +The path-query builder these examples decode lives at [`packages/rs-drive/src/query/drive_document_count_query/path_query.rs`](https://github.com/dashpay/platform/blob/v3.1-dev/packages/rs-drive/src/query/drive_document_count_query/path_query.rs); the verifier mirror sits in [`packages/rs-drive/src/verify/document_count/`](https://github.com/dashpay/platform/blob/v3.1-dev/packages/rs-drive/src/verify/document_count/). Both the prover and the verifier reconstruct the exact same `PathQuery` via the shared builder — touching one without the other is a Merkle-root mismatch waiting to happen, and the byte-identical contract is what makes the proof bytes here reproducible against the bench fixture. diff --git a/book/src/drive/count-index-group-by-examples.md b/book/src/drive/count-index-group-by-examples.md new file mode 100644 index 00000000000..1f97da60385 --- /dev/null +++ b/book/src/drive/count-index-group-by-examples.md @@ -0,0 +1,1383 @@ +# Count Index Group By Examples + +This chapter is the `GROUP BY` companion to [Count Index Examples](./count-index-examples.md). It uses the same `widget` contract, the same 100 000-row fixture, and the same bench at [`packages/rs-drive/benches/document_count_worst_case.rs`](https://github.com/dashpay/platform/blob/v3.1-dev/packages/rs-drive/benches/document_count_worst_case.rs). Read chapter 29 first — most of the mechanics (CountTree variants, the merk-proof reconstruction algorithm, `node_hash_with_count` and friends) carry over unchanged. + +What's different here: + +- Every query in chapter 29 returns either a single `u64` aggregate or a small list of `CountTree`s the caller sums. The verifier-side payload shape is **one count, total**. +- Every query in this chapter returns **one count per group**. The caller gets back a `Vec<(group_key, count)>` and can index it directly — no summation. + +The most important thing to understand up front: **`group_by` is two things at once — a *result-shaping directive for the SDK* and (for some queries) a *proof-shaping directive for the prover*.** When you pass `group_by = [...]` in a count request, you're always telling the SDK "don't collapse the result into a single number — give me one count per group key." That result-shaping role is universal: it's what turns `Aggregate(sum)` into `Entries([(key, count), …])`. + +Whether `group_by` *also* changes the proof bytes depends on the query shape. For queries where the underlying proof already commits one `CountTree` per matched key (single-property `IN`s, for instance), the per-group breakdown is reconstructible from the existing bytes — the prover ships the same proof, the SDK just zips it with the group keys instead of summing. For range queries and certain compound shapes, the per-group breakdown *can't* be reconstructed from the aggregate-style proof (which commits opaque subtree counts rather than per-key counts), so passing `group_by` forces the prover to emit a structurally different, larger proof. + +The interesting question this chapter answers is: **which queries fall into which bucket, and why?** + +## When `group_by` Changes the Proof (and When It Doesn't) + +| Filter | `group_by` | Aggregate proof (no `group_by`) | Group-By proof | Proof bytes change? | +|---|---|---|---|---| +| `brand IN [b0, b1]` | `[brand]` | [Q5](./count-index-examples.md#query-5--in-on-bybrand) — 1 102 B | 1 102 B (2 entries) | **No** — byte-identical | +| `color IN [c0, c1]` | `[color]` | [Q6](./count-index-examples.md#query-6--in-on-bycolor-rangecountable) — 1 381 B | 1 381 B (2 entries) | **No** — byte-identical | +| `color > floor` | `[color]` | [Q7](./count-index-examples.md#query-7--range-query-aggregatecountonrange) — 2 072 B (1 `u64`) | 10 992 B (100 entries) | **Yes** — different primitive | +| `brand == X AND color > floor` | `[brand, color]` | [Q8](./count-index-examples.md#query-8--compound-equal-plus-range-bybrandcolor) — 2 656 B (1 `u64`) | *not allowed in this form* | — | + +The key observation: `IN` clauses produce proofs that already commit one `CountTree` per resolved key, so adding `group_by` on the same property is purely a verifier-side relabel — the prover ships the same bytes, the verifier just returns them as `Entries(...)` instead of `Aggregate(sum)`. This is why **G1 and G2 below are not new proofs** — they're [Q5](./count-index-examples.md#query-5--in-on-bybrand) and [Q6](./count-index-examples.md#query-6--in-on-bycolor-rangecountable) reinterpreted. + +So **why pass `group_by` at all if the proof bytes don't change?** Because without it, the SDK has no way to know you want the per-key breakdown. The same `brand IN ["brand_000", "brand_001"]` proof can answer two different questions: + +- *"How many widgets total are made by brand_000 or brand_001?"* → caller passes no `group_by`, SDK returns `Aggregate(2 000)`. +- *"How many widgets per brand?"* → caller passes `group_by = [brand]`, SDK returns `Entries([("brand_000", 1 000), ("brand_001", 1 000)])`. + +The bytes on the wire and the cryptographic guarantees are identical; the only thing that changes is which result shape the SDK delivers. Think of `group_by` as the count-query equivalent of `SELECT brand, COUNT(*) ... GROUP BY brand` versus `SELECT COUNT(*) ...` in SQL — same scan plan, different projection. + +Range queries are different. `AggregateCountOnRange` (chapter 29's Q7) walks the boundary of the range over a `ProvableCountTree` and sums per-subtree counts directly — it never resolves individual keys. `GroupByRange` (this chapter) has to *enumerate* the distinct in-range keys to label each group, so it produces a different proof shape with one `CountTree` (or `CountTree`-feature-typed element) per distinct key in the range. That's where `group_by` genuinely earns its bytes — the prover has to do additional work because the per-group breakdown can't be reconstructed from `AggregateCountOnRange`'s opaque-subtree-count commitments. + +## Queries in this Chapter + +All proof-size and behaviour numbers below come from the same bench helper (`report_group_by_matrix`) as chapter 29's. The dispatcher's group_by surface validation lives in [`validate_count_query_groupby_against_index`](https://github.com/dashpay/platform/blob/v3.1-dev/packages/rs-drive/src/query/drive_document_count_query/validate.rs); the per-mode path-query builders sit in [`packages/rs-drive/src/query/drive_document_count_query/path_query.rs`](https://github.com/dashpay/platform/blob/v3.1-dev/packages/rs-drive/src/query/drive_document_count_query/path_query.rs)'s `group_by_*` family. + +| # | Query | Filter + group_by | Complexity | Avg time | Proof size | Verified shape | Notes | +|---|-------|-------------------|------------|----------|------------|----------------|-------| +| G1 | [`In` on `byBrand`](#g1--in-on-bybrand-grouped-by-brand) | `brand IN ["brand_000", "brand_001"]`
`group_by = [brand]` | O(k · log B) | 38.6 µs | 1 102 B | `Entries(2 groups, sum = 2 000)` | Byte-identical to [Q5](./count-index-examples.md#query-5--in-on-bybrand) | +| G2 | [`In` on `byColor`](#g2--in-on-bycolor-grouped-by-color) | `color IN ["color_00000000", "color_00000001"]`
`group_by = [color]` | O(k · log C) | 62.1 µs | 1 381 B | `Entries(2 groups, sum = 200)` | Byte-identical to [Q6](./count-index-examples.md#query-6--in-on-bycolor-rangecountable) | +| G3 | [Compound `In` + Equal](#g3--compound-in--equal-grouped-by-brand) | `brand IN [...] AND color == Y`
`group_by = [brand]` | O(k · (log B + log C')) | 106.2 µs | 2 842 B | `Entries(2 groups, sum = 2)` | Per-In compound resolution; two parallel Q4 descents sharing L1–L6 | +| G4 | [Range on `byColor`](#g4--range-on-bycolor-grouped-by-color) | `color > "color_00000500"`
`group_by = [color]` | O(R · log C) | 762.9 µs | 10 992 B | `Entries(100 groups, sum = 10 000)` | `GroupByRange`: enumerates distinct in-range keys instead of Q7's boundary aggregate | +| G5 | [Compound `In` + Range](#g5--compound-in--range-grouped-by-brand-color) | `brand IN [...] AND color > floor`
`group_by = [brand, color]` | O(k · R' · log C') | 737.5 µs | 11 554 B | `Entries(100 groups, sum = 100)` | Compound In-fan-out × in-range distinct keys (G3 outer × G4 inner) | +| G6 | [High-fanout `In` on `byBrand`](#g6--high-fanout-in-on-bybrand) | `brand IN [100 values]`
`group_by = [brand]` | O(k · log B) | 1 532 µs | 10 038 B | `Entries(100 groups, sum = 100 000)` | Scales linearly with `\|IN\|`; reveals every byBrand entry when `\|IN\| = B` | +| G7 | [Carrier `In` + Range (`byBrandColor`)](#g7--carrier-in--range-grouped-by-brand) | `brand IN [...] AND color > "color_00000500"`
`group_by = [brand]` | O(k · (log B + log C')) | 255.9 µs | 4 332 B | `Entries(2 groups, sum = 998)` | Per-In aggregate via `AggregateCountOnRange` as a carrier subquery; one `u64` per branch | +| G8 | [Carrier outer Range + Range (`byBrandColor`)](#g8--carrier-outer-range--range-grouped-by-brand) | `brand > "brand_050" AND color > "color_00000500"`
`group_by = [brand]` | O(L · (log B + log C')) | 523 µs | 18 022 B | `Entries(10 groups, sum = 4 990)` | Outer-Range carrier with a platform-max `SizedQuery::limit` of 10; caller may pass smaller, can't pass larger | + +**Complexity variables.** `B` = distinct brands in the byBrand merk-tree (≈ 100); `C` = distinct colors in byColor (≈ 1 000); `C'` = distinct colors per brand in byBrandColor (≈ 1 000); `R` = distinct in-range values returned by `GroupByRange` (capped at 100 in this fixture by an implicit response-size limit); `R'` = distinct in-range values per fan-out branch (similarly capped); `k` = `|IN|` for the In-outer carrier shapes; `L` = the effective outer-walk limit for the Range-outer carrier shape (G8). The platform's `MAX_CARRIER_AGGREGATE_OUTER_RANGE_LIMIT = 10` is both the default (when the caller passes no `limit`) and a hard ceiling; callers may pass a smaller `limit` to truncate further. See [G8](#g8--carrier-outer-range--range-grouped-by-brand) for the rationale. As in [chapter 29](./count-index-examples.md#queries-in-this-chapter), the total document count `N` doesn't appear — count proofs read pre-committed `count_value`s rather than enumerating docs. + +**Avg time** is the criterion-reported median of `cargo bench --bench document_count_worst_case -- 'document_count_worst_case/query_g'` on the same 100 000-row warmed fixture used by chapter 29's `query_N_*` cases. Each row reflects **10 samples × ~3 k–130 k iterations per sample** with 2 s warm-up and 5 s measurement; the median sits within ±2 % of the mean across reruns. G1 and G2 match their [Q5](./count-index-examples.md#query-5--in-on-bybrand) / [Q6](./count-index-examples.md#query-6--in-on-bycolor-rangecountable) counterparts to within ~3 µs — the residual is the SDK-side zip-vs-sum cost. G4 is ~11 × Q7 because `GroupByRange` enumerates 100 distinct in-range CountTrees rather than walking `O(log C)` boundary nodes; the time difference is exactly the complexity difference predicted (`O(R · log C)` vs `O(log C)`). + +## Group-By Shapes That Are *Not* Allowed + +Several plausible-looking `(where, group_by)` combinations are rejected by the dispatcher before any proof generation. The rejections fall into four buckets — operator/group_by mismatch, missing range window, no covering index, and one currently-deferred aggregate variant. All are surfaced as typed `QuerySyntaxError`s; the precise error strings appear in the bench's `[matrix]` output. + +### 1. `group_by` field constrained by `==` instead of `In` or range + +```text +where = brand == "brand_050" +group_by = [brand] +``` + +> `count query supports only ...` (rejected because `==` produces exactly one entry whose key equals the where-clause's value — grouping by a field that already has a single value contributes no extra information). + +**Why.** `GROUP BY [field]` is meaningful only when `field` can take multiple values in the result set. An `==` clause pins the field to exactly one value, so the group_by is structurally redundant — the dispatcher rejects it rather than silently returning a single-entry response that would look like a bug. Use [Q2](./count-index-examples.md#query-2--equal-on-a-single-property-bybrand) / [Q3](./count-index-examples.md#query-3--equal-on-a-rangecountable-property-bycolor) (no `group_by`) for single-value `==` queries. + +Applies symmetrically: `where = color == X, group_by = [color]` is rejected for the same reason. + +### 2. `group_by` contains a range field but the `where` clause doesn't range over it + +```text +where = brand IN[...] AND color == "color_00000500" +group_by = [brand, color] +``` + +> `GROUP BY on a range field requires a range where-clause; the range field must appear in `where` for the distinct walk to have a window to iterate over` + +**Why.** `group_by = [in_field, range_field]` (`GroupByCompound`) routes through `distinct_count_path_query`, which needs a range window on the second field to know what values to enumerate. With `color == Y` the second dimension collapses to a single value, so the compound walk degenerates to a point lookup — and that's what [Q4](./count-index-examples.md#query-4--compound-equal-only-bybrandcolor) / [G3](#g3--compound-in--equal-grouped-by-brand) are for. For compound *plus* range, the `where` must carry a range on the second field (which is what [G5](#g5--compound-in--range-grouped-by-brand-color) does). + +### 3. `group_by` orders fields in a way no covering index can serve + +```text +where = color IN[...] AND brand > "brand_050" +group_by = [color, brand] +``` + +> `where clause on non indexed property error: range count requires a `range_countable: true` index whose last property matches the range field` + +**Why.** The covering index for `(group_by[0] = color, group_by[1] = brand)` would need to be `byColorBrand` with `rangeCountable: true` on the `brand` terminator. The widget contract doesn't have that index — only `byBrand`, `byColor`, and `byBrandColor`. The dispatcher's index picker walks every declared index, finds none whose `(properties, last_property_is_range_countable)` shape matches the request, and rejects with the "non-indexed property" error. + +The fix is contract-level: declare a `byColorBrand` index with `rangeCountable: true` if the application needs this group_by order. The dispatcher itself can't infer alternate index orders from the request alone — `rangeCountable: true` is an explicit opt-in on each index because it changes the on-disk tree shape (NormalTree → ProvableCountTree on the property-name subtree). + +--- + +To put these three buckets in one place: every rejected `(where, group_by)` shape on this contract reduces to one of: + +- the `group_by` field's `where` operator doesn't admit multiple values (bucket 1), +- the `group_by` has a range slot that the `where` doesn't fill with a range (bucket 2), +- there's no covering `rangeCountable` index in property order (bucket 3). + +All three checks happen at request validation, before any GroveDB work. The bench's `report_group_by_matrix` exercises one example of each and prints the exact error string, so adding a new contract or index shape is a quick way to see which checks each new query shape hits. + +> **Historical note.** A fourth bucket — `group_by = [in_field]` with `where = in_field IN[...] AND range_field > floor` — was rejected before [grovedb PR #663](https://github.com/dashpay/grovedb/pull/663). That PR added support for `AggregateCountOnRange` as a *carrier* subquery under outer `Keys`, which unblocked the natural single-field-group_by shape (one aggregate count per In branch) at the merk layer. The dispatcher now routes that shape to [`DocumentCountMode::RangeAggregateCarrierProof`]; the worked-out example is [G7](#g7--carrier-in--range-grouped-by-brand) below. + +## G1 — `In` on `byBrand`, Grouped By `brand` + +```text +select = COUNT +where = brand IN ["brand_000", "brand_001"] +group_by = [brand] +prove = true +``` + +**Path query** (identical to [Q5](./count-index-examples.md#query-5--in-on-bybrand)): + +```text +path: ["@", contract_id, 0x01, "widget", "brand"] +query items: [Key("brand_000"), Key("brand_001")] +``` + +**Verified payload** (the only thing that differs from Q5): + +```text +Entries([ + ("brand_000", CountTree { count_value_or_default: 1000 }), + ("brand_001", CountTree { count_value_or_default: 1000 }), +]) +``` + +The SDK zips the In values with the two resolved `CountTree` elements (in lex-asc order) rather than summing them as Q5's `CountMode::Aggregate` does. + +**Proof size:** 1 102 B. **Proof bytes are byte-identical to [Q5](./count-index-examples.md#query-5--in-on-bybrand)** — same path query, same merk ops, same hash composition. The dispatcher recognises that `CountMode::GroupByIn` on a single-property `In` clause resolves through the same `point_lookup_count_path_query` as `CountMode::Aggregate` does; only the response-shaping at the very end differs. + +For the **verbatim proof display**, see [Q5 in chapter 29](./count-index-examples.md#query-5--in-on-bybrand) — every byte of the 1 102-byte proof is the same. Or [▶ open the proof interactively in the visualizer ↗](https://dashpay.github.io/grovedb-proof-visualizer-widget/#f=text&d=H4sIAAdCBmoC_6VXXW9ctxF996_YRxvQA2f4MRwDLfJRtAGSFgEauA-BEHDIYWxUsIK1nA8U_u89d7WSLe-udTcmpNW95NXd4Zkzcw7_sb3-1f_21ffb6-v5gjb_e7LZfNf-8O1uYne72fyyXD_f_NO3_326m9hswvPN92_fvHz6TVs-vvz3Nz_aYKXJWjVOK7OMwoFCFUmlNyzERlLHCNUpYspKJxZXah4LR4uXz57t3037d3_74kW7euu7r_jiYvPD1v1p8sFcOElmFW5TZZpQs5lCEePoBWGUVqgFnjEbB62VdA6POrjqs4vNLtrUcuPajSwFvLC15dkZRg4sRcakyKXamKlILSzD8AY8lrO0PqZ8EC0j2rb11zf7-3iADGlXTgDGk8SmARikyiIjGGG6916HxdGrhG6dYnCROOMQ9Zaxu_fflZ5vvn756mrc3l9d_-bbn66WbL15vk_VZvPF5i9_vb85kszbcSSlDxP7Ifjh98-FfZ-9QHf4Z9Pg5JrZxH1qiL3rMB6K__QYU4syxUPtbXjmXoy9RXyf5WIlZWDy7IO4j0Ox39FnR_8Q0U_i-gi6p4onqQspBUQoHDX7EO4zRFeJWsWHF0-aMgDJkiYIggfyTN3Fwcd6-QCNu0FHcxlonw2RogUEL3jlfV6GtjDbqA0M5FzCrF41h05eU5PpzVozJhO1Ljy9J3A5Ja4pOfs8Hsh9jRwufipzd_kLdCwDK_KwKhunef_bq_Gz3-zRQhfgQsXLPVal55BnjpPdUK4eYuidW2-pxJEssTa3yKEpALXaHB0FuIXYmM1K_YjD56FyO24jPI3OaozOQOoUhxWNsmoyKi2Ion3WOfosKL5u3H2p415RbakktdlLx2_CY0UtuA69PInGp_hs2_Z6HKQozxhiifE-VdWKymiqo3iT0Gp0SySaRm9iLWqsaMdN67S5ZK0PUF4tWh5hTn48to9l4NQ4lIfSYxFW12jUIkEaJ8rOuYJWBZQKjphTHhYqOmPJRCAaQz-1oxhreTy2h7Jxaqzl3O3Y4f4Y8c6k39kkPFm6f_d283brP_zxi__n1c3L3e7f0-WnEMLF5uvrt69vbnkT4Vd6mcIXG9qtzav2M0D4EZfLz-UdjxRkWLyNtgilItKslYkrRLuIcIJCDRaTLDA1oczYawpBS3F4iyh2ebH5qr151ZfN_et6-P61YFqutcaelB2GqRYaRl7aWBRB4VWU4BJiDG1mSBk6bi3DFLU0SpX8OAVOFtCjSNGfQyrVBNtH05L3OhPkwmlKbTup9wCxh4yB3pkAlk4LBMXjLNiQacl8AqlgkzhwhCwBcVjIYRDBTrlGOAfod40VNrMsPqJLIS1LJlQlB0AsuhapteV8qqjhW4KOBlMXuIlPiEOOiDS1oUqwmlD7GdEjBelbzI5ltMcAVsERjmZr47wr7VUP5_v0vw_UF09k6IZeCf045s46BRhLGi1P6Rq4ZCf2AVGbuU1a-B-CwxTopLWBlrMAlQNAc5gRrngEGt4qHLXCQauUNOas3OFFQjCUD_Yxc8ezTItvzxFnC3TUuTbOeg6gegTQDpYvwKCZA8VkMK4pSkUzgI1lgrelqAxrmSBQFXaObdBsybpTH11W13I4C1GiQ9PZ6uhUS1MIc08IN_O0jNbTU0A3k4mm5JYNLEbQXbEFsKPiILNsoayOlM_BlOIRUAf45jCqEbDhFDVSCQHJViP4rhEjSBCK-lB0yRoT7AZccYGlz3OgA69mKaXzQM0HoMqkQYIWFnGctJFSGK3PDPdMgTO8Mk54oxL0HOWfoeQE-FvG7qh77XV1pOUsUOUIqNFHqvhq1DwUC1ISWVMVuDGcjWqrNKRn8x5z7VESzijwJkNz8WgGuFeHWs8DVQ9A9YYj4uw5hhTQ6FHRkSkFTZQApTE0Bc0fqgmhSU0ZesnMQJelTdjM1V0_nAMq0xFQJ05VMJY4sQmMKGmSAPdWY-uUmqHTDiuthVQIqgVvnKFkeaB5CaEftNV9is9TKD6UKIuzd2uiiANXGWdNmJu2WN9MzOgNkjOOxk5JzGfRxR-XSlyAuOn6SNfZz2W8e_I5659aPb12auX4_LHZw7mPZx7ef3j3_vru6vbv8vnuybsn_wczPWgtnxMAAA) (same encoded payload). The diagrams below show the result-shaping difference. + +```mermaid +flowchart TB + WD["@/contract_id/0x01/widget"]:::tree + WD ==> BR["brand: NormalTree"]:::path + BR ==> B000["brand_000: CountTree count=1000"]:::target + BR ==> B001["brand_001: CountTree count=1000"]:::target + BR -.-> BMore["brand_002 ... brand_099"]:::faded + + SDK["Verifier returns Entries([
("brand_000", 1000),
("brand_001", 1000)
])"]:::sdk + + B000 -.-> SDK + B001 -.-> SDK + + classDef tree fill:#21262d,color:#c9d1d9,stroke:#1f6feb,stroke-width:2px; + classDef path fill:#6e7681,color:#fff,stroke:#1f6feb,stroke-width:2px; + classDef faded fill:#21262d,color:#6e7681,stroke:#484f58; + classDef target fill:#39c5cf,color:#0d1117,stroke:#39c5cf,stroke-width:3px; + classDef sdk fill:#21262d,color:#39c5cf,stroke:#39c5cf,stroke-width:2px,stroke-dasharray: 4 2; + + linkStyle 0 stroke:#1f6feb,stroke-width:3px; + linkStyle 1 stroke:#1f6feb,stroke-width:3px; + linkStyle 2 stroke:#1f6feb,stroke-width:3px; +``` + +### Diagram: per-layer merk-tree structure (Layer 5+) + +Identical to [Q5's Layer-5+ diagram](./count-index-examples.md#query-5--in-on-bybrand) — same merk ops, same byBrand binary tree, same two `KVValueHashFeatureTypeWithChildHash` targets. The only difference is what the verifier returns at the end (`Entries(...)` instead of `Aggregate(2000)`); the per-layer structure is unchanged. See chapter 29 for the diagram. + +## G2 — `In` on `byColor`, Grouped By `color` + +```text +select = COUNT +where = color IN ["color_00000000", "color_00000001"] +group_by = [color] +prove = true +``` + +**Path query** (identical to [Q6](./count-index-examples.md#query-6--in-on-bycolor-rangecountable)): + +```text +path: ["@", contract_id, 0x01, "widget", "color"] +query items: [Key("color_00000000"), Key("color_00000001")] +``` + +**Verified payload:** + +```text +Entries([ + ("color_00000000", CountTree { count_value_or_default: 100 }), + ("color_00000001", CountTree { count_value_or_default: 100 }), +]) +``` + +**Proof size:** 1 381 B. **Byte-identical to [Q6](./count-index-examples.md#query-6--in-on-bycolor-rangecountable)** — same path query, same `ProvableCountTree`-style boundary commitments (`KVHashCount` ops carry running counts even though the SDK doesn't read them for this point lookup). The single difference from G1 is the underlying property-name tree type (`ProvableCountTree` for byColor vs `NormalTree` for byBrand); that affects the merk-boundary commitments but not the dispatcher's GroupByIn-vs-Aggregate routing. + +For the **verbatim proof display**, see [Q6 in chapter 29](./count-index-examples.md#query-6--in-on-bycolor-rangecountable) — or [▶ open it interactively in the visualizer ↗](https://dashpay.github.io/grovedb-proof-visualizer-widget/#f=text&d=H4sIAAdCBmoC_6VY244dxw1811ecRwnQQ5PsGwUkcOIgMZALDNhQHoyF0d0kLSELr7GW7BiB_z01e5W0e6Q50Eh7dOaimZ5isaq4f7u8-MX_8uevLy8u4iUd_vfkcPjH-M0vrw5c7R4OP23fXxz-6Zf_eXp14HBILw5fv_351dOvxvbxp2---m4aKwVrV4lZo1rlRKm3lusaOCGDWjdL3UlwaNZF3FxpuFSWKWfPnt3cm27u_feXL8f5W796xBfPD99euj_NbsyVcyusjUdoi9lozMiptsniFcuoo9JIHFImJ-2dNMxFjbs-e364Wm0eZXBfk2ZOuOEY27WRrCRutVmQcO3TItfWKzebuAMuK6WNZdHeWS1jtePSf3xzsy8PkCFdyhnAeG4yNAGD3Lk1S5NweK3VbYqt3tKaiyR5axJiTX0UvN39s_KLw5evXp_b9f75xa9--f35Vq2fX9yU6nD44vCHP97tPFLM6-2Rkr5f2HfBT__9XNhvqpfoFv8yNTm5Fp7NPTTJWmqTTfE_XSQPadE89TXMC6862YfgebPUWXMBJs_eWffjUNy80Wev_n1EP4rrJ9A91jxZvZFSwgobixa3xiuSuDbR3ty8etZcAEhpOUAQXFAiL28OPvaz99C43ejRWia6qUZrVSsIXnHLu7qYjhTD-gADudQU3buWtMh7Hi18zDEm02w6V-PwlcHlnLnn7Ozx-ELueuThyY9V7rZ-iR6rwI467KrGcd7_-tp-8Dc3aEEFuFL1eodVXSWVKBLsE-3qSdJaPNbIVSzPzDp8CqehAHT24VAU4JZkMM9Z-wccPg2V6-16hcfR2Y3RCUgd47BCKLvmSXWkppDPHraiovnW5OVbH6-Obss164xVF34yLqs6k6vp2VE0HvL5_qmD1b0Hpzq4CKxkVhs51ljRaxac86JclmnTWJbRaUVTjRQafbp8-qkfCvyxTR5h0Lo4v7h8fgD2v4x57l9evP3xzTWbBBa5amxdLOnuTxEStCelbbvlWdNS1YoWm63MCbqpraEw1LI0bfq5AjKmWmFataMlKTmnBlWDhtL69Cu-7yvHtr2kvN6uXv1TzDyRnyez9Ghv_9XHm7eX_u1vP_m_X795dfX29xX7Pt1szw_3Jdv2aPuI8_EDAPgOX7e_Z7d1Wl46QzqTjdmiMzeY-zSQbjRnyyWLqEexUdII9IcLjTWhFogbc9WzD4jitr3ivy7Mn9I9G8bmSIT4IjABLg76pJJrjDGgPR6U15QsSBZp9OpGRtVKWFVf6hKfZsNR89gHGp0GGvJXBlRRSQoiAXfqCpLbVLyHwXxkeCStG7XTEGM0eajSIpvITx8BTe5Bg3NyLrh3NbQQN5iYGkGTUTAutJypm2a1lFAJR9hgSBYhBgjxyrYXtL1acSwqbqVDeB5pmtQZtS2VVnvItDlstQXPR4WFqTBzQMEgqTPAKWRXXLt3nbcNv-vi8p7sXqF8vVr2BGAhqcMqQgkj6hN1BslEyqbKsxbqsmhLEyaeI6hBsxwRe6Y8UbuGGu1bcj0J2vYA2m4NKxGMHQgrXtcaZSH5wJt9EoNtK3tL8C_bsJYuSdFflkoSHhlE27nOfgq0egxaZIZm1TEO6JKcyoDqI5CtbSSJ7CtBVLTC2eYsJl1DBxDFINUVrjILoKWyG1tKJ4FL9ABdDHWEfAQFhDMRkpHxQs0jUp2OmWq2CcBR9lwG9ZKnbJMhvGuLSTO33arEp8BLcgzfpR01Z7gkRLg1HRFzCcIsXBYc1Yz3qLmBFoR0nBYmsxQVsr5FcUsGfIX245tPw7c8FIYehMeW3jGubI2VQNMuiFiGUarnVTVDPS1b1oaF46KGtqvS4T81r9341pPwbcfwxUQ7McCYTKhroP07hH51KrMrOr-WFFbIBfQtw3OKlgljdSbOfSzpwLfKfnz7afjqA3wZ-MI_Z0IYVU5eoMABNBPGRqjDAA8MwyB0ranlXqRiSh-QC6qtjLxbeDmdgi_TMXxhDi0VKANoGeglSFRU5ViU5vBkpo5YMbaZZU40IuazQOhmECM4j9j0gfeLL59mbPzQ2bpPbwJmOrLJln7hsAU8BXU3pwOXrQFQp6QGq5AoA4mlwuc7hlD13QCfZG181NsmB_K1ZKguAhrw3cwgSsXIi-kiq_RpqW0z8MBS6ep3C7n1Eb11bbwJBJf9Csyn2Rs_9DdDkCSsWpsQEToMC49tnJC1EBCKpMkZ77St2bc5w3LbVizIUwZO7Ab4JIPjow4ntWfJbSDjuBtSbcT2C4bldfg2C_WKvLwIaadGwQ7acbFUYpxaqWzhodB-CZbTLE4esbi-tDTIcAHIWKMKB0XfyGqYsyphSpuFMYhFWDPYX4ZtbGqM1crcDbCcZHFy3OKQWzwhTQPCDugUU_nGaOA8F6cSA-Iro61mVAJ9BxkrmSAKuWwYn93NoTvXfZrJyUOTo0ELyb4ipE9y8qmpw3xB44mU1tkaoiZWPFoVG-BH4MUQfygjvyNU7ka47pp3t-33J59z_mNnj587dubx448dfXjswyPv77-7d__99tv1v9vn709-f_J_sY4oiTEYAAA). + +```mermaid +flowchart TB + WD["@/contract_id/0x01/widget"]:::tree + WD ==> CO["color: ProvableCountTree"]:::path + CO ==> C000["color_00000000: CountTree count=100"]:::target + CO ==> C001["color_00000001: CountTree count=100"]:::target + CO -.-> CMore["color_00000002 ... color_00000999"]:::faded + + SDK["Verifier returns Entries([
("color_00000000", 100),
("color_00000001", 100)
])"]:::sdk + C000 -.-> SDK + C001 -.-> SDK + + classDef tree fill:#21262d,color:#c9d1d9,stroke:#1f6feb,stroke-width:2px; + classDef path fill:#d29922,color:#0d1117,stroke:#1f6feb,stroke-width:2px; + classDef faded fill:#21262d,color:#6e7681,stroke:#484f58; + classDef target fill:#39c5cf,color:#0d1117,stroke:#39c5cf,stroke-width:3px; + classDef sdk fill:#21262d,color:#39c5cf,stroke:#39c5cf,stroke-width:2px,stroke-dasharray: 4 2; + + linkStyle 0 stroke:#1f6feb,stroke-width:3px; + linkStyle 1 stroke:#1f6feb,stroke-width:3px; + linkStyle 2 stroke:#1f6feb,stroke-width:3px; +``` + +### Diagram: per-layer merk-tree structure (Layer 5+) + +Identical to [Q6's Layer-5+ diagram](./count-index-examples.md#query-6--in-on-bycolor-rangecountable). The byColor `ProvableCountTree` at L6 carries the same `KVHashCount` running counts; the SDK ignores them for point-lookup group_by and reads only the two resolved targets' `count_value_or_default`. + +## G3 — Compound `In` + Equal, Grouped By `brand` + +```text +select = COUNT +where = brand IN ["brand_000", "brand_001"] AND color == "color_00000500" +group_by = [brand] +prove = true +``` + +**Path query** (per-In compound resolution — outer Query on byBrand, inner subquery on byBrandColor's `color` terminator): + +```text +path: ["@", contract_id, 0x01, "widget", "brand"] +query items: [Key("brand_000"), Key("brand_001")] +subquery_path: ["color"] +subquery items: [Key("color_00000500")] +``` + +**Verified payload:** + +```text +Entries([ + ("brand_000", CountTree { count_value_or_default: 1 }), + ("brand_001", CountTree { count_value_or_default: 1 }), +]) +``` + +Each `(brand, "color_00000500")` pair has exactly 1 document in the bench's deterministic schedule. + +**Proof size:** 2 842 B. **Mode:** `CountMode::GroupByIn` over the `byBrandColor` compound index. + +**Proof display:** + +
+Expand to see the structured proof (8 layers — two parallel brand-X → color → color_00000500 descents sharing L1–L6) — or open interactively in the visualizer ↗ + +```text +GroveDBProofV1 { + LayerProof { + proof: Merk( + 0: Push(Hash(HASH[bd291f29893fb6f6d6201087746ca1f23a178dd08e1346cb6c127e91ae3623b3])) + 1: Push(KVValueHash(@, Tree(4ed22624752972af97fb71abf4067b23e6d296a61a02f35b2098819fde39d289), HASH[4a5a28cb1b40226aa35b2f0d502767df13268bdf4678627dbfde26a557acdf73])) + 2: Parent + 3: Push(Hash(HASH[19c924989e473a90d0848277d0b1498ccc8db3dc870cbc130e773f3d79ea5b71])) + 4: Child) + lower_layers: { + @ => { + LayerProof { + proof: Merk( + 0: Push(KVValueHash(0x4ed22624752972af97fb71abf4067b23e6d296a61a02f35b2098819fde39d289, Tree(01), HASH[5b90e1e952b7eef903cc9db2d9098e334a37f7e08cade52c6b2ea3bf4b56b645]))) + lower_layers: { + 0x4ed22624752972af97fb71abf4067b23e6d296a61a02f35b2098819fde39d289 => { + LayerProof { + proof: Merk( + 0: Push(Hash(HASH[49e7191075272395ed72cf03e973987ede6e4945e08574fe77d725f4ce7ecdf8])) + 1: Push(KVValueHash(0x01, Tree(776964676574), HASH[5d9a0fad8a3f32560f8e8950c1e84a7feabaab21b79bc72fec4482442844e2ef])) + 2: Parent) + lower_layers: { + 0x01 => { + LayerProof { + proof: Merk( + 0: Push(KVValueHash(widget, Tree(6272616e64), HASH[6c505f53f2ebf3de030cc2aca463d4b429aeb320a9fadb8ae68bb7903a22bb68]))) + lower_layers: { + widget => { + LayerProof { + proof: Merk( + 0: Push(Hash(HASH[9862894b16a0792688fdcf64edcb2ceade5c8b234649bfc6cfc6426869b0e9d9])) + 1: Push(KVValueHash(brand, Tree(6272616e645f303633), HASH[68b697da99d6ea70a83eb41794dca7ba3938d0ba98fbfaeb3cd0c19b3b5d0ff2])) + 2: Parent + 3: Push(Hash(HASH[6c36729e93b1a316cbf60fe282eb630c0ed6e45db088e365110302b6c9caba86])) + 4: Child) + lower_layers: { + brand => { + LayerProof { + proof: Merk( + 0: Push(KVValueHash(brand_000, CountTree(636f6c6f72, 1000, flags: [0, 0, 0]), HASH[90ff6f6d9a3d901195982128130677243bfd27b75736206f3c8400966ef0d37b])) + 1: Push(KVValueHash(brand_001, CountTree(636f6c6f72, 1000, flags: [0, 0, 0]), HASH[484ca11fb4ec8f479be1f78af903ce0c9d4fe630517579fb0172c2576d6b9652])) + 2: Parent + 3: Push(Hash(HASH[8ca09dadc802a7efe03534ce4ad991b2f191f368878754a37b5e5c03d9498dab])) + 4: Child + 5: Push(KVHash(HASH[e5297b3ebe81c6435c29f712074da5f7c90265e12ed3d4f5af1f6d900e50c9f1])) + 6: Parent + 7: Push(Hash(HASH[50f373fd01dea89c992779764dff82cc7200b492be8f5cf3721627d5323bcbff])) + 8: Child + 9: Push(KVHash(HASH[cf78c9f1b1a1204bb2e437806f52c21e331392de3436388572bd1fa4bce1cdc7])) + 10: Parent + 11: Push(Hash(HASH[4a8dc186a95c8c4a1252fb51dbc407727f588eb5bdc8313c96f5c29889e13926])) + 12: Child + 13: Push(KVHash(HASH[d00ee7653e34e47d46004929b13ded33dff069ed9cc88342cecdf66a65fd8401])) + 14: Parent + 15: Push(Hash(HASH[7f1d17b9632f0bd440dacf5e841025482bc1d8145df3650301a95a5ee71ce8c8])) + 16: Child + 17: Push(KVHash(HASH[3ed48a5e35cb7546d329487b0e1ab8a81d7c5bec358c37449e6cbd956e3bb069])) + 18: Parent + 19: Push(Hash(HASH[eaef9fc530408393bc321409414814b290309a861f474a925a922250327affc6])) + 20: Child + 21: Push(KVHash(HASH[f776417ede76e6194706e483ac14ab7b3db6aa0461ec14ed5f8e5d20071363af])) + 22: Parent + 23: Push(Hash(HASH[b3fccba79c14fcc5e97ff6a3cd051228dc755e6de147bef690ba9681264b2b9f])) + 24: Child) + lower_layers: { + brand_000 => { + LayerProof { + proof: Merk( + 0: Push(Hash(HASH[d605b4b78e674fd77371ea6adb32ce3e58ee3b96d73c4d34df84159661634587])) + 1: Push(KVValueHash(color, NonCounted(ProvableCountTree(636f6c6f725f3030303030353131, 1000, flags: [0, 0, 0])), HASH[fccc0c94657f2a78084f789bb6f687c4bba295e3a062f3199bc33f14dd2b7fe2])) + 2: Parent) + lower_layers: { + color => { + LayerProof { + proof: Merk( + ... 37 ops — same boundary shape as Q4 / Q8's L8, + terminating at op 18 with + Push(KVValueHashFeatureTypeWithChildHash( + color_00000500, CountTree(00, 1, ...), + HASH[6834...], ProvableCountedMerkNode(1), + HASH[840c...])) + — TARGET 1 + ) + } + } + } + } + } + brand_001 => { + LayerProof { + proof: Merk( + 0: Push(Hash(HASH[f54769bf6e9d24b9dba53ebd37c9ceb3485b3c6511f8de6f17860676fe4d9331])) + 1: Push(KVValueHash(color, NonCounted(ProvableCountTree(636f6c6f725f3030303030353131, 1000, flags: [0, 0, 0])), HASH[8f883171c33df0aba2541a5b9d6195faac7bd1ffef93e8ddcaf9d092f0fa5e19])) + 2: Parent) + lower_layers: { + color => { + LayerProof { + proof: Merk( + ... 37 ops — same boundary shape as brand_000's + color subtree, terminating at op 18 with + Push(KVValueHashFeatureTypeWithChildHash( + color_00000500, CountTree(00, 1, ...), + HASH[881d...], ProvableCountedMerkNode(1), + HASH[a422...])) + — TARGET 2 + ) + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } +} +``` + +The two parallel descents below `brand` are the structurally novel part — every other layer above `brand` is byte-identical to Q4. The byBrand layer (L6) inlines `brand_000` and `brand_001` as `KVValueHash` siblings (ops 0–2), then descends via the `lower_layers` map into each one's value-tree continuation. Each continuation (L7) carries a single `color` key whose value is `NonCounted(ProvableCountTree(…))` — the byBrandColor terminator. The terminator (L8) walks the boundary path through its in-color binary merk tree to land at `color_00000500` with `CountTree count=1` and a feature-typed child hash. + +The bulk of the proof bytes (≈ 2 × 1 100 B = 2 200 B) is the doubled L7+L8 descent. The L1–L6 prefix amortises across both branches (≈ 600 B shared), giving 2 842 B total — significantly less than 2× Q4's 1 911 B because the upper layers aren't repeated. + +
+ +```mermaid +flowchart TB + WD["@/contract_id/0x01/widget"]:::tree + WD ==> BR["brand: NormalTree"]:::path + BR ==> B000["brand_000: CountTree count=1000"]:::path + BR ==> B001["brand_001: CountTree count=1000"]:::path + B000 ==> B000_C["color: NonCounted(ProvableCountTree)"]:::path + B001 ==> B001_C["color: NonCounted(ProvableCountTree)"]:::path + B000_C ==> T1["color_00000500: CountTree count=1"]:::target + B001_C ==> T2["color_00000500: CountTree count=1"]:::target + + SDK["Verifier returns Entries([
("brand_000", 1),
("brand_001", 1)
])"]:::sdk + T1 -.-> SDK + T2 -.-> SDK + + classDef tree fill:#21262d,color:#c9d1d9,stroke:#1f6feb,stroke-width:2px; + classDef path fill:#6e7681,color:#fff,stroke:#1f6feb,stroke-width:2px; + classDef target fill:#39c5cf,color:#0d1117,stroke:#39c5cf,stroke-width:3px; + classDef sdk fill:#21262d,color:#39c5cf,stroke:#39c5cf,stroke-width:2px,stroke-dasharray: 4 2; + + linkStyle 0 stroke:#1f6feb,stroke-width:3px; + linkStyle 1 stroke:#1f6feb,stroke-width:3px; + linkStyle 2 stroke:#1f6feb,stroke-width:3px; + linkStyle 3 stroke:#1f6feb,stroke-width:3px; + linkStyle 4 stroke:#1f6feb,stroke-width:3px; + linkStyle 5 stroke:#1f6feb,stroke-width:3px; + linkStyle 6 stroke:#1f6feb,stroke-width:3px; +``` + +### Diagram: per-layer merk-tree structure (Layer 5+) + +Layers 5–6 are like [Q4](./count-index-examples.md#query-4--compound-equal-only-bybrandcolor)'s L5 + Q5's L6 combined (one `KVValueHash` per In brand at byBrand's binary tree); Layers 7–8 fork — one `brand_000`-rooted continuation chain and one `brand_001`-rooted chain — each shaped exactly like Q4's L7 + L8 descent. + +```mermaid +flowchart TB + subgraph L5["Layer 5 — widget doctype merk-tree"] + direction TB + L5_q["brand
kv_hash=HASH[68b6...]
value: Tree (descent into byBrand)"]:::queried + L5_left["HASH[9862...]"]:::sibling + L5_right["HASH[6c36...]"]:::sibling + L5_q --> L5_left + L5_q --> L5_right + end + + subgraph L6["Layer 6 — byBrand merk-tree (TWO INTERMEDIATE TARGETS)"] + direction TB + L6_t1["brand_001
kv_hash=HASH[484c...]
value: CountTree count=1000"]:::queried + L6_t0["brand_000
kv_hash=HASH[90ff...]
value: CountTree count=1000"]:::queried + L6_boundary["Boundary commitments (22 merk ops):
7 KVHash sibling brands + 7 Hash subtrees"]:::sibling + L6_t1 --> L6_t0 + L6_t1 --> L6_boundary + end + + subgraph L7a["Layer 7a — brand_000's continuation merk-tree"] + direction TB + L7a_q["color
kv_hash=HASH[fccc...]
value: NonCounted(ProvableCountTree)"]:::queried + L7a_left["HASH[d605...]"]:::sibling + L7a_q --> L7a_left + end + + subgraph L7b["Layer 7b — brand_001's continuation merk-tree"] + direction TB + L7b_q["color
kv_hash=HASH[8f88...]
value: NonCounted(ProvableCountTree)"]:::queried + L7b_left["HASH[f547...]"]:::sibling + L7b_q --> L7b_left + end + + subgraph L8a["Layer 8a — brand_000's byBrandColor color subtree (TARGET 1)"] + direction TB + L8a_target["color_00000500
kv_hash=HASH[6834...]
value: CountTree count=1
feature: ProvableCountedMerkNode(1)"]:::target + L8a_boundary["37 merk ops:
9 KVHashCount boundary commitments
(running counts 3, 7, 15, 31, 63, 127, 255, 511, 1000)
+ subtree hashes"]:::sibling + L8a_target --> L8a_boundary + end + + subgraph L8b["Layer 8b — brand_001's byBrandColor color subtree (TARGET 2)"] + direction TB + L8b_target["color_00000500
kv_hash=HASH[881d...]
value: CountTree count=1
feature: ProvableCountedMerkNode(1)"]:::target + L8b_boundary["37 merk ops:
same boundary shape as L8a
(different hashes — different brand's subtree)"]:::sibling + L8b_target --> L8b_boundary + end + + L5_q -. "Tree(merk_root[byBrand])" .-> L6_t1 + L6_t0 -. "CountTree continuation" .-> L7a_q + L6_t1 -. "CountTree continuation" .-> L7b_q + L7a_q -. "NonCounted(ProvableCountTree)" .-> L8a_target + L7b_q -. "NonCounted(ProvableCountTree)" .-> L8b_target + + classDef queried fill:#1f6feb,color:#fff,stroke:#1f6feb,stroke-width:2px; + classDef sibling fill:#6e7681,color:#fff,stroke:#6e7681; + classDef target fill:#39c5cf,color:#0d1117,stroke:#39c5cf,stroke-width:3px; +``` + +The two parallel byBrandColor descents share their L1–L6 commitments (the doctype prefix + byBrand merk root) but each gets its own L7 + L8 sub-proof. Proof bytes ≈ shared upper layers + 2 × per-brand byBrandColor descent ≈ 2 842 B. + +## G4 — Range on `byColor`, Grouped By `color` + +`GroupByRange` is the proof primitive that enumerates distinct in-range keys with a count per key, as opposed to chapter 29's `AggregateCountOnRange` which collapses the same range to a single `u64`. + +```text +select = COUNT +where = color > "color_00000500" +group_by = [color] +prove = true +``` + +**Path query** (uses `distinct_count_path_query` with `limit=100, left_to_right=true`): + +```text +path: ["@", contract_id, 0x01, "widget", "color"] +query items: [RangeAfter("color_00000500"..)] +limit: 100 +``` + +**Verified payload:** + +```text +Entries(100 groups, sum = 10 000) +``` + +The 100 groups are color_00000501 through color_00000600 (the first 100 in-range colors in lex-asc order, capped by the limit). Each carries `count_value_or_default = 100` since the fixture's deterministic schedule gives each color exactly 100 documents. + +Wait — but [Q7](./count-index-examples.md#query-7--range-query-aggregatecountonrange) said there are 499 distinct in-range colors and `sum = 49 900` over the same `color > "color_00000500"` predicate. So why does G4 see only 100 groups summing to 10 000? Because `GroupByRange`'s `distinct_count_path_query` applies the 100-entry response cap (`Some(limit)` in [`execute_distinct_count_with_proof`](https://github.com/dashpay/platform/blob/v3.1-dev/packages/rs-drive/src/query/drive_document_count_query/execute_range_count.rs)). Without that cap the proof would scale linearly with the full in-range distinct count (~5.5 KB for the full 499 colors at ~110 B per resolved CountTree branch). The cap is a response-size safety control — the verifier ceases the walk once it has 100 entries. + +**Proof size:** 10 992 B — ~5.3 × [Q7](./count-index-examples.md#query-7--range-query-aggregatecountonrange). The structural reason: + +- **Q7 (`AggregateCountOnRange`)** walks the *boundary* of the range and emits one `HashWithCount` or `KVDigestCount` per merk-binary-tree boundary node. Total boundary nodes ≈ `O(log C)` (≈ 36 ops on the 1 000-color tree). The verifier sums subtree counts directly without descending into individual keys. +- **G4 (`GroupByRange`)** walks the *distinct in-range colors themselves* — emitting one `KVValueHashFeatureTypeWithChildHash(color_X, CountTree count=100, ProvableCountedMerkNode(…), …)` per distinct color in the range, not just per merk-tree boundary node. Total ops ≈ `O(R)` where `R` is the distinct in-range colors (capped at 100 here). + +The trade-off is exactly what you'd expect: `AggregateCountOnRange` is `O(log C)` in proof bytes but loses per-key resolution (returns one `u64`); `GroupByRange` is `O(R)` in proof bytes but preserves per-key counts. + +**Proof display:** + +
+Expand to see the structured proof (5 layers; bottom layer enumerates 100 distinct in-range colors as `KVValueHashFeatureTypeWithChildHash` targets, each carrying `CountTree count=100`) — or open interactively in the visualizer ↗ + +```text +GroveDBProofV1 { + LayerProof { + proof: Merk( + 0: Push(Hash(HASH[bd291f29893fb6f6d6201087746ca1f23a178dd08e1346cb6c127e91ae3623b3])) + 1: Push(KVValueHash(@, Tree(4ed22624752972af97fb71abf4067b23e6d296a61a02f35b2098819fde39d289), HASH[4a5a28cb1b40226aa35b2f0d502767df13268bdf4678627dbfde26a557acdf73])) + 2: Parent + 3: Push(Hash(HASH[19c924989e473a90d0848277d0b1498ccc8db3dc870cbc130e773f3d79ea5b71])) + 4: Child) + lower_layers: { + @ => { + LayerProof { + proof: Merk( + 0: Push(KVValueHash(0x4ed22624752972af97fb71abf4067b23e6d296a61a02f35b2098819fde39d289, Tree(01), HASH[5b90e1e952b7eef903cc9db2d9098e334a37f7e08cade52c6b2ea3bf4b56b645]))) + lower_layers: { + 0x4ed22624752972af97fb71abf4067b23e6d296a61a02f35b2098819fde39d289 => { + LayerProof { + proof: Merk( + 0: Push(Hash(HASH[49e7191075272395ed72cf03e973987ede6e4945e08574fe77d725f4ce7ecdf8])) + 1: Push(KVValueHash(0x01, Tree(776964676574), HASH[5d9a0fad8a3f32560f8e8950c1e84a7feabaab21b79bc72fec4482442844e2ef])) + 2: Parent) + lower_layers: { + 0x01 => { + LayerProof { + proof: Merk( + 0: Push(KVValueHash(widget, Tree(6272616e64), HASH[6c505f53f2ebf3de030cc2aca463d4b429aeb320a9fadb8ae68bb7903a22bb68]))) + lower_layers: { + widget => { + LayerProof { + proof: Merk( + 0: Push(Hash(HASH[9862894b16a0792688fdcf64edcb2ceade5c8b234649bfc6cfc6426869b0e9d9])) + 1: Push(KVHash(HASH[a29ee8f206a253362b6da4fcacf8643ee8e5925cd979fcd449e5906f0f9f8be3])) + 2: Parent + 3: Push(KVValueHash(color, ProvableCountTree(636f6c6f725f3030303030353131, 100000), HASH[79569d595db75bbf2e9dca93a15c90b7eecf7b299632668ec410e2076d27f71c])) + 4: Child) + lower_layers: { + color => { + LayerProof { + proof: Merk( + ... 18 boundary-descent ops walking the binary tree from + root (color_00000511) leftward to the cut point ... + 18: Push(KVDigestCount(color_00000500, HASH[47b0ade5...], 100)) + // op 18: BOUNDARY (excluded by strict `>`) + 19: Push(KVValueHashFeatureTypeWithChildHash(color_00000501, + CountTree(00, 100, flags: [0, 0, 0]), + HASH[9146433eb6d43db2f109f5f7714146624bd646b27c7310f3c2cad7155eb7c741], + ProvableCountedMerkNode(300), + HASH[c285efb8724a488de916ce8301b06c197fc687b5b9b83a04bf3a026f1098d17a])) + // op 19: TARGET 1 + 20: Parent + 21: Push(KVValueHashFeatureTypeWithChildHash(color_00000502, CountTree(00, 100, ...))) + // op 21: TARGET 2 + ... 98 more KVValueHashFeatureTypeWithChildHash targets + (color_00000503 ... color_00000600), each emitting + `CountTree count=100` plus its merk feature/child-hash glue, + interleaved with Parent/Child ops walking the binary tree + in lex-asc order. Every target shares the same shape: + Push(KVValueHashFeatureTypeWithChildHash( + color_XXXXXXXX, + CountTree(00, 100, flags: [0, 0, 0]), + HASH[...], + ProvableCountedMerkNode(running_count_at_this_node), + HASH[...] + )) ... + 220: Push(KVValueHashFeatureTypeWithChildHash(color_00000600, + CountTree(00, 100, ...))) // op 220: TARGET 100 (LAST) + 221..244: closing boundary ops — KVHashCount running + counts (300, 700, 6300, 25500, 48800) and Hash subtrees + proving the still-out-of-range portion to the right of + color_00000600 covers the remainder of the merk root.) + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } +} +``` + +That schematic gives the shape; the bench's `[gproof]` output (run `cargo bench --bench document_count_worst_case` and grep `[gproof] G4`) has all 245 ops verbatim. The compression in the chapter just elides the 100 `KVValueHashFeatureTypeWithChildHash` targets since they share the same structural template — only the key name, the leaf kv-hash, the running count, and the child-hash differ. + +**Why so many targets?** Because `GroupByRange` *must* enumerate every in-range key with its `CountTree` value — the SDK needs each individual key→count pair, which the aggregate-style `HashWithCount` commitment hides. So the prover walks the merk binary tree's in-order traversal across the in-range portion (here, left-to-right starting just past `color_00000500`) and emits one `KVValueHashFeatureTypeWithChildHash` per distinct color it visits, until the response-size limit is reached. + +
+ +```mermaid +flowchart TB + WD["@/contract_id/0x01/widget"]:::tree + WD ==> CO["color: ProvableCountTree count=100000"]:::path + CO -.-> C500["color_00000500 (boundary, excluded)"]:::faded + CO ==> C501["color_00000501: CountTree count=100"]:::target + CO ==> CMore["color_00000502 ... color_00000600
(98 more in-range targets,
each CountTree count=100)"]:::target + CO ==> C600["color_00000600: CountTree count=100"]:::target + CO -.-> CRest["color_00000601 ... color_00000999
(beyond limit — opaque)"]:::faded + + SDK["Verifier returns Entries(100 groups):
("color_00000501", 100),
("color_00000502", 100),
... ("color_00000600", 100)"]:::sdk + C501 -.-> SDK + CMore -.-> SDK + C600 -.-> SDK + + classDef tree fill:#21262d,color:#c9d1d9,stroke:#1f6feb,stroke-width:2px; + classDef path fill:#d29922,color:#0d1117,stroke:#1f6feb,stroke-width:2px; + classDef faded fill:#21262d,color:#6e7681,stroke:#484f58; + classDef target fill:#39c5cf,color:#0d1117,stroke:#39c5cf,stroke-width:3px; + classDef sdk fill:#21262d,color:#39c5cf,stroke:#39c5cf,stroke-width:2px,stroke-dasharray: 4 2; + + linkStyle 0 stroke:#1f6feb,stroke-width:3px; + linkStyle 2 stroke:#1f6feb,stroke-width:3px; + linkStyle 3 stroke:#1f6feb,stroke-width:3px; + linkStyle 4 stroke:#1f6feb,stroke-width:3px; +``` + +### Diagram: per-layer merk-tree structure (Layer 5+) + +L5 is identical to [Q3](./count-index-examples.md#query-3--equal-on-a-rangecountable-property-bycolor)'s / [Q6](./count-index-examples.md#query-6--in-on-bycolor-rangecountable)'s L5 (color queried under an opaque kv root in the widget doctype tree). L6 is the structural novelty: 245 merk ops, of which 100 are full `KVValueHashFeatureTypeWithChildHash` targets and the remaining 145 are boundary-walk glue (KVDigestCount / KVHashCount / HashWithCount / Hash + Parent/Child). + +```mermaid +flowchart TB + subgraph L5["Layer 5 — widget doctype merk-tree (proof view for `color`)"] + direction TB + L5_root["KVHash[a29e...]
(opaque kv root)"]:::sibling + L5_left["HASH[9862...]"]:::sibling + L5_q["color
kv_hash=HASH[7956...]
value: ProvableCountTree count=100000"]:::queried + L5_root --> L5_left + L5_root --> L5_q + end + + subgraph L6["Layer 6 — byColor ProvableCountTree merk-tree (100 in-range targets)"] + direction TB + L6_boundary_l["Left boundary descent (18 ops):
walks from merk root color_00000511
through KVHashCount running counts
(51100, 25500, 12700, 6300, 3100, 700)
down to color_00000500"]:::sibling + L6_cut["op 18: KVDigestCount(color_00000500, ..., 100)
(boundary — excluded by strict `>`)"]:::boundary + L6_targets["ops 19..220: 100 in-range targets
color_00000501 (count=100), color_00000502 (100),
color_00000503 (100), ... color_00000600 (100)
each as KVValueHashFeatureTypeWithChildHash
with ProvableCountedMerkNode(subtree_count)
interleaved with Parent/Child glue"]:::target + L6_boundary_r["Right closing boundary (24 ops):
KVHashCount running counts
(300, 700, 6300, 25500, 48800)
+ Hash subtree commitments
covering color_00000601 ... color_00000999"]:::sibling + + L6_boundary_l --> L6_cut + L6_cut --> L6_targets + L6_targets --> L6_boundary_r + end + + L5_q -. "ProvableCountTree(merk_root[byColor])" .-> L6_boundary_l + + classDef queried fill:#1f6feb,color:#fff,stroke:#1f6feb,stroke-width:2px; + classDef sibling fill:#6e7681,color:#fff,stroke:#6e7681; + classDef target fill:#39c5cf,color:#0d1117,stroke:#39c5cf,stroke-width:3px; + classDef boundary fill:#d29922,color:#0d1117,stroke:#d29922,stroke-width:2px,stroke-dasharray: 6 3; +``` + +Three things this diagram makes explicit: + +1. **The cut is named.** `op 18: KVDigestCount(color_00000500, ..., 100)` exposes the key at the boundary so the verifier knows the cut sits exactly between `color_00000500` (excluded) and `color_00000501` (first in-range). Without that named op, a malicious prover could shift the cut and the verifier wouldn't know. +2. **Targets carry their own count, not a running total.** Unlike Q7's boundary commitments (where `ProvableCountedMerkNode(N)` carried a *subtree* count), G4's targets are individual keys with `CountTree(00, 100, ...)` — the `count_value_or_default = 100` IS the per-key count, not a subtree aggregate. The `ProvableCountedMerkNode(N)` on the merk feature still carries the subtree count (e.g. `300` for `color_00000501`'s subtree), but G4's verifier reads `count_value_or_default` directly from the CountTree element. +3. **The right closing boundary doesn't enumerate the rest.** Once the limit is hit at `color_00000600`, the proof commits the remaining ~399 in-range colors as opaque subtree hashes (`KVHashCount` + `Hash` ops). The SDK returns only the 100 visible groups; the remainder are provably present but not enumerated. This is the limit's whole point — bound response size without sacrificing soundness on the visible groups. + +## G5 — Compound `In` + Range, Grouped By `brand, color` + +```text +select = COUNT +where = brand IN ["brand_000", "brand_001"] AND color > "color_00000500" +group_by = [brand, color] +prove = true +``` + +**Path query** (outer In on byBrand fans out to per-brand `distinct_count_path_query` on byBrandColor's color terminator): + +```text +outer path: ["@", contract_id, 0x01, "widget", "brand"] +outer query items: [Key("brand_000"), Key("brand_001")] +subquery_path: ["color"] +subquery items: [RangeAfter("color_00000500"..)] +subquery limit: 100 (shared across both brands) +``` + +**Verified payload:** + +```text +Entries(100 groups, sum = 100) +``` + +Two brands × 50 in-range colors per brand = 100 distinct `(brand, color)` groups visible in the proof. Each `(brand_X, color_Y)` pair has exactly 1 document by the fixture's deterministic schedule. + +**Proof size:** 11 554 B. **Mode:** `CountMode::GroupByCompound`. + +This is the most general group-by shape supported on this contract: outer `In` fan-out × inner `GroupByRange` walk. Structurally it combines [G3](#g3--compound-in--equal-grouped-by-brand)'s two-branch descent with [G4](#g4--range-on-bycolor-grouped-by-color)'s in-range enumeration per branch. Proof bytes ≈ shared upper-layer descent + 2 × per-brand byBrandColor distinct-walk. The bench's `group_by_compound_in_range_proof_limit_100` benchmark uses the same shape with `|IN| = 100` brands instead of 2 — yielding 17 256 B at the much higher fan-out. + +**Proof display:** + +
+Expand to see the structured proof (8 layers — same descent skeleton as G3, but each brand's L8 enumerates 50 in-range colors instead of one point-lookup target) — or open interactively in the visualizer ↗ + +```text +GroveDBProofV1 { + LayerProof { + proof: Merk( + 0: Push(Hash(HASH[bd291f29893fb6f6d6201087746ca1f23a178dd08e1346cb6c127e91ae3623b3])) + 1: Push(KVValueHash(@, Tree(4ed22624752972af97fb71abf4067b23e6d296a61a02f35b2098819fde39d289), HASH[4a5a28cb1b40226aa35b2f0d502767df13268bdf4678627dbfde26a557acdf73])) + 2: Parent + 3: Push(Hash(HASH[19c924989e473a90d0848277d0b1498ccc8db3dc870cbc130e773f3d79ea5b71])) + 4: Child) + lower_layers: { + @ => { LayerProof { ... contract_id descent ... } } + // L2..L4 identical to G3 / Q4's first three subgroves + } + } + // L5 widget doctype merk tree: same as G3 — `brand` queried, opaque siblings 9862 / 6c36 + // L6 byBrand merk tree: two KVValueHash targets (brand_000 + brand_001), 25 boundary ops + // L7a brand_000's value tree: single key `color` with NonCounted(ProvableCountTree(...)) + // L8a byBrandColor's color subtree (under brand_000): + // proof: Merk( + // ... 18 boundary-descent ops walking from the merk root down to color_00000500 ... + // 18: Push(KVDigestCount(color_00000500, HASH[...], 1)) // BOUNDARY, excluded + // 19: Push(KVValueHashFeatureTypeWithChildHash(color_00000501, + // CountTree(00, 1, flags: [0, 0, 0]), + // HASH[4192...], ProvableCountedMerkNode(3), HASH[c3b4...])) // TARGET (brand_000, color_00000501) + // 21: Push(KVValueHashFeatureTypeWithChildHash(color_00000502, CountTree(00, 1, ...))) // TARGET 2 + // 24: Push(KVValueHashFeatureTypeWithChildHash(color_00000503, CountTree(00, 1, ...))) // TARGET 3 + // ... 47 more KVValueHashFeatureTypeWithChildHash targets, each CountTree(00, 1, ...) + // — color_00000504 ... color_00000550 (50 per-brand_000 targets total) ... + // ... closing boundary ops covering color_00000551 ... color_00000999 for brand_000 + // ) + // end L8a + // end L7a + // L7b brand_001's value tree: identical structure to L7a, single key `color` + // L8b byBrandColor's color subtree (under brand_001): + // proof: Merk( + // ... 18 boundary-descent ops (different hashes — different brand's subtree) ... + // 18: Push(KVDigestCount(color_00000500, HASH[...], 1)) + // 19..220: 50 in-range KVValueHashFeatureTypeWithChildHash(color_X, CountTree(00, 1, ...)) targets + // + interleaved Parent/Child glue + closing boundary ops + // ) + // end L8b + // end L7b + // end L6 +} +``` + +The 344-line verbatim is available via the bench's `[gproof] G5` output. The schematic compresses the 50 per-brand `KVValueHashFeatureTypeWithChildHash` targets at L8a / L8b — they all share the same template (`CountTree(00, 1, ...)` since each `(brand, color)` pair has count=1), differing only in key, leaf kv-hash, running count, and child-hash. Once you've seen [G3's L8 structure](#g3--compound-in--equal-grouped-by-brand) (single target) and [G4's L6 structure](#g4--range-on-bycolor-grouped-by-color) (100 in-range targets at the doctype level), G5 is precisely the product: two parallel G3-shaped descents that each terminate in a G4-shaped distinct-walk. + +
+ +```mermaid +flowchart TB + WD["@/contract_id/0x01/widget"]:::tree + WD ==> BR["brand: NormalTree"]:::path + BR ==> B000["brand_000: CountTree count=1000"]:::path + BR ==> B001["brand_001: CountTree count=1000"]:::path + + B000 ==> B000_C["brand_000/color: NonCounted(ProvableCountTree)"]:::path + B001 ==> B001_C["brand_001/color: NonCounted(ProvableCountTree)"]:::path + + B000_C ==> T000_501["color_00000501: CountTree count=1"]:::target + B000_C ==> T000_more["... 48 more color targets
(brand_000, color_00000502..550)"]:::target + B000_C ==> T000_550["color_00000550: CountTree count=1"]:::target + + B001_C ==> T001_501["color_00000501: CountTree count=1"]:::target + B001_C ==> T001_more["... 48 more color targets
(brand_001, color_00000502..550)"]:::target + B001_C ==> T001_550["color_00000550: CountTree count=1"]:::target + + SDK["Entries(100 groups, sum=100):
("brand_000", "color_00000501", 1),
...
("brand_001", "color_00000550", 1)"]:::sdk + + T000_501 -.-> SDK + T000_more -.-> SDK + T000_550 -.-> SDK + T001_501 -.-> SDK + T001_more -.-> SDK + T001_550 -.-> SDK + + classDef tree fill:#21262d,color:#c9d1d9,stroke:#1f6feb,stroke-width:2px; + classDef path fill:#6e7681,color:#fff,stroke:#1f6feb,stroke-width:2px; + classDef target fill:#39c5cf,color:#0d1117,stroke:#39c5cf,stroke-width:3px; + classDef sdk fill:#21262d,color:#39c5cf,stroke:#39c5cf,stroke-width:2px,stroke-dasharray: 4 2; + + linkStyle 0 stroke:#1f6feb,stroke-width:3px; + linkStyle 1 stroke:#1f6feb,stroke-width:3px; + linkStyle 2 stroke:#1f6feb,stroke-width:3px; + linkStyle 3 stroke:#1f6feb,stroke-width:3px; + linkStyle 4 stroke:#1f6feb,stroke-width:3px; + linkStyle 5 stroke:#1f6feb,stroke-width:3px; + linkStyle 6 stroke:#1f6feb,stroke-width:3px; + linkStyle 7 stroke:#1f6feb,stroke-width:3px; + linkStyle 8 stroke:#1f6feb,stroke-width:3px; +``` + +### Diagram: per-layer merk-tree structure (Layer 5+) + +Layers 5–7 are exactly [G3's L5–L7](#diagram-per-layer-merk-tree-structure-layer-5-2). The difference shows up at L8 — instead of a single target per brand (G3's compound point lookup), each brand's L8 walks 50 in-range colors via the same `KVValueHashFeatureTypeWithChildHash` enumeration G4 uses, plus the boundary descent / closing boundary glue. + +```mermaid +flowchart TB + subgraph L5["Layer 5 — widget doctype merk-tree"] + direction TB + L5_q["brand (queried)
kv_hash=HASH[68b6...]"]:::queried + end + + subgraph L6["Layer 6 — byBrand merk-tree (two intermediate targets)"] + direction TB + L6_t0["brand_000 (queried)
CountTree count=1000"]:::queried + L6_t1["brand_001 (queried)
CountTree count=1000"]:::queried + end + + subgraph L7a["Layer 7a — brand_000's continuation"] + direction TB + L7a_q["color (queried)
NonCounted(ProvableCountTree)"]:::queried + end + subgraph L7b["Layer 7b — brand_001's continuation"] + direction TB + L7b_q["color (queried)
NonCounted(ProvableCountTree)"]:::queried + end + + subgraph L8a["Layer 8a — brand_000's byBrandColor distinct-walk"] + direction TB + L8a_targets["50 KVValueHashFeatureTypeWithChildHash targets:
color_00000501 ... color_00000550
each CountTree(00, 1, ...)
+ left/right boundary glue"]:::target + end + subgraph L8b["Layer 8b — brand_001's byBrandColor distinct-walk"] + direction TB + L8b_targets["50 KVValueHashFeatureTypeWithChildHash targets:
color_00000501 ... color_00000550
each CountTree(00, 1, ...)
+ left/right boundary glue
(different hashes — different brand subtree)"]:::target + end + + L5_q -. "byBrand" .-> L6_t0 + L5_q -. "byBrand" .-> L6_t1 + L6_t0 -. "continuation" .-> L7a_q + L6_t1 -. "continuation" .-> L7b_q + L7a_q -. "byBrandColor distinct-range" .-> L8a_targets + L7b_q -. "byBrandColor distinct-range" .-> L8b_targets + + classDef queried fill:#1f6feb,color:#fff,stroke:#1f6feb,stroke-width:2px; + classDef target fill:#39c5cf,color:#0d1117,stroke:#39c5cf,stroke-width:3px; +``` + +The 50-targets-per-brand limit reflects the shared response-size cap. In the 2-brand case the cap kicks in at 50 colors per brand; if the In set had 1 brand it would be 100 colors; if it had 4 brands it would be 25 each. The dispatcher slices the cap evenly across the In fan-out so the *total* number of returned entries equals the limit, regardless of how many In branches share it. That's why the bench's `[matrix]` row for this case shows `Entries(len=100, sum=100)` rather than `len=200, sum=200`. + +## G6 — High-Fanout `In` on `byBrand` + +```text +select = COUNT +where = brand IN ["brand_000", "brand_001", ..., "brand_099"] +group_by = [brand] +prove = true +``` + +**Path query** (same shape as G1, scaled to `|IN| = 100`): + +```text +path: ["@", contract_id, 0x01, "widget", "brand"] +query items: [Key("brand_000"), Key("brand_001"), ..., Key("brand_099")] +``` + +**Verified payload:** + +```text +Entries(100 groups, sum = 100 000) +``` + +Every document in the fixture, partitioned by brand. Each `Entries[i]` carries `(brand_NNN, CountTree count=1000)`. + +**Proof size:** 10 038 B. **Mode:** `CountMode::GroupByIn`. + +Same structural shape as [G1](#g1--in-on-bybrand-grouped-by-brand), scaled from `|IN| = 2` to `|IN| = 100`. The byBrand merk binary tree at L6 emits all 100 brands as `KVValueHashFeatureTypeWithChildHash` targets — each ~100 B (key + leaf kv-hash + `CountTree(00, 1000, ...)` + `BasicMerkNode` feature + child-hash) — plus minimal boundary glue at the binary-tree corners. The proof grows linearly with `|IN|`: G1 (`|IN|=2`) was 1 102 B; G6 (`|IN|=100`) is 10 038 B; the slope is ~99 B per additional In value. + +Compare against the `byColor` equivalent (`group_by_color_in_proof_100_rangecountable_branches`, 10 512 B): the `ProvableCountTree` overhead from `byColor`'s `KVHashCount` running counts adds ~5 % to the byBrand baseline, even though those running counts aren't consumed by a point-lookup group_by. This is the same `ProvableCountTree` overhead [G2](#g2--in-on-bycolor-grouped-by-color) carried at the smaller scale (`|IN|=2`). + +**Proof display:** + +
+Expand to see the structured proof (5 layers; bottom layer enumerates 100 brands as `KVValueHashFeatureTypeWithChildHash` targets — 192 merk ops total at L6 including binary-tree glue) — or open interactively in the visualizer ↗ + +```text +GroveDBProofV1 { + LayerProof { + proof: Merk( + 0: Push(Hash(HASH[bd291f29893fb6f6d6201087746ca1f23a178dd08e1346cb6c127e91ae3623b3])) + 1: Push(KVValueHash(@, Tree(4ed22624752972af97fb71abf4067b23e6d296a61a02f35b2098819fde39d289), HASH[4a5a28cb1b40226aa35b2f0d502767df13268bdf4678627dbfde26a557acdf73])) + 2: Parent + 3: Push(Hash(HASH[19c924989e473a90d0848277d0b1498ccc8db3dc870cbc130e773f3d79ea5b71])) + 4: Child) + lower_layers: { + // L2..L4 are byte-identical to every other query in this chapter + // (the @ / contract_id / 0x01 descent into widget); see chapter 29's + // Q1 verbatim for the full L1..L4 chain. + ... + widget => { + LayerProof { + proof: Merk( + // L5 widget doctype — `brand` queried, opaque siblings 9862 / 6c36 + 0: Push(Hash(HASH[9862894b16a0792688fdcf64edcb2ceade5c8b234649bfc6cfc6426869b0e9d9])) + 1: Push(KVValueHash(brand, Tree(6272616e645f303633), HASH[68b697da99d6ea70a83eb41794dca7ba3938d0ba98fbfaeb3cd0c19b3b5d0ff2])) + 2: Parent + 3: Push(Hash(HASH[6c36729e93b1a316cbf60fe282eb630c0ed6e45db088e365110302b6c9caba86])) + 4: Child) + lower_layers: { + brand => { + LayerProof { + proof: Merk( + // L6 byBrand merk-tree — 100 targets + binary-tree glue + // (192 merk ops total; structurally a fully-resolved in-order + // traversal of all 100 brand entries in the byBrand merk tree) + 0: Push(KVValueHashFeatureTypeWithChildHash(brand_000, CountTree(636f6c6f72, 1000, flags: [0, 0, 0]), HASH[90ff6f6d9a3d901195982128130677243bfd27b75736206f3c8400966ef0d37b], BasicMerkNode, HASH[19b58883c492e746861db1e6ad07529a5a91cc8330af522682486db9346d6875])) + 1: Push(KVValueHashFeatureTypeWithChildHash(brand_001, CountTree(636f6c6f72, 1000, flags: [0, 0, 0]), HASH[484ca11fb4ec8f479be1f78af903ce0c9d4fe630517579fb0172c2576d6b9652], BasicMerkNode, HASH[0bf12023f8e067c12db4cec1583909a0283878d6d909c76196736299750b5879])) + 2: Parent + 3: Push(KVValueHashFeatureTypeWithChildHash(brand_002, CountTree(636f6c6f72, 1000, flags: [0, 0, 0]), HASH[4c19f047068654e71813dce7839a579edfdcb446e3d70efa1b8592c73259da16], BasicMerkNode, HASH[e8d5372904b7f4ac9334aeb4ddab619d9ad7a308732a4f231416e10208a0a356])) + ... + // 97 more KVValueHashFeatureTypeWithChildHash targets following + // the same template — brand_003 ... brand_099 — interleaved with + // Parent/Child ops glueing them into the byBrand merk binary tree. + // Every target shares the structure: + // Push(KVValueHashFeatureTypeWithChildHash( + // brand_NNN, + // CountTree(636f6c6f72, 1000, flags: [0, 0, 0]), // count_value=1000 + // HASH[], + // BasicMerkNode, // NormalTree (no count on the merk node) + // HASH[] + // )) + ... + 189: Push(KVValueHashFeatureTypeWithChildHash(brand_097, CountTree(636f6c6f72, 1000, flags: [0, 0, 0]), HASH[92adee932cc12927cd76ad9fd25906bbfe547df2bf21e826845bb4d3b47f5314], BasicMerkNode, HASH[34b69e1e424aa023c74f61554db2823da6c19dcbc51bdd5dece32e3f6f9fd219])) + 190: Parent + 191: Push(KVValueHashFeatureTypeWithChildHash(brand_098, CountTree(636f6c6f72, 1000, flags: [0, 0, 0]), HASH[68e02fcf66f86797035fbc8d53290185fe3fed7de897a8654743cae4007c47c3], BasicMerkNode, HASH[acfc3a88b852e8895449b4c7e01f4b1cc25028e6a80e4915cdde578ff6eb029b])) + 192: Push(KVValueHashFeatureTypeWithChildHash(brand_099, CountTree(636f6c6f72, 1000, flags: [0, 0, 0]), HASH[af9667a8f2a10a9402b3d1fb0ac6e0b64d1e3dde5b8829c03b8d2c9cfc94e16d], BasicMerkNode, HASH[d049fe7e250b7dd763a4a5daa4227dcd2e41733dd95fd0758641ac06c63c3b51])) + // + closing Parent/Child ops binding the last few entries + ) + } + } + } + } + } + } + } +} +``` + +The 254-line full verbatim sits in the bench's `[gproof] G6` output — same template (one `KVValueHashFeatureTypeWithChildHash` per brand, all with `CountTree count=1000` and `BasicMerkNode` feature) repeating 100 times. The schematic above shows the first 3 and last 3 targets so the structural pattern is clear without reproducing 100 near-identical lines. + +**Key observation:** `BasicMerkNode` (not `ProvableCountedMerkNode`) is the feature type on each L6 op. byBrand is a `NormalTree`, so its merk binary tree's internal nodes don't carry running counts — only the per-brand `CountTree count=1000` values stored *inside* each brand's element matter. Contrast this with G6's `byColor` cousin (`group_by_color_in_proof_100_rangecountable_branches`, 10 512 B): there the L6 targets would carry `ProvableCountedMerkNode(...)` features because byColor IS a `ProvableCountTree`. The ~5 % size difference is exactly those count fields × 100 nodes. + +
+ +```mermaid +flowchart TB + WD["@/contract_id/0x01/widget"]:::tree + WD ==> BR["brand: NormalTree (100 entries)"]:::path + BR ==> B000["brand_000: CountTree count=1000"]:::target + BR ==> B001["brand_001: CountTree count=1000"]:::target + BR ==> BMore["... 96 more in-range targets
(brand_002 ... brand_097)"]:::target + BR ==> B098["brand_098: CountTree count=1000"]:::target + BR ==> B099["brand_099: CountTree count=1000"]:::target + + SDK["Entries(100 groups, sum=100 000):
("brand_000", 1000),
("brand_001", 1000),
...
("brand_099", 1000)"]:::sdk + B000 -.-> SDK + B099 -.-> SDK + + classDef tree fill:#21262d,color:#c9d1d9,stroke:#1f6feb,stroke-width:2px; + classDef path fill:#6e7681,color:#fff,stroke:#1f6feb,stroke-width:2px; + classDef target fill:#39c5cf,color:#0d1117,stroke:#39c5cf,stroke-width:3px; + classDef sdk fill:#21262d,color:#39c5cf,stroke:#39c5cf,stroke-width:2px,stroke-dasharray: 4 2; + + linkStyle 0 stroke:#1f6feb,stroke-width:3px; + linkStyle 1 stroke:#1f6feb,stroke-width:3px; + linkStyle 2 stroke:#1f6feb,stroke-width:3px; + linkStyle 3 stroke:#1f6feb,stroke-width:3px; + linkStyle 4 stroke:#1f6feb,stroke-width:3px; + linkStyle 5 stroke:#1f6feb,stroke-width:3px; +``` + +### Diagram: per-layer merk-tree structure (Layer 5+) + +Identical to [G1's L5–L6 shape](#g1--in-on-bybrand-grouped-by-brand), just with all 100 entries in the byBrand merk tree resolved as visible targets rather than just two. The byBrand binary tree has all 100 keys exposed — no opaque sibling subtrees (`Hash` ops) at all, only `KVValueHashFeatureTypeWithChildHash` (full reveal) plus `Parent` / `Child` glue. + +```mermaid +flowchart TB + subgraph L5["Layer 5 — widget doctype merk-tree"] + direction TB + L5_q["brand (queried)
kv_hash=HASH[68b6...]"]:::queried + L5_left["HASH[9862...]"]:::sibling + L5_right["HASH[6c36...]"]:::sibling + L5_q --> L5_left + L5_q --> L5_right + end + + subgraph L6["Layer 6 — byBrand merk-tree (ALL 100 targets fully resolved)"] + direction TB + L6_t0["brand_000
CountTree count=1000
BasicMerkNode"]:::target + L6_t1["brand_001
CountTree count=1000"]:::target + L6_tmid["... 97 more KVValueHashFeatureTypeWithChildHash
targets, each CountTree count=1000
(192 merk ops total: 100 Push + 92 Parent/Child)"]:::target + L6_t99["brand_099
CountTree count=1000"]:::target + + L6_t0 --> L6_t1 + L6_t1 --> L6_tmid + L6_tmid --> L6_t99 + end + + L5_q -. "Tree(merk_root[byBrand])" .-> L6_t0 + + classDef queried fill:#1f6feb,color:#fff,stroke:#1f6feb,stroke-width:2px; + classDef sibling fill:#6e7681,color:#fff,stroke:#6e7681; + classDef target fill:#39c5cf,color:#0d1117,stroke:#39c5cf,stroke-width:3px; +``` + +Because the In set covers *every* brand in the fixture, the proof has zero opaque-sibling subtree commitments at L6 — every binary-tree node is revealed as a `KVValueHashFeatureTypeWithChildHash` target. That's the most efficient byte-per-key shape `GroupByIn` can hit: at `|IN| = B` (where `B` is the total entries in the property tree), the proof bytes ≈ `B × (kv-hash + count + child-hash + glue)` ≈ `B × 100 B`. For `B = 100`, that's exactly the 10 038 B we observe. + +By contrast, smaller In sets (G1's `|IN| = 2`) pay the boundary-proof tax: the byBrand merk tree has ~98 unresolved entries, each contributing one `KVHash` (opaque-key commitment, ~33 B) or `Hash` (opaque-subtree commitment, ~33 B). The asymptotic crossover at which "reveal everything" becomes cheaper than "reveal-some-and-commit-the-rest" depends on the ratio of `|IN|` to `B` — for byBrand with `B = 100`, the crossover is around `|IN| ≈ 50`. + +## G7 — Carrier `In` + Range, Grouped By `brand` + +```text +select = COUNT +where = brand IN ["brand_000", "brand_001"] AND color > "color_00000500" +group_by = [brand] +prove = true +``` + +**Path query** (carrier `AggregateCountOnRange` — outer Keys per In value, ACOR subquery over each brand's color subtree): + +```text +path: ["@", contract_id, 0x01, "widget", "brand"] +outer query items: [Key("brand_000"), Key("brand_001")] +subquery_path: ["color"] +subquery items: [AggregateCountOnRange([RangeAfter("color_00000500"..)])] +``` + +**Verified payload** (verifier returns one `(in_key, u64)` per resolved In branch via `GroveDb::verify_aggregate_count_query_per_key`): + +```text +[("brand_000", 499), ("brand_001", 499)] +``` + +Each brand has all 1 000 colors in its byBrandColor terminator; the strict `>` cut at `color_00000500` leaves `color_00000501..color_00000999` = 499 in-range colors per brand. Total `sum = 998` documents. + +**Proof size:** 4 332 B. **Mode:** `CountMode::GroupByIn` routed to `DocumentCountMode::RangeAggregateCarrierProof` (the new dispatcher arm wired up against [grovedb PR #663](https://github.com/dashpay/grovedb/pull/663)). + +This is the natural answer to "give me a per-brand aggregate count over a colour range" — same per-In-aggregate semantics as the no-proof per-In fan-out, just verifiable in a single proof. Strictly smaller and asymptotically better than the alternative two-field shape [G5](#g5--compound-in--range-grouped-by-brand-color): + +- **G5** (compound distinct walk, `group_by = [brand, color]`): `O(k · R' · log C')` bytes; emits one `KVValueHashFeatureTypeWithChildHash` per resolved `(brand, color)` pair → 11 554 B for `k=2, R'≈50`. Carries per-pair granularity the caller may not want. +- **G7** (carrier aggregate, `group_by = [brand]`): `O(k · (log B + log C'))` bytes; emits one `HashWithCount`/`KVDigestCount` ACOR boundary walk per brand → 4 332 B for `k=2, log C'≈10`. **~2.7× smaller** than G5 for the same input data, at the cost of losing per-color resolution (which the `group_by = [brand]` caller didn't ask for anyway). + +The win vs Q8 (`brand == X AND color > floor`, the same shape with `k=1` and `group_by = []`) is asymptotic: Q8 is 2 656 B, G7 is 4 332 B for `k=2`. The slope `(G7 − Q8) / 1 = +1 676 B per additional In branch` matches what you'd expect: each brand adds its own L6 commit + its own L7 + L8 ACOR boundary walk (≈ Q8's L7 + L8 ≈ ~1 700 B), with the L1–L5 prefix amortising once across all branches. + +**Proof display:** + +
+Expand to see the structured proof (8 layers — same skeleton as G5, but each brand's L8 is an ACOR boundary walk instead of a 50-target distinct-walk) — or open interactively in the visualizer ↗ + +```text +GroveDBProofV1 { + LayerProof { + proof: Merk(... root-level descent, identical to every other chapter query ...) + lower_layers: { + @ => { ... contract_id descent ... } + // L2..L4 byte-identical to G3 / G5 (the @/contract_id/0x01/widget chain) + } + } + // L5 widget doctype: brand queried (same as G3 / G5 — opaque siblings 9862 / 6c36) + // L6 byBrand merk-tree: two KVValueHash targets (brand_000 + brand_001), 25 ops + // — same shape as G5's L6 + // L7a brand_000's value tree: single key `color` with NonCounted(ProvableCountTree) + // L8a byBrandColor color subtree under brand_000: + // proof: Merk( + // ... 36-37 ACOR boundary ops over color > color_00000500 ... + // 18: Push(KVDigestCount(color_00000500, ..., 1)) // BOUNDARY (excluded) + // 19..35: HashWithCount / KVDigestCount boundary walk + // — same shape as Q8's L8, summing to count=499 for brand_000) + // end L8a + // end L7a + // L7b brand_001's value tree: same single-key shape, different hashes + // L8b byBrandColor color subtree under brand_001: + // proof: Merk( + // ... 36-37 ACOR boundary ops over color > color_00000500 ... + // — same shape, different hashes, summing to count=499 for brand_001) + // end L8b + // end L7b +} +``` + +The 186-line full verbatim is available via the bench's `[gproof] G7` output. The schematic compresses the L1–L4 doctype prefix (byte-identical to every other 8-layer chapter query) and the two parallel L7+L8 descents (structurally identical to Q8's, with different hashes for each brand). Each brand's L8 contributes ~1 700 B of ACOR boundary commitments — exactly the predicted `Q8 - L1..L5` overhead per branch. + +**Cryptographic guarantee** (via [grovedb PR #663](https://github.com/dashpay/grovedb/pull/663)): every per-brand count is independently committed to the merk root via `node_hash_with_count`. A malicious prover can't lie about brand_000's count without breaking brand_001's verification (and vice versa) because each carrier ACOR subquery has its own hash chain back to the merk root. + +
+ +```mermaid +flowchart TB + WD["@/contract_id/0x01/widget"]:::tree + WD ==> BR["brand: NormalTree"]:::path + BR ==> B000["brand_000: CountTree count=1000"]:::path + BR ==> B001["brand_001: CountTree count=1000"]:::path + B000 ==> B000_C["brand_000/color: NonCounted(ProvableCountTree)
ACOR boundary walk (color > color_00000500)"]:::target + B001 ==> B001_C["brand_001/color: NonCounted(ProvableCountTree)
ACOR boundary walk (color > color_00000500)"]:::target + + SDK["Entries(2 groups, sum=998):
("brand_000", 499)
("brand_001", 499)"]:::sdk + B000_C -.-> SDK + B001_C -.-> SDK + + classDef tree fill:#21262d,color:#c9d1d9,stroke:#1f6feb,stroke-width:2px; + classDef path fill:#6e7681,color:#fff,stroke:#1f6feb,stroke-width:2px; + classDef target fill:#39c5cf,color:#0d1117,stroke:#39c5cf,stroke-width:3px; + classDef sdk fill:#21262d,color:#39c5cf,stroke:#39c5cf,stroke-width:2px,stroke-dasharray: 4 2; + + linkStyle 0 stroke:#1f6feb,stroke-width:3px; + linkStyle 1 stroke:#1f6feb,stroke-width:3px; + linkStyle 2 stroke:#1f6feb,stroke-width:3px; + linkStyle 3 stroke:#1f6feb,stroke-width:3px; + linkStyle 4 stroke:#1f6feb,stroke-width:3px; +``` + +### Diagram: per-layer merk-tree structure (Layer 5+) + +L5–L7 are exactly [G5's](#diagram-per-layer-merk-tree-structure-layer-5-4) L5–L7 (widget → byBrand → brand_X's continuation). The difference is at L8: G5 enumerates 50 distinct `(brand_X, color_Y)` pairs as `KVValueHashFeatureTypeWithChildHash` targets per brand; G7 walks the same color subtree as an ACOR boundary cut (like [Q8](./count-index-examples.md#query-8--compound-equal-plus-range-bybrandcolor)'s L8), emitting `HashWithCount` / `KVDigestCount` ops that commit a single aggregate u64 per brand. + +```mermaid +flowchart TB + subgraph L5["Layer 5 — widget doctype merk-tree"] + direction TB + L5_q["brand (queried)
kv_hash=HASH[68b6...]"]:::queried + end + + subgraph L6["Layer 6 — byBrand merk-tree (two intermediate targets)"] + direction TB + L6_t0["brand_000 (queried)
CountTree count=1000"]:::queried + L6_t1["brand_001 (queried)
CountTree count=1000"]:::queried + end + + subgraph L7a["Layer 7a — brand_000's continuation"] + direction TB + L7a_q["color (queried)
NonCounted(ProvableCountTree)"]:::queried + end + subgraph L7b["Layer 7b — brand_001's continuation"] + direction TB + L7b_q["color (queried)
NonCounted(ProvableCountTree)"]:::queried + end + + subgraph L8a["Layer 8a — brand_000's byBrandColor: ACOR cut"] + direction TB + L8a_target["Aggregate count = 499
(committed via node_hash_with_count)"]:::target + L8a_ops["~37 merk ops:
KVDigestCount(color_00000500, …) — boundary excluded
+ HashWithCount/KVDigestCount boundary walk
over the in-range portion"]:::sibling + L8a_target --> L8a_ops + end + subgraph L8b["Layer 8b — brand_001's byBrandColor: ACOR cut"] + direction TB + L8b_target["Aggregate count = 499
(committed via node_hash_with_count)"]:::target + L8b_ops["~37 merk ops:
same boundary shape as L8a
(different hashes — different brand subtree)"]:::sibling + L8b_target --> L8b_ops + end + + L5_q -. "byBrand" .-> L6_t0 + L5_q -. "byBrand" .-> L6_t1 + L6_t0 -. "continuation" .-> L7a_q + L6_t1 -. "continuation" .-> L7b_q + L7a_q -. "carrier ACOR subquery" .-> L8a_target + L7b_q -. "carrier ACOR subquery" .-> L8b_target + + classDef queried fill:#1f6feb,color:#fff,stroke:#1f6feb,stroke-width:2px; + classDef sibling fill:#6e7681,color:#fff,stroke:#6e7681; + classDef target fill:#39c5cf,color:#0d1117,stroke:#39c5cf,stroke-width:3px; +``` + +The "carrier" name comes from grovedb's PR #663 terminology: a *carrier* query is the outer multi-key query that carries an ACOR subquery into each branch. The ACOR primitive itself is unchanged — it still walks one range over one subtree per invocation — but it can now appear as a subquery item under outer `Keys`, which is what enables the per-brand aggregate proof shape G7 needs. + +## G8 — Carrier outer Range + Range, Grouped By `brand` + +```text +select = COUNT +where = brand > "brand_050" AND color > "color_00000500" +group_by = [brand] +limit = (optional; ≤ 10) +prove = true +``` + +The platform's `MAX_CARRIER_AGGREGATE_OUTER_RANGE_LIMIT = 10` is both the default (when the caller passes no `limit`) and a hard ceiling. Callers may pass a smaller `limit` (1 through 9) to truncate the outer walk further; passing 0 or any value > 10 is rejected with `InvalidLimit`. See [the rationale below](#why-the-cap-exists-and-where-the-ceiling-lives). + +**Path query** (the same carrier-ACOR shape as G7, but with a *range* outer dimension and `SizedQuery::limit` bounded by the platform max): + +```text +path: ["@", contract_id, 0x01, "widget", "brand"] +outer query item: RangeAfter("brand_050"..) +subquery_path: ["color"] +subquery items: [AggregateCountOnRange([RangeAfter("color_00000500"..)])] +SizedQuery::limit: 10 (platform default; caller may request smaller) +``` + +**Verified payload** (verifier returns one `(in_key, u64)` per in-range outer key, capped at `limit`, via `GroveDb::verify_aggregate_count_query_per_key`): + +```text +[("brand_051", 499), ("brand_052", 499), …, ("brand_060", 499)] +``` + +The bench's 100-brand fixture has 49 brands `> "brand_050"`. The platform's default `SizedQuery::limit = 10` caps the carrier at the first 10 (`brand_051` … `brand_060`); each carries the per-brand ACOR count of 499 in-range colors (`color_00000501` … `color_00000999`). Total `sum = 10 × 499 = 4 990` documents. + +**Proof size:** 18 022 B. **Mode:** `CountMode::GroupByRange` routed to `DocumentCountMode::RangeAggregateCarrierProof` (the dispatcher distinguishes G7's In-outer shape from G8's Range-outer shape by the carrier clause's operator). + +G8 is G7's natural extension from "k specific outer keys" to "L outer keys from an in-range walk." Same carrier proof primitive, same `node_hash_with_count` commitments per branch, same one-`u64`-per-branch return shape. The structural differences are exactly two: + +- **Outer dimension**: G7 emits `k` `Key(serialized_in_value)` items in the carrier query; G8 emits a single `RangeAfter(serialized_floor..)` (or any `Range*` variant) and lets grovedb walk it. +- **Limit**: G8 sets `SizedQuery::limit = Some(L)` where `L` is the smaller of the caller's request and the platform max. Per [grovedb PR #664](https://github.com/dashpay/grovedb/pull/664), this is the load-bearing relaxation — the predecessor PR #663 allowed Range outer items at the validator level but kept the leaf-ACOR rule rejecting `SizedQuery::limit`, which made unbounded range-outer carriers impractical at any reasonable dataset size (49 brands × ~1 700 B each ≈ 83 KB; with the platform default of 10 we land at 18 KB). + +### Why the cap exists and where the ceiling lives + +The cap bounds the prove-path proof size; the *ceiling* is a hardcoded compile-time constant for prover/verifier-agreement reasons. + +1. **Proof-size bounding.** Proof bytes scale linearly with the limit (~1 700 B per outer match, exactly as for [G7](#g7--carrier-in--range-grouped-by-brand)). 10 keeps the worst-case proof under 20 KB (Tier-1 for the visualizer's shareable-link guidance) — enough for typical "top-N brands by an outer range" queries while avoiding pathological proof sizes. Callers that want a window above 10 entries call repeatedly with disjoint outer-range bounds; callers that want fewer pass a smaller `limit` (1 through 9). Limit 0 is rejected to keep the response shape non-trivial. +2. **Prover/verifier byte-for-byte agreement.** `SizedQuery::limit` is part of the serialized `PathQuery` and feeds the merk-root reconstruction; both prover and verifier must agree on its value. The caller's request carries `limit` over the wire, so its specific value (1..=10) is fine to vary. What can't vary is the platform's *default* when the caller passes nothing — that's why the ceiling is a hardcoded compile-time constant (`MAX_CARRIER_AGGREGATE_OUTER_RANGE_LIMIT`) rather than an operator-tunable runtime value. Same rationale as `RangeDistinctProof`'s use of `crate::config::DEFAULT_QUERY_LIMIT` rather than `drive_config.default_query_limit`. + +Caller semantics summary: + +| Caller `request.limit` | Server uses | Reason | +|---|---|---| +| `None` | 10 (the platform default) | Default = ceiling | +| `Some(1..=10)` | the caller's value | Truncates the walk further | +| `Some(0)` | rejected | Non-trivial response required | +| `Some(11+)` | rejected | Above the ceiling | + +Complexity: **O(L · (log B + log C'))** where `L = min(caller_limit, MAX_CARRIER_AGGREGATE_OUTER_RANGE_LIMIT)` — `L` outer-key descents in the byBrand layer + `L` leaf-ACOR boundary walks in each brand's color subtree. Independent of how many keys the outer range *could* have walked without the cap. + +**Proof display:** + +
+Expand to see the structured proof (8 layers — same skeleton as G7, but L8 contains 10 per-brand ACOR boundary walks instead of 2) — or open interactively in the visualizer ↗ + +```text +GroveDBProofV1 { + LayerProof { + proof: Merk(... root-level descent, identical to every other chapter query ...) + lower_layers: { + @ => { ... contract_id descent ... } + // L2..L4 byte-identical to G3 / G5 / G7 (the @/contract_id/0x01/widget chain) + } + } + // L5 widget doctype: brand queried (same as G3 / G5 / G7) + // L6 byBrand merk-tree: 10 outer-key matches inlined as KVValueHash items + // (brand_051 ... brand_060), each descending into its + // continuation. Boundary commitments cover the + // brands_outside_the_limited_window. + // L7 brand_NNN's value tree: single key `color` with NonCounted(ProvableCountTree) + // — repeated 10 times, once per resolved outer brand + // L8 brand_NNN's byBrandColor color subtree: + // proof: Merk( + // ... 36-37 ACOR boundary ops over color > color_00000500, + // summing to count = 499 per brand ... + // ) + // — repeated 10 times in parallel, each with its own per-brand boundary hashes +} +``` + +The 618-line full verbatim is available via the bench's `[gproof] G8` output. The schematic compresses the 10 parallel L7+L8 descents — they share the same template (single-key continuation + 37-op ACOR boundary walk), differing only in per-brand kv-hashes and the resulting subtree commits. Each per-brand L8 contributes ~1 700 B of ACOR boundary commitments — exactly the predicted `Q8 - L1..L5` overhead per outer match, scaling linearly: `18 022 B ≈ shared upper layers + 10 × ~1 700 B ≈ 18 KB` (matches the per-In slope from G7 vs Q8). + +**Cryptographic guarantee** (via grovedb PR #663 + PR #664): every per-brand count is independently committed to the merk root via `node_hash_with_count`. The `SizedQuery::limit` is part of the serialized PathQuery and is part of the merk-root reconstruction the verifier performs — a malicious prover can't truncate the outer walk at a different point without breaking the hash chain. + +
+ +```mermaid +flowchart TB + WD["@/contract_id/0x01/widget"]:::tree + WD ==> BR["brand: NormalTree"]:::path + BR ==> B051["brand_051: CountTree count=1000"]:::path + BR ==> BMore["… 8 more in-range brands (brand_052 … brand_059) …"]:::path + BR ==> B060["brand_060: CountTree count=1000"]:::path + BR -.-> BCapped["brand_061 … brand_099
(beyond platform cap — opaque subtree commitments)"]:::faded + BR -.-> BBelow["brand_000 … brand_050
(below range floor — boundary commitments)"]:::faded + + B051 ==> B051_C["brand_051/color: NonCounted(ProvableCountTree)
ACOR boundary walk (color > color_00000500)"]:::target + BMore ==> BMore_C["8 parallel ACOR walks"]:::target + B060 ==> B060_C["brand_060/color: NonCounted(ProvableCountTree)
ACOR boundary walk (color > color_00000500)"]:::target + + SDK["Entries(10 groups, sum=4 990):
("brand_051", 499)
("brand_052", 499)

("brand_060", 499)"]:::sdk + B051_C -.-> SDK + BMore_C -.-> SDK + B060_C -.-> SDK + + classDef tree fill:#21262d,color:#c9d1d9,stroke:#1f6feb,stroke-width:2px; + classDef path fill:#6e7681,color:#fff,stroke:#1f6feb,stroke-width:2px; + classDef faded fill:#21262d,color:#6e7681,stroke:#484f58; + classDef target fill:#39c5cf,color:#0d1117,stroke:#39c5cf,stroke-width:3px; + classDef sdk fill:#21262d,color:#39c5cf,stroke:#39c5cf,stroke-width:2px,stroke-dasharray: 4 2; + + linkStyle 0 stroke:#1f6feb,stroke-width:3px; + linkStyle 1 stroke:#1f6feb,stroke-width:3px; + linkStyle 2 stroke:#1f6feb,stroke-width:3px; + linkStyle 3 stroke:#1f6feb,stroke-width:3px; + linkStyle 6 stroke:#1f6feb,stroke-width:3px; + linkStyle 7 stroke:#1f6feb,stroke-width:3px; + linkStyle 8 stroke:#1f6feb,stroke-width:3px; +``` + +### Diagram: per-layer merk-tree structure (Layer 5+) + +L5 is identical to G7's L5 (widget doctype with `brand` queried). L6 differs: G7 inlined 2 `KVValueHash` targets for the In-bearing brands; G8 inlines 10 KVValueHash targets for the in-range brands the carrier walks (`brand_051` through `brand_060`), with boundary commitments covering both the below-floor and beyond-cap portions of the byBrand merk tree. L7 + L8 fork into 10 parallel descents, each shaped exactly like G7's L7 + L8 — same `NonCounted(ProvableCountTree)` continuation, same 37-op ACOR boundary walk over `color > color_00000500`. + +```mermaid +flowchart TB + subgraph L5["Layer 5 — widget doctype merk-tree"] + direction TB + L5_q["brand (queried)
kv_hash=HASH[68b6...]"]:::queried + end + + subgraph L6["Layer 6 — byBrand merk-tree (10 outer-range targets)"] + direction TB + L6_t051["brand_051
CountTree count=1000"]:::queried + L6_tmid["… 8 more in-range targets …
(brand_052 … brand_059)"]:::queried + L6_t060["brand_060
CountTree count=1000"]:::queried + L6_capped["Beyond-cap commitments:
brand_061 … brand_099
(opaque KVHash / Hash ops)"]:::sibling + L6_floor["Below-floor commitments:
brand_000 … brand_050
(opaque)"]:::sibling + + L6_t051 --> L6_tmid + L6_tmid --> L6_t070 + L6_t070 --> L6_capped + L6_t051 --> L6_floor + end + + subgraph L7L8["Layers 7+8 — per-brand continuation + ACOR walk (×10)"] + direction TB + L7L8_each["For each of brand_051 … brand_060:
L7: single-key `color` continuation (NonCounted(ProvableCountTree))
L8: 37 merk ops — ACOR boundary walk for color > color_00000500
committing one `u64 = 499` per brand"]:::target + end + + L5_q -. "byBrand" .-> L6_t051 + L6_t051 -. "continuation × 20" .-> L7L8_each + + classDef queried fill:#1f6feb,color:#fff,stroke:#1f6feb,stroke-width:2px; + classDef sibling fill:#6e7681,color:#fff,stroke:#6e7681; + classDef target fill:#39c5cf,color:#0d1117,stroke:#39c5cf,stroke-width:3px; +``` + +The slope vs G7 is the proof's whole story: G7's `k = 2` outer matches → ~4 KB; G8's `L = 10` outer matches → ~18 KB. The per-outer-match cost (~1 700 B) is the same; only the outer-walk count changes. The platform max of 10 keeps the worst-case proof under 20 KB (Tier-1 of the visualizer's shareable-link guidance); larger windows are unreachable without changing the constant — callers that want more results call repeatedly with disjoint outer-range windows. + +## Future Work + +This chapter now mirrors chapter 29's per-query structure: every section above carries a path query, verified payload, proof size, verbatim or schematic proof display, narrative, conceptual flowchart, and per-layer merk-tree diagram. + +Two pieces of infrastructure made this possible: + +- `query_g1_*` … `query_g6_*` criterion `bench_function` calls in [`document_count_worst_case.rs`](https://github.com/dashpay/platform/blob/v3.1-dev/packages/rs-drive/benches/document_count_worst_case.rs) — produce the **Avg time** column in [Queries in this Chapter](#queries-in-this-chapter). +- `display_group_by_proofs` (a sibling of `display_proofs` in the same bench file) — emits each `group_by` shape's verbatim merk-proof structure via bincode decode + `GroveDBProof::Display`. Tagged with `[gproof]` prefix in stderr so reviewers can grep deterministically. + +Open follow-ups: + +1. **Inline the full G4 / G5 / G6 verbatim** rather than the schematic-with-elision form. The bench captures every byte; the chapter's `
` blocks currently summarise the 100-target enumerations because reproducing 100 near-identical `KVValueHashFeatureTypeWithChildHash` lines per case is more noise than signal. If a reader needs byte-exact output, they can run the bench and grep `[gproof]`. +2. **Wire path-query reconstruction + verified-payload printing into `display_group_by_proofs`**. Today it only dumps the proof-display block; chapter 29's `display_proofs` also reconstructs the `PathQuery` and prints the verifier's structured result (the `verified:` block). Adding that to the group_by side would give the chapter parity with chapter 29's `verified:` sections — currently rendered manually from the `[matrix]` output's `Entries(len=N, sum=M)` figures. +3. **A high-fanout byColor variant of G6** (`color IN [100 values]`, `group_by = [color]`) — captured implicitly in the bench's existing `group_by_color_in_proof_100_rangecountable_branches` (10 512 B) but not given its own G* section, since it's structurally G6 with `ProvableCountTree` overhead. + +## Cross-Reference to Chapter 29 + +For background on the building blocks every query in this chapter uses: + +- [Document Count Trees](./document-count-trees.md) — `CountTree` / `ProvableCountTree` / `NormalTree` mechanics. +- [Count Index Examples § How To Read The Proofs](./count-index-examples.md#how-to-read-the-proofs) — the four-section per-query template plus the `LayerProof` / `Merk` / `Push` / `Parent` / `Child` op grammar. +- [Count Index Examples § Worked Example: How `node_hash_with_count` Rebuilds the Merk Root](./count-index-examples.md#worked-example-how-node_hash_with_count-rebuilds-the-merk-root) — exact Blake3 formulas underpinning every count proof in either chapter. + +The path-query builder (`packages/rs-drive/src/query/drive_document_count_query/path_query.rs`) and verifier mirror (`packages/rs-drive/src/verify/document_count/`) live in the same modules for both chapters' queries — the only difference is which `point_lookup_*` / `aggregate_*` / `group_by_*` function the dispatcher calls based on the `CountMode` carried in the request. diff --git a/packages/dapi-grpc/build.rs b/packages/dapi-grpc/build.rs index 8d6988113bb..f0412b06165 100644 --- a/packages/dapi-grpc/build.rs +++ b/packages/dapi-grpc/build.rs @@ -84,12 +84,11 @@ 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; 57] = [ + const VERSIONED_REQUESTS: [&str; 56] = [ "GetDataContractHistoryRequest", "GetDataContractRequest", "GetDataContractsRequest", "GetDocumentsRequest", - "GetDocumentsCountRequest", "GetIdentitiesByPublicKeyHashesRequest", "GetIdentitiesRequest", "GetIdentitiesBalancesRequest", @@ -162,12 +161,11 @@ fn configure_platform(mut platform: MappingConfig) -> MappingConfig { // - "GetIdentityByNonUniquePublicKeyHashResponse" // // "GetEvonodesProposedEpochBlocksResponse" is used for 2 Requests - const VERSIONED_RESPONSES: [&str; 55] = [ + const VERSIONED_RESPONSES: [&str; 54] = [ "GetDataContractHistoryResponse", "GetDataContractResponse", "GetDataContractsResponse", "GetDocumentsResponse", - "GetDocumentsCountResponse", "GetIdentitiesByPublicKeyHashesResponse", "GetIdentitiesResponse", "GetIdentitiesBalancesResponse", @@ -237,8 +235,24 @@ fn configure_platform(mut platform: MappingConfig) -> MappingConfig { check_unique(&MERK_PROOF_VERSIONED_REQUESTS).expect("MERK_PROOF_VERSIONED_REQUESTS"); check_unique(&MERK_PROOF_VERSIONED_RESPONSES).expect("MERK_PROOF_VERSIONED_RESPONSES"); + // Messages whose latest version is v1 — the macro needs to know + // to generate match arms for both V0 and V1. Listed separately + // so the default `grpc_versions(0)` loop below skips them. + // + // Adding a message here is the proto-side companion of: + // - Adding a `GetXxxRequestV1` / `GetXxxResponseV1` to the + // oneof in `platform.proto`. + // - Bumping the matching `FeatureVersionBounds.max_version` + // to 1 in `rs-platform-version`. + // - Implementing the v1 dispatch arm in `drive-abci`. + const VERSIONED_AT_V1_REQUESTS: [&str; 1] = ["GetDocumentsRequest"]; + const VERSIONED_AT_V1_RESPONSES: [&str; 1] = ["GetDocumentsResponse"]; + // Derive VersionedGrpcMessage on requests for msg in VERSIONED_REQUESTS { + if VERSIONED_AT_V1_REQUESTS.contains(&msg) { + continue; + } platform = platform .message_attribute( msg, @@ -246,6 +260,14 @@ fn configure_platform(mut platform: MappingConfig) -> MappingConfig { ) .message_attribute(msg, r#"#[grpc_versions(0)]"#); } + for msg in VERSIONED_AT_V1_REQUESTS { + platform = platform + .message_attribute( + msg, + r#"#[derive(::dash_platform_macros::VersionedGrpcMessage)]"#, + ) + .message_attribute(msg, r#"#[grpc_versions(1)]"#); + } // Derive ProofOnlyVersionedGrpcMessage on requests for msg in PROOF_ONLY_VERSIONED_REQUESTS { @@ -259,6 +281,9 @@ fn configure_platform(mut platform: MappingConfig) -> MappingConfig { // Derive VersionedGrpcMessage and VersionedGrpcResponse on responses for msg in VERSIONED_RESPONSES { + if VERSIONED_AT_V1_RESPONSES.contains(&msg) { + continue; + } platform = platform .message_attribute( msg, @@ -266,6 +291,14 @@ fn configure_platform(mut platform: MappingConfig) -> MappingConfig { ) .message_attribute(msg, r#"#[grpc_versions(0)]"#); } + for msg in VERSIONED_AT_V1_RESPONSES { + platform = platform + .message_attribute( + msg, + r#"#[derive(::dash_platform_macros::VersionedGrpcMessage,::dash_platform_macros::VersionedGrpcResponse)]"#, + ) + .message_attribute(msg, r#"#[grpc_versions(1)]"#); + } // Derive VersionedGrpcMessage and ProofOnlyVersionedGrpcResponse on responses for msg in PROOF_ONLY_VERSIONED_RESPONSES { 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 a17520e22d7..711943624a4 100644 --- a/packages/dapi-grpc/clients/drive/v0/nodejs/drive_pbjs.js +++ b/packages/dapi-grpc/clients/drive/v0/nodejs/drive_pbjs.js @@ -1089,39 +1089,6 @@ $root.org = (function() { * @variation 2 */ - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getDocumentsCount}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getDocumentsCountCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetDocumentsCountResponse} [response] GetDocumentsCountResponse - */ - - /** - * Calls getDocumentsCount. - * @function getDocumentsCount - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetDocumentsCountRequest} request GetDocumentsCountRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getDocumentsCountCallback} callback Node-style callback called with the error, if any, and GetDocumentsCountResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getDocumentsCount = function getDocumentsCount(request, callback) { - return this.rpcCall(getDocumentsCount, $root.org.dash.platform.dapi.v0.GetDocumentsCountRequest, $root.org.dash.platform.dapi.v0.GetDocumentsCountResponse, request, callback); - }, "name", { value: "getDocumentsCount" }); - - /** - * Calls getDocumentsCount. - * @function getDocumentsCount - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetDocumentsCountRequest} request GetDocumentsCountRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - /** * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getIdentityByPublicKeyHash}. * @memberof org.dash.platform.dapi.v0.Platform @@ -19888,6 +19855,7 @@ $root.org = (function() { * @memberof org.dash.platform.dapi.v0 * @interface IGetDocumentsRequest * @property {org.dash.platform.dapi.v0.GetDocumentsRequest.IGetDocumentsRequestV0|null} [v0] GetDocumentsRequest v0 + * @property {org.dash.platform.dapi.v0.GetDocumentsRequest.IGetDocumentsRequestV1|null} [v1] GetDocumentsRequest v1 */ /** @@ -19913,17 +19881,25 @@ $root.org = (function() { */ GetDocumentsRequest.prototype.v0 = null; + /** + * GetDocumentsRequest v1. + * @member {org.dash.platform.dapi.v0.GetDocumentsRequest.IGetDocumentsRequestV1|null|undefined} v1 + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest + * @instance + */ + GetDocumentsRequest.prototype.v1 = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; /** * GetDocumentsRequest version. - * @member {"v0"|undefined} version + * @member {"v0"|"v1"|undefined} version * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest * @instance */ Object.defineProperty(GetDocumentsRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), + get: $util.oneOfGetter($oneOfFields = ["v0", "v1"]), set: $util.oneOfSetter($oneOfFields) }); @@ -19953,6 +19929,8 @@ $root.org = (function() { writer = $Writer.create(); if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) $root.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.v1 != null && Object.hasOwnProperty.call(message, "v1")) + $root.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.encode(message.v1, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -19990,6 +19968,9 @@ $root.org = (function() { case 1: message.v0 = $root.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0.decode(reader, reader.uint32()); break; + case 2: + message.v1 = $root.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -20034,6 +20015,16 @@ $root.org = (function() { return "v0." + error; } } + if (message.v1 != null && message.hasOwnProperty("v1")) { + if (properties.version === 1) + return "version: multiple values"; + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.verify(message.v1); + if (error) + return "v1." + error; + } + } return null; }; @@ -20054,6 +20045,11 @@ $root.org = (function() { throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsRequest.v0: object expected"); message.v0 = $root.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0.fromObject(object.v0); } + if (object.v1 != null) { + if (typeof object.v1 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsRequest.v1: object expected"); + message.v1 = $root.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.fromObject(object.v1); + } return message; }; @@ -20075,6 +20071,11 @@ $root.org = (function() { if (options.oneofs) object.version = "v0"; } + if (message.v1 != null && message.hasOwnProperty("v1")) { + object.v1 = $root.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.toObject(message.v1, options); + if (options.oneofs) + object.version = "v1"; + } return object; }; @@ -20489,353 +20490,258 @@ $root.org = (function() { return GetDocumentsRequestV0; })(); - return GetDocumentsRequest; - })(); + GetDocumentsRequest.GetDocumentsRequestV1 = (function() { - v0.GetDocumentsResponse = (function() { + /** + * Properties of a GetDocumentsRequestV1. + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest + * @interface IGetDocumentsRequestV1 + * @property {Uint8Array|null} [dataContractId] GetDocumentsRequestV1 dataContractId + * @property {string|null} [documentType] GetDocumentsRequestV1 documentType + * @property {Uint8Array|null} [where] GetDocumentsRequestV1 where + * @property {Uint8Array|null} [orderBy] GetDocumentsRequestV1 orderBy + * @property {number|null} [limit] GetDocumentsRequestV1 limit + * @property {Uint8Array|null} [startAfter] GetDocumentsRequestV1 startAfter + * @property {Uint8Array|null} [startAt] GetDocumentsRequestV1 startAt + * @property {boolean|null} [prove] GetDocumentsRequestV1 prove + * @property {org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.Select|null} [select] GetDocumentsRequestV1 select + * @property {Array.|null} [groupBy] GetDocumentsRequestV1 groupBy + * @property {Uint8Array|null} [having] GetDocumentsRequestV1 having + */ + + /** + * Constructs a new GetDocumentsRequestV1. + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest + * @classdesc Represents a GetDocumentsRequestV1. + * @implements IGetDocumentsRequestV1 + * @constructor + * @param {org.dash.platform.dapi.v0.GetDocumentsRequest.IGetDocumentsRequestV1=} [properties] Properties to set + */ + function GetDocumentsRequestV1(properties) { + this.groupBy = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Properties of a GetDocumentsResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetDocumentsResponse - * @property {org.dash.platform.dapi.v0.GetDocumentsResponse.IGetDocumentsResponseV0|null} [v0] GetDocumentsResponse v0 - */ + /** + * GetDocumentsRequestV1 dataContractId. + * @member {Uint8Array} dataContractId + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1 + * @instance + */ + GetDocumentsRequestV1.prototype.dataContractId = $util.newBuffer([]); - /** - * Constructs a new GetDocumentsResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetDocumentsResponse. - * @implements IGetDocumentsResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetDocumentsResponse=} [properties] Properties to set - */ - function GetDocumentsResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * GetDocumentsRequestV1 documentType. + * @member {string} documentType + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1 + * @instance + */ + GetDocumentsRequestV1.prototype.documentType = ""; - /** - * GetDocumentsResponse v0. - * @member {org.dash.platform.dapi.v0.GetDocumentsResponse.IGetDocumentsResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse - * @instance - */ - GetDocumentsResponse.prototype.v0 = null; + /** + * GetDocumentsRequestV1 where. + * @member {Uint8Array} where + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1 + * @instance + */ + GetDocumentsRequestV1.prototype.where = $util.newBuffer([]); - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * GetDocumentsRequestV1 orderBy. + * @member {Uint8Array} orderBy + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1 + * @instance + */ + GetDocumentsRequestV1.prototype.orderBy = $util.newBuffer([]); - /** - * GetDocumentsResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse - * @instance - */ - Object.defineProperty(GetDocumentsResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); + /** + * GetDocumentsRequestV1 limit. + * @member {number} limit + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1 + * @instance + */ + GetDocumentsRequestV1.prototype.limit = 0; - /** - * Creates a new GetDocumentsResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetDocumentsResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse} GetDocumentsResponse instance - */ - GetDocumentsResponse.create = function create(properties) { - return new GetDocumentsResponse(properties); - }; + /** + * GetDocumentsRequestV1 startAfter. + * @member {Uint8Array} startAfter + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1 + * @instance + */ + GetDocumentsRequestV1.prototype.startAfter = $util.newBuffer([]); - /** - * Encodes the specified GetDocumentsResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetDocumentsResponse} message GetDocumentsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDocumentsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; + /** + * GetDocumentsRequestV1 startAt. + * @member {Uint8Array} startAt + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1 + * @instance + */ + GetDocumentsRequestV1.prototype.startAt = $util.newBuffer([]); - /** - * Encodes the specified GetDocumentsResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetDocumentsResponse} message GetDocumentsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDocumentsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * GetDocumentsRequestV1 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1 + * @instance + */ + GetDocumentsRequestV1.prototype.prove = false; - /** - * Decodes a GetDocumentsResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse} GetDocumentsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDocumentsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDocumentsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * GetDocumentsRequestV1 select. + * @member {org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.Select} select + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1 + * @instance + */ + GetDocumentsRequestV1.prototype.select = 0; - /** - * Decodes a GetDocumentsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse} GetDocumentsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDocumentsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * GetDocumentsRequestV1 groupBy. + * @member {Array.} groupBy + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1 + * @instance + */ + GetDocumentsRequestV1.prototype.groupBy = $util.emptyArray; - /** - * Verifies a GetDocumentsResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetDocumentsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; + /** + * GetDocumentsRequestV1 having. + * @member {Uint8Array} having + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1 + * @instance + */ + GetDocumentsRequestV1.prototype.having = $util.newBuffer([]); - /** - * Creates a GetDocumentsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse} GetDocumentsResponse - */ - GetDocumentsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetDocumentsResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetDocumentsResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetDocumentsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse - * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsResponse} message GetDocumentsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetDocumentsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetDocumentsResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse - * @instance - * @returns {Object.} JSON object - */ - GetDocumentsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetDocumentsResponse.GetDocumentsResponseV0 = (function() { - - /** - * Properties of a GetDocumentsResponseV0. - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse - * @interface IGetDocumentsResponseV0 - * @property {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.IDocuments|null} [documents] GetDocumentsResponseV0 documents - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetDocumentsResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetDocumentsResponseV0 metadata - */ - - /** - * Constructs a new GetDocumentsResponseV0. - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse - * @classdesc Represents a GetDocumentsResponseV0. - * @implements IGetDocumentsResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.IGetDocumentsResponseV0=} [properties] Properties to set - */ - function GetDocumentsResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetDocumentsResponseV0 documents. - * @member {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.IDocuments|null|undefined} documents - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 - * @instance - */ - GetDocumentsResponseV0.prototype.documents = null; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * GetDocumentsResponseV0 proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 - * @instance - */ - GetDocumentsResponseV0.prototype.proof = null; - - /** - * GetDocumentsResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 - * @instance - */ - GetDocumentsResponseV0.prototype.metadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetDocumentsResponseV0 result. - * @member {"documents"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 + * GetDocumentsRequestV1 start. + * @member {"startAfter"|"startAt"|undefined} start + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1 * @instance */ - Object.defineProperty(GetDocumentsResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["documents", "proof"]), + Object.defineProperty(GetDocumentsRequestV1.prototype, "start", { + get: $util.oneOfGetter($oneOfFields = ["startAfter", "startAt"]), set: $util.oneOfSetter($oneOfFields) }); /** - * Creates a new GetDocumentsResponseV0 instance using the specified properties. + * Creates a new GetDocumentsRequestV1 instance using the specified properties. * @function create - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1 * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.IGetDocumentsResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} GetDocumentsResponseV0 instance + * @param {org.dash.platform.dapi.v0.GetDocumentsRequest.IGetDocumentsRequestV1=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1} GetDocumentsRequestV1 instance */ - GetDocumentsResponseV0.create = function create(properties) { - return new GetDocumentsResponseV0(properties); + GetDocumentsRequestV1.create = function create(properties) { + return new GetDocumentsRequestV1(properties); }; /** - * Encodes the specified GetDocumentsResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.verify|verify} messages. + * Encodes the specified GetDocumentsRequestV1 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.verify|verify} messages. * @function encode - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1 * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.IGetDocumentsResponseV0} message GetDocumentsResponseV0 message or plain object to encode + * @param {org.dash.platform.dapi.v0.GetDocumentsRequest.IGetDocumentsRequestV1} message GetDocumentsRequestV1 message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetDocumentsResponseV0.encode = function encode(message, writer) { + GetDocumentsRequestV1.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.documents != null && Object.hasOwnProperty.call(message, "documents")) - $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.encode(message.documents, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.dataContractId != null && Object.hasOwnProperty.call(message, "dataContractId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.dataContractId); + if (message.documentType != null && Object.hasOwnProperty.call(message, "documentType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.documentType); + if (message.where != null && Object.hasOwnProperty.call(message, "where")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.where); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.orderBy); + if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) + writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.limit); + if (message.startAfter != null && Object.hasOwnProperty.call(message, "startAfter")) + writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.startAfter); + if (message.startAt != null && Object.hasOwnProperty.call(message, "startAt")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.startAt); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.prove); + if (message.select != null && Object.hasOwnProperty.call(message, "select")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.select); + if (message.groupBy != null && message.groupBy.length) + for (var i = 0; i < message.groupBy.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.groupBy[i]); + if (message.having != null && Object.hasOwnProperty.call(message, "having")) + writer.uint32(/* id 11, wireType 2 =*/90).bytes(message.having); return writer; }; /** - * Encodes the specified GetDocumentsResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.verify|verify} messages. + * Encodes the specified GetDocumentsRequestV1 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.verify|verify} messages. * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1 * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.IGetDocumentsResponseV0} message GetDocumentsResponseV0 message or plain object to encode + * @param {org.dash.platform.dapi.v0.GetDocumentsRequest.IGetDocumentsRequestV1} message GetDocumentsRequestV1 message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetDocumentsResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + GetDocumentsRequestV1.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetDocumentsResponseV0 message from the specified reader or buffer. + * Decodes a GetDocumentsRequestV1 message from the specified reader or buffer. * @function decode - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1 * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} GetDocumentsResponseV0 + * @returns {org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1} GetDocumentsRequestV1 * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetDocumentsResponseV0.decode = function decode(reader, length) { + GetDocumentsRequestV1.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.documents = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.decode(reader, reader.uint32()); + message.dataContractId = reader.bytes(); break; case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + message.documentType = reader.string(); break; case 3: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + message.where = reader.bytes(); + break; + case 4: + message.orderBy = reader.bytes(); + break; + case 5: + message.limit = reader.uint32(); + break; + case 6: + message.startAfter = reader.bytes(); + break; + case 7: + message.startAt = reader.bytes(); + break; + case 8: + message.prove = reader.bool(); + break; + case 9: + message.select = reader.int32(); + break; + case 10: + if (!(message.groupBy && message.groupBy.length)) + message.groupBy = []; + message.groupBy.push(reader.string()); + break; + case 11: + message.having = reader.bytes(); break; default: reader.skipType(tag & 7); @@ -20846,450 +20752,388 @@ $root.org = (function() { }; /** - * Decodes a GetDocumentsResponseV0 message from the specified reader or buffer, length delimited. + * Decodes a GetDocumentsRequestV1 message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1 * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} GetDocumentsResponseV0 + * @returns {org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1} GetDocumentsRequestV1 * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetDocumentsResponseV0.decodeDelimited = function decodeDelimited(reader) { + GetDocumentsRequestV1.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetDocumentsResponseV0 message. + * Verifies a GetDocumentsRequestV1 message. * @function verify - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1 * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetDocumentsResponseV0.verify = function verify(message) { + GetDocumentsRequestV1.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; var properties = {}; - if (message.documents != null && message.hasOwnProperty("documents")) { - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.verify(message.documents); - if (error) - return "documents." + error; - } + if (message.dataContractId != null && message.hasOwnProperty("dataContractId")) + if (!(message.dataContractId && typeof message.dataContractId.length === "number" || $util.isString(message.dataContractId))) + return "dataContractId: buffer expected"; + if (message.documentType != null && message.hasOwnProperty("documentType")) + if (!$util.isString(message.documentType)) + return "documentType: string expected"; + if (message.where != null && message.hasOwnProperty("where")) + if (!(message.where && typeof message.where.length === "number" || $util.isString(message.where))) + return "where: buffer expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!(message.orderBy && typeof message.orderBy.length === "number" || $util.isString(message.orderBy))) + return "orderBy: buffer expected"; + if (message.limit != null && message.hasOwnProperty("limit")) + if (!$util.isInteger(message.limit)) + return "limit: integer expected"; + if (message.startAfter != null && message.hasOwnProperty("startAfter")) { + properties.start = 1; + if (!(message.startAfter && typeof message.startAfter.length === "number" || $util.isString(message.startAfter))) + return "startAfter: buffer expected"; } - if (message.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.startAt != null && message.hasOwnProperty("startAt")) { + if (properties.start === 1) + return "start: multiple values"; + properties.start = 1; + if (!(message.startAt && typeof message.startAt.length === "number" || $util.isString(message.startAt))) + return "startAt: buffer expected"; } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + if (message.select != null && message.hasOwnProperty("select")) + switch (message.select) { + default: + return "select: enum value expected"; + case 0: + case 1: + break; + } + if (message.groupBy != null && message.hasOwnProperty("groupBy")) { + if (!Array.isArray(message.groupBy)) + return "groupBy: array expected"; + for (var i = 0; i < message.groupBy.length; ++i) + if (!$util.isString(message.groupBy[i])) + return "groupBy: string[] expected"; } + if (message.having != null && message.hasOwnProperty("having")) + if (!(message.having && typeof message.having.length === "number" || $util.isString(message.having))) + return "having: buffer expected"; return null; }; /** - * Creates a GetDocumentsResponseV0 message from a plain object. Also converts values to their respective internal types. + * Creates a GetDocumentsRequestV1 message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1 * @static * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} GetDocumentsResponseV0 + * @returns {org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1} GetDocumentsRequestV1 */ - GetDocumentsResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0) + GetDocumentsRequestV1.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1) return object; - var message = new $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0(); - if (object.documents != null) { - if (typeof object.documents !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.documents: object expected"); - message.documents = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.fromObject(object.documents); - } - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetDocumentsResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} message GetDocumentsResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetDocumentsResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.documents != null && message.hasOwnProperty("documents")) { - object.documents = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.toObject(message.documents, options); + var message = new $root.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1(); + if (object.dataContractId != null) + if (typeof object.dataContractId === "string") + $util.base64.decode(object.dataContractId, message.dataContractId = $util.newBuffer($util.base64.length(object.dataContractId)), 0); + else if (object.dataContractId.length >= 0) + message.dataContractId = object.dataContractId; + if (object.documentType != null) + message.documentType = String(object.documentType); + if (object.where != null) + if (typeof object.where === "string") + $util.base64.decode(object.where, message.where = $util.newBuffer($util.base64.length(object.where)), 0); + else if (object.where.length >= 0) + message.where = object.where; + if (object.orderBy != null) + if (typeof object.orderBy === "string") + $util.base64.decode(object.orderBy, message.orderBy = $util.newBuffer($util.base64.length(object.orderBy)), 0); + else if (object.orderBy.length >= 0) + message.orderBy = object.orderBy; + if (object.limit != null) + message.limit = object.limit >>> 0; + if (object.startAfter != null) + if (typeof object.startAfter === "string") + $util.base64.decode(object.startAfter, message.startAfter = $util.newBuffer($util.base64.length(object.startAfter)), 0); + else if (object.startAfter.length >= 0) + message.startAfter = object.startAfter; + if (object.startAt != null) + if (typeof object.startAt === "string") + $util.base64.decode(object.startAt, message.startAt = $util.newBuffer($util.base64.length(object.startAt)), 0); + else if (object.startAt.length >= 0) + message.startAt = object.startAt; + if (object.prove != null) + message.prove = Boolean(object.prove); + switch (object.select) { + case "DOCUMENTS": + case 0: + message.select = 0; + break; + case "COUNT": + case 1: + message.select = 1; + break; + } + if (object.groupBy) { + if (!Array.isArray(object.groupBy)) + throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.groupBy: array expected"); + message.groupBy = []; + for (var i = 0; i < object.groupBy.length; ++i) + message.groupBy[i] = String(object.groupBy[i]); + } + if (object.having != null) + if (typeof object.having === "string") + $util.base64.decode(object.having, message.having = $util.newBuffer($util.base64.length(object.having)), 0); + else if (object.having.length >= 0) + message.having = object.having; + return message; + }; + + /** + * Creates a plain object from a GetDocumentsRequestV1 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1 + * @static + * @param {org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1} message GetDocumentsRequestV1 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDocumentsRequestV1.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.groupBy = []; + if (options.defaults) { + if (options.bytes === String) + object.dataContractId = ""; + else { + object.dataContractId = []; + if (options.bytes !== Array) + object.dataContractId = $util.newBuffer(object.dataContractId); + } + object.documentType = ""; + if (options.bytes === String) + object.where = ""; + else { + object.where = []; + if (options.bytes !== Array) + object.where = $util.newBuffer(object.where); + } + if (options.bytes === String) + object.orderBy = ""; + else { + object.orderBy = []; + if (options.bytes !== Array) + object.orderBy = $util.newBuffer(object.orderBy); + } + object.limit = 0; + object.prove = false; + object.select = options.enums === String ? "DOCUMENTS" : 0; + if (options.bytes === String) + object.having = ""; + else { + object.having = []; + if (options.bytes !== Array) + object.having = $util.newBuffer(object.having); + } + } + if (message.dataContractId != null && message.hasOwnProperty("dataContractId")) + object.dataContractId = options.bytes === String ? $util.base64.encode(message.dataContractId, 0, message.dataContractId.length) : options.bytes === Array ? Array.prototype.slice.call(message.dataContractId) : message.dataContractId; + if (message.documentType != null && message.hasOwnProperty("documentType")) + object.documentType = message.documentType; + if (message.where != null && message.hasOwnProperty("where")) + object.where = options.bytes === String ? $util.base64.encode(message.where, 0, message.where.length) : options.bytes === Array ? Array.prototype.slice.call(message.where) : message.where; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = options.bytes === String ? $util.base64.encode(message.orderBy, 0, message.orderBy.length) : options.bytes === Array ? Array.prototype.slice.call(message.orderBy) : message.orderBy; + if (message.limit != null && message.hasOwnProperty("limit")) + object.limit = message.limit; + if (message.startAfter != null && message.hasOwnProperty("startAfter")) { + object.startAfter = options.bytes === String ? $util.base64.encode(message.startAfter, 0, message.startAfter.length) : options.bytes === Array ? Array.prototype.slice.call(message.startAfter) : message.startAfter; if (options.oneofs) - object.result = "documents"; + object.start = "startAfter"; } - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (message.startAt != null && message.hasOwnProperty("startAt")) { + object.startAt = options.bytes === String ? $util.base64.encode(message.startAt, 0, message.startAt.length) : options.bytes === Array ? Array.prototype.slice.call(message.startAt) : message.startAt; if (options.oneofs) - object.result = "proof"; + object.start = "startAt"; } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + if (message.select != null && message.hasOwnProperty("select")) + object.select = options.enums === String ? $root.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.Select[message.select] : message.select; + if (message.groupBy && message.groupBy.length) { + object.groupBy = []; + for (var j = 0; j < message.groupBy.length; ++j) + object.groupBy[j] = message.groupBy[j]; + } + if (message.having != null && message.hasOwnProperty("having")) + object.having = options.bytes === String ? $util.base64.encode(message.having, 0, message.having.length) : options.bytes === Array ? Array.prototype.slice.call(message.having) : message.having; return object; }; /** - * Converts this GetDocumentsResponseV0 to JSON. + * Converts this GetDocumentsRequestV1 to JSON. * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1 * @instance * @returns {Object.} JSON object */ - GetDocumentsResponseV0.prototype.toJSON = function toJSON() { + GetDocumentsRequestV1.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - GetDocumentsResponseV0.Documents = (function() { + /** + * Select enum. + * @name org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.Select + * @enum {number} + * @property {number} DOCUMENTS=0 DOCUMENTS value + * @property {number} COUNT=1 COUNT value + */ + GetDocumentsRequestV1.Select = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DOCUMENTS"] = 0; + values[valuesById[1] = "COUNT"] = 1; + return values; + })(); - /** - * Properties of a Documents. - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 - * @interface IDocuments - * @property {Array.|null} [documents] Documents documents - */ + return GetDocumentsRequestV1; + })(); - /** - * Constructs a new Documents. - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 - * @classdesc Represents a Documents. - * @implements IDocuments - * @constructor - * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.IDocuments=} [properties] Properties to set - */ - function Documents(properties) { - this.documents = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + return GetDocumentsRequest; + })(); - /** - * Documents documents. - * @member {Array.} documents - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents - * @instance - */ - Documents.prototype.documents = $util.emptyArray; + v0.GetDocumentsResponse = (function() { - /** - * Creates a new Documents instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents - * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.IDocuments=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} Documents instance - */ - Documents.create = function create(properties) { - return new Documents(properties); - }; + /** + * Properties of a GetDocumentsResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetDocumentsResponse + * @property {org.dash.platform.dapi.v0.GetDocumentsResponse.IGetDocumentsResponseV0|null} [v0] GetDocumentsResponse v0 + * @property {org.dash.platform.dapi.v0.GetDocumentsResponse.IGetDocumentsResponseV1|null} [v1] GetDocumentsResponse v1 + */ - /** - * Encodes the specified Documents message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents - * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.IDocuments} message Documents message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Documents.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.documents != null && message.documents.length) - for (var i = 0; i < message.documents.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.documents[i]); - return writer; - }; + /** + * Constructs a new GetDocumentsResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetDocumentsResponse. + * @implements IGetDocumentsResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetDocumentsResponse=} [properties] Properties to set + */ + function GetDocumentsResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Encodes the specified Documents message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents - * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.IDocuments} message Documents message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Documents.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * GetDocumentsResponse v0. + * @member {org.dash.platform.dapi.v0.GetDocumentsResponse.IGetDocumentsResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse + * @instance + */ + GetDocumentsResponse.prototype.v0 = null; - /** - * Decodes a Documents message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} Documents - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Documents.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.documents && message.documents.length)) - message.documents = []; - message.documents.push(reader.bytes()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Documents message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} Documents - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Documents.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Documents message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Documents.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.documents != null && message.hasOwnProperty("documents")) { - if (!Array.isArray(message.documents)) - return "documents: array expected"; - for (var i = 0; i < message.documents.length; ++i) - if (!(message.documents[i] && typeof message.documents[i].length === "number" || $util.isString(message.documents[i]))) - return "documents: buffer[] expected"; - } - return null; - }; - - /** - * Creates a Documents message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} Documents - */ - Documents.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents(); - if (object.documents) { - if (!Array.isArray(object.documents)) - throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.documents: array expected"); - message.documents = []; - for (var i = 0; i < object.documents.length; ++i) - if (typeof object.documents[i] === "string") - $util.base64.decode(object.documents[i], message.documents[i] = $util.newBuffer($util.base64.length(object.documents[i])), 0); - else if (object.documents[i].length >= 0) - message.documents[i] = object.documents[i]; - } - return message; - }; - - /** - * Creates a plain object from a Documents message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents - * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} message Documents - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Documents.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.documents = []; - if (message.documents && message.documents.length) { - object.documents = []; - for (var j = 0; j < message.documents.length; ++j) - object.documents[j] = options.bytes === String ? $util.base64.encode(message.documents[j], 0, message.documents[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.documents[j]) : message.documents[j]; - } - return object; - }; - - /** - * Converts this Documents to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents - * @instance - * @returns {Object.} JSON object - */ - Documents.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Documents; - })(); - - return GetDocumentsResponseV0; - })(); - - return GetDocumentsResponse; - })(); - - v0.GetDocumentsCountRequest = (function() { - - /** - * Properties of a GetDocumentsCountRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetDocumentsCountRequest - * @property {org.dash.platform.dapi.v0.GetDocumentsCountRequest.IGetDocumentsCountRequestV0|null} [v0] GetDocumentsCountRequest v0 - */ - - /** - * Constructs a new GetDocumentsCountRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetDocumentsCountRequest. - * @implements IGetDocumentsCountRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetDocumentsCountRequest=} [properties] Properties to set - */ - function GetDocumentsCountRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetDocumentsCountRequest v0. - * @member {org.dash.platform.dapi.v0.GetDocumentsCountRequest.IGetDocumentsCountRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountRequest - * @instance - */ - GetDocumentsCountRequest.prototype.v0 = null; + /** + * GetDocumentsResponse v1. + * @member {org.dash.platform.dapi.v0.GetDocumentsResponse.IGetDocumentsResponseV1|null|undefined} v1 + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse + * @instance + */ + GetDocumentsResponse.prototype.v1 = null; // OneOf field names bound to virtual getters and setters var $oneOfFields; /** - * GetDocumentsCountRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountRequest + * GetDocumentsResponse version. + * @member {"v0"|"v1"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse * @instance */ - Object.defineProperty(GetDocumentsCountRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), + Object.defineProperty(GetDocumentsResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0", "v1"]), set: $util.oneOfSetter($oneOfFields) }); /** - * Creates a new GetDocumentsCountRequest instance using the specified properties. + * Creates a new GetDocumentsResponse instance using the specified properties. * @function create - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountRequest + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse * @static - * @param {org.dash.platform.dapi.v0.IGetDocumentsCountRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetDocumentsCountRequest} GetDocumentsCountRequest instance + * @param {org.dash.platform.dapi.v0.IGetDocumentsResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse} GetDocumentsResponse instance */ - GetDocumentsCountRequest.create = function create(properties) { - return new GetDocumentsCountRequest(properties); + GetDocumentsResponse.create = function create(properties) { + return new GetDocumentsResponse(properties); }; /** - * Encodes the specified GetDocumentsCountRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsCountRequest.verify|verify} messages. + * Encodes the specified GetDocumentsResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.verify|verify} messages. * @function encode - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountRequest + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse * @static - * @param {org.dash.platform.dapi.v0.IGetDocumentsCountRequest} message GetDocumentsCountRequest message or plain object to encode + * @param {org.dash.platform.dapi.v0.IGetDocumentsResponse} message GetDocumentsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetDocumentsCountRequest.encode = function encode(message, writer) { + GetDocumentsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.v1 != null && Object.hasOwnProperty.call(message, "v1")) + $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.encode(message.v1, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified GetDocumentsCountRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsCountRequest.verify|verify} messages. + * Encodes the specified GetDocumentsResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountRequest + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse * @static - * @param {org.dash.platform.dapi.v0.IGetDocumentsCountRequest} message GetDocumentsCountRequest message or plain object to encode + * @param {org.dash.platform.dapi.v0.IGetDocumentsResponse} message GetDocumentsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetDocumentsCountRequest.encodeDelimited = function encodeDelimited(message, writer) { + GetDocumentsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetDocumentsCountRequest message from the specified reader or buffer. + * Decodes a GetDocumentsResponse message from the specified reader or buffer. * @function decode - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountRequest + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetDocumentsCountRequest} GetDocumentsCountRequest + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse} GetDocumentsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetDocumentsCountRequest.decode = function decode(reader, length) { + GetDocumentsResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDocumentsCountRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDocumentsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.decode(reader, reader.uint32()); + message.v0 = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.decode(reader, reader.uint32()); + break; + case 2: + message.v1 = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -21300,120 +21144,136 @@ $root.org = (function() { }; /** - * Decodes a GetDocumentsCountRequest message from the specified reader or buffer, length delimited. + * Decodes a GetDocumentsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountRequest + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetDocumentsCountRequest} GetDocumentsCountRequest + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse} GetDocumentsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetDocumentsCountRequest.decodeDelimited = function decodeDelimited(reader) { + GetDocumentsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetDocumentsCountRequest message. + * Verifies a GetDocumentsResponse message. * @function verify - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountRequest + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetDocumentsCountRequest.verify = function verify(message) { + GetDocumentsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; var properties = {}; if (message.v0 != null && message.hasOwnProperty("v0")) { properties.version = 1; { - var error = $root.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.verify(message.v0); + var error = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.verify(message.v0); if (error) return "v0." + error; } } + if (message.v1 != null && message.hasOwnProperty("v1")) { + if (properties.version === 1) + return "version: multiple values"; + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.verify(message.v1); + if (error) + return "v1." + error; + } + } return null; }; /** - * Creates a GetDocumentsCountRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetDocumentsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountRequest + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse * @static * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetDocumentsCountRequest} GetDocumentsCountRequest + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse} GetDocumentsResponse */ - GetDocumentsCountRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetDocumentsCountRequest) + GetDocumentsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDocumentsResponse) return object; - var message = new $root.org.dash.platform.dapi.v0.GetDocumentsCountRequest(); + var message = new $root.org.dash.platform.dapi.v0.GetDocumentsResponse(); if (object.v0 != null) { if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsCountRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.fromObject(object.v0); + throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.fromObject(object.v0); + } + if (object.v1 != null) { + if (typeof object.v1 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsResponse.v1: object expected"); + message.v1 = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.fromObject(object.v1); } return message; }; /** - * Creates a plain object from a GetDocumentsCountRequest message. Also converts values to other types if specified. + * Creates a plain object from a GetDocumentsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountRequest + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsCountRequest} message GetDocumentsCountRequest + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse} message GetDocumentsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetDocumentsCountRequest.toObject = function toObject(message, options) { + GetDocumentsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.toObject(message.v0, options); + object.v0 = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.toObject(message.v0, options); if (options.oneofs) object.version = "v0"; } + if (message.v1 != null && message.hasOwnProperty("v1")) { + object.v1 = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.toObject(message.v1, options); + if (options.oneofs) + object.version = "v1"; + } return object; }; /** - * Converts this GetDocumentsCountRequest to JSON. + * Converts this GetDocumentsResponse to JSON. * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountRequest + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse * @instance * @returns {Object.} JSON object */ - GetDocumentsCountRequest.prototype.toJSON = function toJSON() { + GetDocumentsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - GetDocumentsCountRequest.GetDocumentsCountRequestV0 = (function() { + GetDocumentsResponse.GetDocumentsResponseV0 = (function() { /** - * Properties of a GetDocumentsCountRequestV0. - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountRequest - * @interface IGetDocumentsCountRequestV0 - * @property {Uint8Array|null} [dataContractId] GetDocumentsCountRequestV0 dataContractId - * @property {string|null} [documentType] GetDocumentsCountRequestV0 documentType - * @property {Uint8Array|null} [where] GetDocumentsCountRequestV0 where - * @property {boolean|null} [returnDistinctCountsInRange] GetDocumentsCountRequestV0 returnDistinctCountsInRange - * @property {Uint8Array|null} [orderBy] GetDocumentsCountRequestV0 orderBy - * @property {number|null} [limit] GetDocumentsCountRequestV0 limit - * @property {boolean|null} [prove] GetDocumentsCountRequestV0 prove + * Properties of a GetDocumentsResponseV0. + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse + * @interface IGetDocumentsResponseV0 + * @property {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.IDocuments|null} [documents] GetDocumentsResponseV0 documents + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetDocumentsResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetDocumentsResponseV0 metadata */ /** - * Constructs a new GetDocumentsCountRequestV0. - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountRequest - * @classdesc Represents a GetDocumentsCountRequestV0. - * @implements IGetDocumentsCountRequestV0 + * Constructs a new GetDocumentsResponseV0. + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse + * @classdesc Represents a GetDocumentsResponseV0. + * @implements IGetDocumentsResponseV0 * @constructor - * @param {org.dash.platform.dapi.v0.GetDocumentsCountRequest.IGetDocumentsCountRequestV0=} [properties] Properties to set + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.IGetDocumentsResponseV0=} [properties] Properties to set */ - function GetDocumentsCountRequestV0(properties) { + function GetDocumentsResponseV0(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -21421,153 +21281,115 @@ $root.org = (function() { } /** - * GetDocumentsCountRequestV0 dataContractId. - * @member {Uint8Array} dataContractId - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0 - * @instance - */ - GetDocumentsCountRequestV0.prototype.dataContractId = $util.newBuffer([]); - - /** - * GetDocumentsCountRequestV0 documentType. - * @member {string} documentType - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0 - * @instance - */ - GetDocumentsCountRequestV0.prototype.documentType = ""; - - /** - * GetDocumentsCountRequestV0 where. - * @member {Uint8Array} where - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0 + * GetDocumentsResponseV0 documents. + * @member {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.IDocuments|null|undefined} documents + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 * @instance */ - GetDocumentsCountRequestV0.prototype.where = $util.newBuffer([]); + GetDocumentsResponseV0.prototype.documents = null; /** - * GetDocumentsCountRequestV0 returnDistinctCountsInRange. - * @member {boolean} returnDistinctCountsInRange - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0 + * GetDocumentsResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 * @instance */ - GetDocumentsCountRequestV0.prototype.returnDistinctCountsInRange = false; + GetDocumentsResponseV0.prototype.proof = null; /** - * GetDocumentsCountRequestV0 orderBy. - * @member {Uint8Array} orderBy - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0 + * GetDocumentsResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 * @instance */ - GetDocumentsCountRequestV0.prototype.orderBy = $util.newBuffer([]); + GetDocumentsResponseV0.prototype.metadata = null; - /** - * GetDocumentsCountRequestV0 limit. - * @member {number} limit - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0 - * @instance - */ - GetDocumentsCountRequestV0.prototype.limit = 0; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * GetDocumentsCountRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0 + * GetDocumentsResponseV0 result. + * @member {"documents"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 * @instance */ - GetDocumentsCountRequestV0.prototype.prove = false; + Object.defineProperty(GetDocumentsResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["documents", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Creates a new GetDocumentsCountRequestV0 instance using the specified properties. + * Creates a new GetDocumentsResponseV0 instance using the specified properties. * @function create - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0 + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsCountRequest.IGetDocumentsCountRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0} GetDocumentsCountRequestV0 instance + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.IGetDocumentsResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} GetDocumentsResponseV0 instance */ - GetDocumentsCountRequestV0.create = function create(properties) { - return new GetDocumentsCountRequestV0(properties); + GetDocumentsResponseV0.create = function create(properties) { + return new GetDocumentsResponseV0(properties); }; /** - * Encodes the specified GetDocumentsCountRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.verify|verify} messages. + * Encodes the specified GetDocumentsResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.verify|verify} messages. * @function encode - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0 + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsCountRequest.IGetDocumentsCountRequestV0} message GetDocumentsCountRequestV0 message or plain object to encode + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.IGetDocumentsResponseV0} message GetDocumentsResponseV0 message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetDocumentsCountRequestV0.encode = function encode(message, writer) { + GetDocumentsResponseV0.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.dataContractId != null && Object.hasOwnProperty.call(message, "dataContractId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.dataContractId); - if (message.documentType != null && Object.hasOwnProperty.call(message, "documentType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.documentType); - if (message.where != null && Object.hasOwnProperty.call(message, "where")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.where); - if (message.returnDistinctCountsInRange != null && Object.hasOwnProperty.call(message, "returnDistinctCountsInRange")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.returnDistinctCountsInRange); - if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.orderBy); - if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) - writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.limit); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 7, wireType 0 =*/56).bool(message.prove); + if (message.documents != null && Object.hasOwnProperty.call(message, "documents")) + $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.encode(message.documents, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified GetDocumentsCountRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.verify|verify} messages. + * Encodes the specified GetDocumentsResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.verify|verify} messages. * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0 + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsCountRequest.IGetDocumentsCountRequestV0} message GetDocumentsCountRequestV0 message or plain object to encode + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.IGetDocumentsResponseV0} message GetDocumentsResponseV0 message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetDocumentsCountRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + GetDocumentsResponseV0.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetDocumentsCountRequestV0 message from the specified reader or buffer. + * Decodes a GetDocumentsResponseV0 message from the specified reader or buffer. * @function decode - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0 + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0} GetDocumentsCountRequestV0 + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} GetDocumentsResponseV0 * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetDocumentsCountRequestV0.decode = function decode(reader, length) { + GetDocumentsResponseV0.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.dataContractId = reader.bytes(); + message.documents = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.decode(reader, reader.uint32()); break; case 2: - message.documentType = reader.string(); + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); break; case 3: - message.where = reader.bytes(); - break; - case 4: - message.returnDistinctCountsInRange = reader.bool(); - break; - case 5: - message.orderBy = reader.bytes(); - break; - case 6: - message.limit = reader.uint32(); - break; - case 7: - message.prove = reader.bool(); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -21578,396 +21400,359 @@ $root.org = (function() { }; /** - * Decodes a GetDocumentsCountRequestV0 message from the specified reader or buffer, length delimited. + * Decodes a GetDocumentsResponseV0 message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0 + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0} GetDocumentsCountRequestV0 + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} GetDocumentsResponseV0 * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetDocumentsCountRequestV0.decodeDelimited = function decodeDelimited(reader) { + GetDocumentsResponseV0.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetDocumentsCountRequestV0 message. + * Verifies a GetDocumentsResponseV0 message. * @function verify - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0 + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetDocumentsCountRequestV0.verify = function verify(message) { + GetDocumentsResponseV0.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.dataContractId != null && message.hasOwnProperty("dataContractId")) - if (!(message.dataContractId && typeof message.dataContractId.length === "number" || $util.isString(message.dataContractId))) - return "dataContractId: buffer expected"; - if (message.documentType != null && message.hasOwnProperty("documentType")) - if (!$util.isString(message.documentType)) - return "documentType: string expected"; - if (message.where != null && message.hasOwnProperty("where")) - if (!(message.where && typeof message.where.length === "number" || $util.isString(message.where))) - return "where: buffer expected"; - if (message.returnDistinctCountsInRange != null && message.hasOwnProperty("returnDistinctCountsInRange")) - if (typeof message.returnDistinctCountsInRange !== "boolean") - return "returnDistinctCountsInRange: boolean expected"; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - if (!(message.orderBy && typeof message.orderBy.length === "number" || $util.isString(message.orderBy))) - return "orderBy: buffer expected"; - if (message.limit != null && message.hasOwnProperty("limit")) - if (!$util.isInteger(message.limit)) - return "limit: integer expected"; - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; + var properties = {}; + if (message.documents != null && message.hasOwnProperty("documents")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.verify(message.documents); + if (error) + return "documents." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } return null; }; /** - * Creates a GetDocumentsCountRequestV0 message from a plain object. Also converts values to their respective internal types. + * Creates a GetDocumentsResponseV0 message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0 + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 * @static * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0} GetDocumentsCountRequestV0 + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} GetDocumentsResponseV0 */ - GetDocumentsCountRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0) + GetDocumentsResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0) return object; - var message = new $root.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0(); - if (object.dataContractId != null) - if (typeof object.dataContractId === "string") - $util.base64.decode(object.dataContractId, message.dataContractId = $util.newBuffer($util.base64.length(object.dataContractId)), 0); - else if (object.dataContractId.length >= 0) - message.dataContractId = object.dataContractId; - if (object.documentType != null) - message.documentType = String(object.documentType); - if (object.where != null) - if (typeof object.where === "string") - $util.base64.decode(object.where, message.where = $util.newBuffer($util.base64.length(object.where)), 0); - else if (object.where.length >= 0) - message.where = object.where; - if (object.returnDistinctCountsInRange != null) - message.returnDistinctCountsInRange = Boolean(object.returnDistinctCountsInRange); - if (object.orderBy != null) - if (typeof object.orderBy === "string") - $util.base64.decode(object.orderBy, message.orderBy = $util.newBuffer($util.base64.length(object.orderBy)), 0); - else if (object.orderBy.length >= 0) - message.orderBy = object.orderBy; - if (object.limit != null) - message.limit = object.limit >>> 0; - if (object.prove != null) - message.prove = Boolean(object.prove); + var message = new $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0(); + if (object.documents != null) { + if (typeof object.documents !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.documents: object expected"); + message.documents = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.fromObject(object.documents); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } return message; }; /** - * Creates a plain object from a GetDocumentsCountRequestV0 message. Also converts values to other types if specified. + * Creates a plain object from a GetDocumentsResponseV0 message. Also converts values to other types if specified. * @function toObject - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0 + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0} message GetDocumentsCountRequestV0 + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} message GetDocumentsResponseV0 * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetDocumentsCountRequestV0.toObject = function toObject(message, options) { + GetDocumentsResponseV0.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.dataContractId = ""; - else { - object.dataContractId = []; - if (options.bytes !== Array) - object.dataContractId = $util.newBuffer(object.dataContractId); - } - object.documentType = ""; - if (options.bytes === String) - object.where = ""; - else { - object.where = []; - if (options.bytes !== Array) - object.where = $util.newBuffer(object.where); - } - object.returnDistinctCountsInRange = false; - if (options.bytes === String) - object.orderBy = ""; - else { - object.orderBy = []; - if (options.bytes !== Array) - object.orderBy = $util.newBuffer(object.orderBy); - } - object.limit = 0; - object.prove = false; + if (options.defaults) + object.metadata = null; + if (message.documents != null && message.hasOwnProperty("documents")) { + object.documents = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.toObject(message.documents, options); + if (options.oneofs) + object.result = "documents"; } - if (message.dataContractId != null && message.hasOwnProperty("dataContractId")) - object.dataContractId = options.bytes === String ? $util.base64.encode(message.dataContractId, 0, message.dataContractId.length) : options.bytes === Array ? Array.prototype.slice.call(message.dataContractId) : message.dataContractId; - if (message.documentType != null && message.hasOwnProperty("documentType")) - object.documentType = message.documentType; - if (message.where != null && message.hasOwnProperty("where")) - object.where = options.bytes === String ? $util.base64.encode(message.where, 0, message.where.length) : options.bytes === Array ? Array.prototype.slice.call(message.where) : message.where; - if (message.returnDistinctCountsInRange != null && message.hasOwnProperty("returnDistinctCountsInRange")) - object.returnDistinctCountsInRange = message.returnDistinctCountsInRange; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = options.bytes === String ? $util.base64.encode(message.orderBy, 0, message.orderBy.length) : options.bytes === Array ? Array.prototype.slice.call(message.orderBy) : message.orderBy; - if (message.limit != null && message.hasOwnProperty("limit")) - object.limit = message.limit; - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; + 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 GetDocumentsCountRequestV0 to JSON. + * Converts this GetDocumentsResponseV0 to JSON. * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0 + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 * @instance * @returns {Object.} JSON object */ - GetDocumentsCountRequestV0.prototype.toJSON = function toJSON() { + GetDocumentsResponseV0.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GetDocumentsCountRequestV0; - })(); - - return GetDocumentsCountRequest; - })(); - - v0.GetDocumentsCountResponse = (function() { + GetDocumentsResponseV0.Documents = (function() { - /** - * Properties of a GetDocumentsCountResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetDocumentsCountResponse - * @property {org.dash.platform.dapi.v0.GetDocumentsCountResponse.IGetDocumentsCountResponseV0|null} [v0] GetDocumentsCountResponse v0 - */ + /** + * Properties of a Documents. + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 + * @interface IDocuments + * @property {Array.|null} [documents] Documents documents + */ - /** - * Constructs a new GetDocumentsCountResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetDocumentsCountResponse. - * @implements IGetDocumentsCountResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetDocumentsCountResponse=} [properties] Properties to set - */ - function GetDocumentsCountResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Constructs a new Documents. + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 + * @classdesc Represents a Documents. + * @implements IDocuments + * @constructor + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.IDocuments=} [properties] Properties to set + */ + function Documents(properties) { + this.documents = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * GetDocumentsCountResponse v0. - * @member {org.dash.platform.dapi.v0.GetDocumentsCountResponse.IGetDocumentsCountResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse - * @instance - */ - GetDocumentsCountResponse.prototype.v0 = null; + /** + * Documents documents. + * @member {Array.} documents + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents + * @instance + */ + Documents.prototype.documents = $util.emptyArray; - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * Creates a new Documents instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents + * @static + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.IDocuments=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} Documents instance + */ + Documents.create = function create(properties) { + return new Documents(properties); + }; - /** - * GetDocumentsCountResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse - * @instance - */ - Object.defineProperty(GetDocumentsCountResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); + /** + * Encodes the specified Documents message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents + * @static + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.IDocuments} message Documents message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Documents.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.documents != null && message.documents.length) + for (var i = 0; i < message.documents.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.documents[i]); + return writer; + }; - /** - * Creates a new GetDocumentsCountResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetDocumentsCountResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetDocumentsCountResponse} GetDocumentsCountResponse instance - */ - GetDocumentsCountResponse.create = function create(properties) { - return new GetDocumentsCountResponse(properties); - }; + /** + * Encodes the specified Documents message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents + * @static + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.IDocuments} message Documents message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Documents.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Encodes the specified GetDocumentsCountResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsCountResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetDocumentsCountResponse} message GetDocumentsCountResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDocumentsCountResponse.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.GetDocumentsCountResponse.GetDocumentsCountResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; + /** + * Decodes a Documents message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} Documents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Documents.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.documents && message.documents.length)) + message.documents = []; + message.documents.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Encodes the specified GetDocumentsCountResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsCountResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetDocumentsCountResponse} message GetDocumentsCountResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDocumentsCountResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Decodes a Documents message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} Documents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Documents.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Decodes a GetDocumentsCountResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetDocumentsCountResponse} GetDocumentsCountResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDocumentsCountResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDocumentsCountResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Verifies a Documents message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Documents.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.documents != null && message.hasOwnProperty("documents")) { + if (!Array.isArray(message.documents)) + return "documents: array expected"; + for (var i = 0; i < message.documents.length; ++i) + if (!(message.documents[i] && typeof message.documents[i].length === "number" || $util.isString(message.documents[i]))) + return "documents: buffer[] expected"; + } + return null; + }; - /** - * Decodes a GetDocumentsCountResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetDocumentsCountResponse} GetDocumentsCountResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDocumentsCountResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Creates a Documents message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} Documents + */ + Documents.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents(); + if (object.documents) { + if (!Array.isArray(object.documents)) + throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.documents: array expected"); + message.documents = []; + for (var i = 0; i < object.documents.length; ++i) + if (typeof object.documents[i] === "string") + $util.base64.decode(object.documents[i], message.documents[i] = $util.newBuffer($util.base64.length(object.documents[i])), 0); + else if (object.documents[i].length >= 0) + message.documents[i] = object.documents[i]; + } + return message; + }; - /** - * Verifies a GetDocumentsCountResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetDocumentsCountResponse.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.GetDocumentsCountResponse.GetDocumentsCountResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; + /** + * Creates a plain object from a Documents message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents + * @static + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} message Documents + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Documents.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.documents = []; + if (message.documents && message.documents.length) { + object.documents = []; + for (var j = 0; j < message.documents.length; ++j) + object.documents[j] = options.bytes === String ? $util.base64.encode(message.documents[j], 0, message.documents[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.documents[j]) : message.documents[j]; + } + return object; + }; - /** - * Creates a GetDocumentsCountResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetDocumentsCountResponse} GetDocumentsCountResponse - */ - GetDocumentsCountResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetDocumentsCountResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetDocumentsCountResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsCountResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.fromObject(object.v0); - } - return message; - }; + /** + * Converts this Documents to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents + * @instance + * @returns {Object.} JSON object + */ + Documents.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Creates a plain object from a GetDocumentsCountResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse - * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsCountResponse} message GetDocumentsCountResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetDocumentsCountResponse.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.GetDocumentsCountResponse.GetDocumentsCountResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; + return Documents; + })(); - /** - * Converts this GetDocumentsCountResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse - * @instance - * @returns {Object.} JSON object - */ - GetDocumentsCountResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return GetDocumentsResponseV0; + })(); - GetDocumentsCountResponse.GetDocumentsCountResponseV0 = (function() { + GetDocumentsResponse.GetDocumentsResponseV1 = (function() { /** - * Properties of a GetDocumentsCountResponseV0. - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse - * @interface IGetDocumentsCountResponseV0 - * @property {org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.ICountResults|null} [counts] GetDocumentsCountResponseV0 counts - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetDocumentsCountResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetDocumentsCountResponseV0 metadata + * Properties of a GetDocumentsResponseV1. + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse + * @interface IGetDocumentsResponseV1 + * @property {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.IResultData|null} [data] GetDocumentsResponseV1 data + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetDocumentsResponseV1 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetDocumentsResponseV1 metadata */ /** - * Constructs a new GetDocumentsCountResponseV0. - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse - * @classdesc Represents a GetDocumentsCountResponseV0. - * @implements IGetDocumentsCountResponseV0 + * Constructs a new GetDocumentsResponseV1. + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse + * @classdesc Represents a GetDocumentsResponseV1. + * @implements IGetDocumentsResponseV1 * @constructor - * @param {org.dash.platform.dapi.v0.GetDocumentsCountResponse.IGetDocumentsCountResponseV0=} [properties] Properties to set + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.IGetDocumentsResponseV1=} [properties] Properties to set */ - function GetDocumentsCountResponseV0(properties) { + function GetDocumentsResponseV1(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -21975,69 +21760,69 @@ $root.org = (function() { } /** - * GetDocumentsCountResponseV0 counts. - * @member {org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.ICountResults|null|undefined} counts - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0 + * GetDocumentsResponseV1 data. + * @member {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.IResultData|null|undefined} data + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1 * @instance */ - GetDocumentsCountResponseV0.prototype.counts = null; + GetDocumentsResponseV1.prototype.data = null; /** - * GetDocumentsCountResponseV0 proof. + * GetDocumentsResponseV1 proof. * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0 + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1 * @instance */ - GetDocumentsCountResponseV0.prototype.proof = null; + GetDocumentsResponseV1.prototype.proof = null; /** - * GetDocumentsCountResponseV0 metadata. + * GetDocumentsResponseV1 metadata. * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0 + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1 * @instance */ - GetDocumentsCountResponseV0.prototype.metadata = null; + GetDocumentsResponseV1.prototype.metadata = null; // OneOf field names bound to virtual getters and setters var $oneOfFields; /** - * GetDocumentsCountResponseV0 result. - * @member {"counts"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0 + * GetDocumentsResponseV1 result. + * @member {"data"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1 * @instance */ - Object.defineProperty(GetDocumentsCountResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["counts", "proof"]), + Object.defineProperty(GetDocumentsResponseV1.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["data", "proof"]), set: $util.oneOfSetter($oneOfFields) }); /** - * Creates a new GetDocumentsCountResponseV0 instance using the specified properties. + * Creates a new GetDocumentsResponseV1 instance using the specified properties. * @function create - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0 + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1 * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsCountResponse.IGetDocumentsCountResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0} GetDocumentsCountResponseV0 instance + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.IGetDocumentsResponseV1=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1} GetDocumentsResponseV1 instance */ - GetDocumentsCountResponseV0.create = function create(properties) { - return new GetDocumentsCountResponseV0(properties); + GetDocumentsResponseV1.create = function create(properties) { + return new GetDocumentsResponseV1(properties); }; /** - * Encodes the specified GetDocumentsCountResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.verify|verify} messages. + * Encodes the specified GetDocumentsResponseV1 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.verify|verify} messages. * @function encode - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0 + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1 * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsCountResponse.IGetDocumentsCountResponseV0} message GetDocumentsCountResponseV0 message or plain object to encode + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.IGetDocumentsResponseV1} message GetDocumentsResponseV1 message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetDocumentsCountResponseV0.encode = function encode(message, writer) { + GetDocumentsResponseV1.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.counts != null && Object.hasOwnProperty.call(message, "counts")) - $root.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.encode(message.counts, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.data != null && Object.hasOwnProperty.call(message, "data")) + $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.encode(message.data, 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")) @@ -22046,38 +21831,38 @@ $root.org = (function() { }; /** - * Encodes the specified GetDocumentsCountResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.verify|verify} messages. + * Encodes the specified GetDocumentsResponseV1 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.verify|verify} messages. * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0 + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1 * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsCountResponse.IGetDocumentsCountResponseV0} message GetDocumentsCountResponseV0 message or plain object to encode + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.IGetDocumentsResponseV1} message GetDocumentsResponseV1 message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetDocumentsCountResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + GetDocumentsResponseV1.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetDocumentsCountResponseV0 message from the specified reader or buffer. + * Decodes a GetDocumentsResponseV1 message from the specified reader or buffer. * @function decode - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0 + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1 * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0} GetDocumentsCountResponseV0 + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1} GetDocumentsResponseV1 * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetDocumentsCountResponseV0.decode = function decode(reader, length) { + GetDocumentsResponseV1.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.counts = $root.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.decode(reader, reader.uint32()); + message.data = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.decode(reader, reader.uint32()); break; case 2: message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); @@ -22094,39 +21879,39 @@ $root.org = (function() { }; /** - * Decodes a GetDocumentsCountResponseV0 message from the specified reader or buffer, length delimited. + * Decodes a GetDocumentsResponseV1 message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0 + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1 * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0} GetDocumentsCountResponseV0 + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1} GetDocumentsResponseV1 * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetDocumentsCountResponseV0.decodeDelimited = function decodeDelimited(reader) { + GetDocumentsResponseV1.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetDocumentsCountResponseV0 message. + * Verifies a GetDocumentsResponseV1 message. * @function verify - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0 + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1 * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetDocumentsCountResponseV0.verify = function verify(message) { + GetDocumentsResponseV1.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; var properties = {}; - if (message.counts != null && message.hasOwnProperty("counts")) { + if (message.data != null && message.hasOwnProperty("data")) { properties.result = 1; { - var error = $root.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.verify(message.counts); + var error = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.verify(message.data); if (error) - return "counts." + error; + return "data." + error; } } if (message.proof != null && message.hasOwnProperty("proof")) { @@ -22138,91 +21923,297 @@ $root.org = (function() { 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; - }; + } + 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 GetDocumentsResponseV1 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1} GetDocumentsResponseV1 + */ + GetDocumentsResponseV1.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1(); + if (object.data != null) { + if (typeof object.data !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.data: object expected"); + message.data = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.fromObject(object.data); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetDocumentsResponseV1 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1 + * @static + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1} message GetDocumentsResponseV1 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDocumentsResponseV1.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.data != null && message.hasOwnProperty("data")) { + object.data = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.toObject(message.data, options); + if (options.oneofs) + object.result = "data"; + } + 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 GetDocumentsResponseV1 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1 + * @instance + * @returns {Object.} JSON object + */ + GetDocumentsResponseV1.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetDocumentsResponseV1.Documents = (function() { + + /** + * Properties of a Documents. + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1 + * @interface IDocuments + * @property {Array.|null} [documents] Documents documents + */ + + /** + * Constructs a new Documents. + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1 + * @classdesc Represents a Documents. + * @implements IDocuments + * @constructor + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.IDocuments=} [properties] Properties to set + */ + function Documents(properties) { + this.documents = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Documents documents. + * @member {Array.} documents + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents + * @instance + */ + Documents.prototype.documents = $util.emptyArray; + + /** + * Creates a new Documents instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents + * @static + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.IDocuments=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents} Documents instance + */ + Documents.create = function create(properties) { + return new Documents(properties); + }; + + /** + * Encodes the specified Documents message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents + * @static + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.IDocuments} message Documents message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Documents.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.documents != null && message.documents.length) + for (var i = 0; i < message.documents.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.documents[i]); + return writer; + }; + + /** + * Encodes the specified Documents message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents + * @static + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.IDocuments} message Documents message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Documents.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Documents message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents} Documents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Documents.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.documents && message.documents.length)) + message.documents = []; + message.documents.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Documents message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents} Documents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Documents.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Documents message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Documents.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.documents != null && message.hasOwnProperty("documents")) { + if (!Array.isArray(message.documents)) + return "documents: array expected"; + for (var i = 0; i < message.documents.length; ++i) + if (!(message.documents[i] && typeof message.documents[i].length === "number" || $util.isString(message.documents[i]))) + return "documents: buffer[] expected"; + } + return null; + }; + + /** + * Creates a Documents message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents} Documents + */ + Documents.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents(); + if (object.documents) { + if (!Array.isArray(object.documents)) + throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents.documents: array expected"); + message.documents = []; + for (var i = 0; i < object.documents.length; ++i) + if (typeof object.documents[i] === "string") + $util.base64.decode(object.documents[i], message.documents[i] = $util.newBuffer($util.base64.length(object.documents[i])), 0); + else if (object.documents[i].length >= 0) + message.documents[i] = object.documents[i]; + } + return message; + }; - /** - * Creates a GetDocumentsCountResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0} GetDocumentsCountResponseV0 - */ - GetDocumentsCountResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0) + /** + * Creates a plain object from a Documents message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents + * @static + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents} message Documents + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Documents.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.documents = []; + if (message.documents && message.documents.length) { + object.documents = []; + for (var j = 0; j < message.documents.length; ++j) + object.documents[j] = options.bytes === String ? $util.base64.encode(message.documents[j], 0, message.documents[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.documents[j]) : message.documents[j]; + } return object; - var message = new $root.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0(); - if (object.counts != null) { - if (typeof object.counts !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.counts: object expected"); - message.counts = $root.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.fromObject(object.counts); - } - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.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.GetDocumentsCountResponse.GetDocumentsCountResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; + }; - /** - * Creates a plain object from a GetDocumentsCountResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0} message GetDocumentsCountResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetDocumentsCountResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.counts != null && message.hasOwnProperty("counts")) { - object.counts = $root.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.toObject(message.counts, options); - if (options.oneofs) - object.result = "counts"; - } - 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 Documents to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents + * @instance + * @returns {Object.} JSON object + */ + Documents.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Converts this GetDocumentsCountResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetDocumentsCountResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return Documents; + })(); - GetDocumentsCountResponseV0.CountEntry = (function() { + GetDocumentsResponseV1.CountEntry = (function() { /** * Properties of a CountEntry. - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0 + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1 * @interface ICountEntry * @property {Uint8Array|null} [inKey] CountEntry inKey * @property {Uint8Array|null} [key] CountEntry key @@ -22231,11 +22222,11 @@ $root.org = (function() { /** * Constructs a new CountEntry. - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0 + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1 * @classdesc Represents a CountEntry. * @implements ICountEntry * @constructor - * @param {org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.ICountEntry=} [properties] Properties to set + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ICountEntry=} [properties] Properties to set */ function CountEntry(properties) { if (properties) @@ -22247,7 +22238,7 @@ $root.org = (function() { /** * CountEntry inKey. * @member {Uint8Array} inKey - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry * @instance */ CountEntry.prototype.inKey = $util.newBuffer([]); @@ -22255,7 +22246,7 @@ $root.org = (function() { /** * CountEntry key. * @member {Uint8Array} key - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry * @instance */ CountEntry.prototype.key = $util.newBuffer([]); @@ -22263,7 +22254,7 @@ $root.org = (function() { /** * CountEntry count. * @member {number|Long} count - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry * @instance */ CountEntry.prototype.count = $util.Long ? $util.Long.fromBits(0,0,true) : 0; @@ -22271,21 +22262,21 @@ $root.org = (function() { /** * Creates a new CountEntry instance using the specified properties. * @function create - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.ICountEntry=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry} CountEntry instance + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ICountEntry=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry} CountEntry instance */ CountEntry.create = function create(properties) { return new CountEntry(properties); }; /** - * Encodes the specified CountEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry.verify|verify} messages. + * Encodes the specified CountEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry.verify|verify} messages. * @function encode - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.ICountEntry} message CountEntry message or plain object to encode + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ICountEntry} message CountEntry message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -22302,11 +22293,11 @@ $root.org = (function() { }; /** - * Encodes the specified CountEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry.verify|verify} messages. + * Encodes the specified CountEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry.verify|verify} messages. * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.ICountEntry} message CountEntry message or plain object to encode + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ICountEntry} message CountEntry message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -22317,18 +22308,18 @@ $root.org = (function() { /** * Decodes a CountEntry message from the specified reader or buffer. * @function decode - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry} CountEntry + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry} CountEntry * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ CountEntry.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -22352,10 +22343,10 @@ $root.org = (function() { /** * Decodes a CountEntry message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry} CountEntry + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry} CountEntry * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -22368,7 +22359,7 @@ $root.org = (function() { /** * Verifies a CountEntry message. * @function verify - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -22391,15 +22382,15 @@ $root.org = (function() { /** * Creates a CountEntry message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry * @static * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry} CountEntry + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry} CountEntry */ CountEntry.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry) + if (object instanceof $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry) return object; - var message = new $root.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry(); + var message = new $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry(); if (object.inKey != null) if (typeof object.inKey === "string") $util.base64.decode(object.inKey, message.inKey = $util.newBuffer($util.base64.length(object.inKey)), 0); @@ -22425,9 +22416,9 @@ $root.org = (function() { /** * Creates a plain object from a CountEntry message. Also converts values to other types if specified. * @function toObject - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry} message CountEntry + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry} message CountEntry * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -22471,7 +22462,7 @@ $root.org = (function() { /** * Converts this CountEntry to JSON. * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry * @instance * @returns {Object.} JSON object */ @@ -22482,22 +22473,22 @@ $root.org = (function() { return CountEntry; })(); - GetDocumentsCountResponseV0.CountEntries = (function() { + GetDocumentsResponseV1.CountEntries = (function() { /** * Properties of a CountEntries. - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0 + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1 * @interface ICountEntries - * @property {Array.|null} [entries] CountEntries entries + * @property {Array.|null} [entries] CountEntries entries */ /** * Constructs a new CountEntries. - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0 + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1 * @classdesc Represents a CountEntries. * @implements ICountEntries * @constructor - * @param {org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.ICountEntries=} [properties] Properties to set + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ICountEntries=} [properties] Properties to set */ function CountEntries(properties) { this.entries = []; @@ -22509,8 +22500,8 @@ $root.org = (function() { /** * CountEntries entries. - * @member {Array.} entries - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries + * @member {Array.} entries + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries * @instance */ CountEntries.prototype.entries = $util.emptyArray; @@ -22518,21 +22509,21 @@ $root.org = (function() { /** * Creates a new CountEntries instance using the specified properties. * @function create - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.ICountEntries=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries} CountEntries instance + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ICountEntries=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries} CountEntries instance */ CountEntries.create = function create(properties) { return new CountEntries(properties); }; /** - * Encodes the specified CountEntries message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries.verify|verify} messages. + * Encodes the specified CountEntries message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries.verify|verify} messages. * @function encode - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.ICountEntries} message CountEntries message or plain object to encode + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ICountEntries} message CountEntries message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -22541,16 +22532,16 @@ $root.org = (function() { writer = $Writer.create(); if (message.entries != null && message.entries.length) for (var i = 0; i < message.entries.length; ++i) - $root.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry.encode(message.entries[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry.encode(message.entries[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified CountEntries message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries.verify|verify} messages. + * Encodes the specified CountEntries message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries.verify|verify} messages. * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.ICountEntries} message CountEntries message or plain object to encode + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ICountEntries} message CountEntries message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -22561,25 +22552,25 @@ $root.org = (function() { /** * Decodes a CountEntries message from the specified reader or buffer. * @function decode - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries} CountEntries + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries} CountEntries * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ CountEntries.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: if (!(message.entries && message.entries.length)) message.entries = []; - message.entries.push($root.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry.decode(reader, reader.uint32())); + message.entries.push($root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -22592,10 +22583,10 @@ $root.org = (function() { /** * Decodes a CountEntries message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries} CountEntries + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries} CountEntries * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -22608,7 +22599,7 @@ $root.org = (function() { /** * Verifies a CountEntries message. * @function verify - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -22620,7 +22611,7 @@ $root.org = (function() { if (!Array.isArray(message.entries)) return "entries: array expected"; for (var i = 0; i < message.entries.length; ++i) { - var error = $root.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry.verify(message.entries[i]); + var error = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry.verify(message.entries[i]); if (error) return "entries." + error; } @@ -22631,23 +22622,23 @@ $root.org = (function() { /** * Creates a CountEntries message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries * @static * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries} CountEntries + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries} CountEntries */ CountEntries.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries) + if (object instanceof $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries) return object; - var message = new $root.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries(); + var message = new $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries(); if (object.entries) { if (!Array.isArray(object.entries)) - throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries.entries: array expected"); + throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries.entries: array expected"); message.entries = []; for (var i = 0; i < object.entries.length; ++i) { if (typeof object.entries[i] !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries.entries: object expected"); - message.entries[i] = $root.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry.fromObject(object.entries[i]); + throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries.entries: object expected"); + message.entries[i] = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry.fromObject(object.entries[i]); } } return message; @@ -22656,9 +22647,9 @@ $root.org = (function() { /** * Creates a plain object from a CountEntries message. Also converts values to other types if specified. * @function toObject - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries} message CountEntries + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries} message CountEntries * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -22671,7 +22662,7 @@ $root.org = (function() { if (message.entries && message.entries.length) { object.entries = []; for (var j = 0; j < message.entries.length; ++j) - object.entries[j] = $root.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry.toObject(message.entries[j], options); + object.entries[j] = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry.toObject(message.entries[j], options); } return object; }; @@ -22679,7 +22670,7 @@ $root.org = (function() { /** * Converts this CountEntries to JSON. * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries * @instance * @returns {Object.} JSON object */ @@ -22690,23 +22681,23 @@ $root.org = (function() { return CountEntries; })(); - GetDocumentsCountResponseV0.CountResults = (function() { + GetDocumentsResponseV1.CountResults = (function() { /** * Properties of a CountResults. - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0 + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1 * @interface ICountResults * @property {number|Long|null} [aggregateCount] CountResults aggregateCount - * @property {org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.ICountEntries|null} [entries] CountResults entries + * @property {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ICountEntries|null} [entries] CountResults entries */ /** * Constructs a new CountResults. - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0 + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1 * @classdesc Represents a CountResults. * @implements ICountResults * @constructor - * @param {org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.ICountResults=} [properties] Properties to set + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ICountResults=} [properties] Properties to set */ function CountResults(properties) { if (properties) @@ -22718,15 +22709,15 @@ $root.org = (function() { /** * CountResults aggregateCount. * @member {number|Long} aggregateCount - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults * @instance */ CountResults.prototype.aggregateCount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; /** * CountResults entries. - * @member {org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.ICountEntries|null|undefined} entries - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults + * @member {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ICountEntries|null|undefined} entries + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults * @instance */ CountResults.prototype.entries = null; @@ -22737,7 +22728,7 @@ $root.org = (function() { /** * CountResults variant. * @member {"aggregateCount"|"entries"|undefined} variant - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults * @instance */ Object.defineProperty(CountResults.prototype, "variant", { @@ -22748,21 +22739,21 @@ $root.org = (function() { /** * Creates a new CountResults instance using the specified properties. * @function create - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.ICountResults=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults} CountResults instance + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ICountResults=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults} CountResults instance */ CountResults.create = function create(properties) { return new CountResults(properties); }; /** - * Encodes the specified CountResults message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.verify|verify} messages. + * Encodes the specified CountResults message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.verify|verify} messages. * @function encode - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.ICountResults} message CountResults message or plain object to encode + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ICountResults} message CountResults message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -22772,16 +22763,16 @@ $root.org = (function() { if (message.aggregateCount != null && Object.hasOwnProperty.call(message, "aggregateCount")) writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.aggregateCount); if (message.entries != null && Object.hasOwnProperty.call(message, "entries")) - $root.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries.encode(message.entries, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries.encode(message.entries, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified CountResults message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.verify|verify} messages. + * Encodes the specified CountResults message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.verify|verify} messages. * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.ICountResults} message CountResults message or plain object to encode + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ICountResults} message CountResults message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -22792,18 +22783,18 @@ $root.org = (function() { /** * Decodes a CountResults message from the specified reader or buffer. * @function decode - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults} CountResults + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults} CountResults * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ CountResults.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -22811,7 +22802,7 @@ $root.org = (function() { message.aggregateCount = reader.uint64(); break; case 2: - message.entries = $root.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries.decode(reader, reader.uint32()); + message.entries = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -22824,10 +22815,10 @@ $root.org = (function() { /** * Decodes a CountResults message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults} CountResults + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults} CountResults * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -22840,7 +22831,7 @@ $root.org = (function() { /** * Verifies a CountResults message. * @function verify - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -22859,7 +22850,7 @@ $root.org = (function() { return "variant: multiple values"; properties.variant = 1; { - var error = $root.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries.verify(message.entries); + var error = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries.verify(message.entries); if (error) return "entries." + error; } @@ -22870,15 +22861,15 @@ $root.org = (function() { /** * Creates a CountResults message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults * @static * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults} CountResults + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults} CountResults */ CountResults.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults) + if (object instanceof $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults) return object; - var message = new $root.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults(); + var message = new $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults(); if (object.aggregateCount != null) if ($util.Long) (message.aggregateCount = $util.Long.fromValue(object.aggregateCount)).unsigned = true; @@ -22890,8 +22881,8 @@ $root.org = (function() { message.aggregateCount = new $util.LongBits(object.aggregateCount.low >>> 0, object.aggregateCount.high >>> 0).toNumber(true); if (object.entries != null) { if (typeof object.entries !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.entries: object expected"); - message.entries = $root.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries.fromObject(object.entries); + throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.entries: object expected"); + message.entries = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries.fromObject(object.entries); } return message; }; @@ -22899,9 +22890,9 @@ $root.org = (function() { /** * Creates a plain object from a CountResults message. Also converts values to other types if specified. * @function toObject - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults} message CountResults + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults} message CountResults * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -22918,7 +22909,7 @@ $root.org = (function() { object.variant = "aggregateCount"; } if (message.entries != null && message.hasOwnProperty("entries")) { - object.entries = $root.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries.toObject(message.entries, options); + object.entries = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries.toObject(message.entries, options); if (options.oneofs) object.variant = "entries"; } @@ -22928,7 +22919,7 @@ $root.org = (function() { /** * Converts this CountResults to JSON. * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults * @instance * @returns {Object.} JSON object */ @@ -22939,10 +22930,255 @@ $root.org = (function() { return CountResults; })(); - return GetDocumentsCountResponseV0; + GetDocumentsResponseV1.ResultData = (function() { + + /** + * Properties of a ResultData. + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1 + * @interface IResultData + * @property {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.IDocuments|null} [documents] ResultData documents + * @property {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ICountResults|null} [counts] ResultData counts + */ + + /** + * Constructs a new ResultData. + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1 + * @classdesc Represents a ResultData. + * @implements IResultData + * @constructor + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.IResultData=} [properties] Properties to set + */ + function ResultData(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResultData documents. + * @member {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.IDocuments|null|undefined} documents + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData + * @instance + */ + ResultData.prototype.documents = null; + + /** + * ResultData counts. + * @member {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ICountResults|null|undefined} counts + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData + * @instance + */ + ResultData.prototype.counts = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ResultData variant. + * @member {"documents"|"counts"|undefined} variant + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData + * @instance + */ + Object.defineProperty(ResultData.prototype, "variant", { + get: $util.oneOfGetter($oneOfFields = ["documents", "counts"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ResultData instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData + * @static + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.IResultData=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData} ResultData instance + */ + ResultData.create = function create(properties) { + return new ResultData(properties); + }; + + /** + * Encodes the specified ResultData message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData + * @static + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.IResultData} message ResultData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResultData.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.documents != null && Object.hasOwnProperty.call(message, "documents")) + $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents.encode(message.documents, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.counts != null && Object.hasOwnProperty.call(message, "counts")) + $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.encode(message.counts, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ResultData message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData + * @static + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.IResultData} message ResultData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResultData.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResultData message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData} ResultData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResultData.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.documents = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents.decode(reader, reader.uint32()); + break; + case 2: + message.counts = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResultData message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData} ResultData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResultData.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResultData message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResultData.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.documents != null && message.hasOwnProperty("documents")) { + properties.variant = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents.verify(message.documents); + if (error) + return "documents." + error; + } + } + if (message.counts != null && message.hasOwnProperty("counts")) { + if (properties.variant === 1) + return "variant: multiple values"; + properties.variant = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.verify(message.counts); + if (error) + return "counts." + error; + } + } + return null; + }; + + /** + * Creates a ResultData message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData} ResultData + */ + ResultData.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData(); + if (object.documents != null) { + if (typeof object.documents !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.documents: object expected"); + message.documents = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents.fromObject(object.documents); + } + if (object.counts != null) { + if (typeof object.counts !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.counts: object expected"); + message.counts = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.fromObject(object.counts); + } + return message; + }; + + /** + * Creates a plain object from a ResultData message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData + * @static + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData} message ResultData + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResultData.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.documents != null && message.hasOwnProperty("documents")) { + object.documents = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents.toObject(message.documents, options); + if (options.oneofs) + object.variant = "documents"; + } + if (message.counts != null && message.hasOwnProperty("counts")) { + object.counts = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.toObject(message.counts, options); + if (options.oneofs) + object.variant = "counts"; + } + return object; + }; + + /** + * Converts this ResultData to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData + * @instance + * @returns {Object.} JSON object + */ + ResultData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResultData; + })(); + + return GetDocumentsResponseV1; })(); - return GetDocumentsCountResponse; + return GetDocumentsResponse; })(); v0.GetIdentityByPublicKeyHashRequest = (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 e17802268c1..2000f5bd1b7 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 @@ -480,37 +480,6 @@ org.dash.platform.dapi.v0.PlatformOuterClass.GetDocumentsResponse> getGetDocumen return getGetDocumentsMethod; } - private static volatile io.grpc.MethodDescriptor getGetDocumentsCountMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "getDocumentsCount", - requestType = org.dash.platform.dapi.v0.PlatformOuterClass.GetDocumentsCountRequest.class, - responseType = org.dash.platform.dapi.v0.PlatformOuterClass.GetDocumentsCountResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getGetDocumentsCountMethod() { - io.grpc.MethodDescriptor getGetDocumentsCountMethod; - if ((getGetDocumentsCountMethod = PlatformGrpc.getGetDocumentsCountMethod) == null) { - synchronized (PlatformGrpc.class) { - if ((getGetDocumentsCountMethod = PlatformGrpc.getGetDocumentsCountMethod) == null) { - PlatformGrpc.getGetDocumentsCountMethod = getGetDocumentsCountMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "getDocumentsCount")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - org.dash.platform.dapi.v0.PlatformOuterClass.GetDocumentsCountRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - org.dash.platform.dapi.v0.PlatformOuterClass.GetDocumentsCountResponse.getDefaultInstance())) - .setSchemaDescriptor(new PlatformMethodDescriptorSupplier("getDocumentsCount")) - .build(); - } - } - } - return getGetDocumentsCountMethod; - } - private static volatile io.grpc.MethodDescriptor getGetIdentityByPublicKeyHashMethod; @@ -2125,13 +2094,13 @@ public void getDocuments(org.dash.platform.dapi.v0.PlatformOuterClass.GetDocumen } /** - */ - public void getDocumentsCount(org.dash.platform.dapi.v0.PlatformOuterClass.GetDocumentsCountRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetDocumentsCountMethod(), responseObserver); - } - - /** + *
+     * `getDocumentsCount` removed in v1: callers express counts via
+     * `getDocuments` with `version.v1.select = COUNT` (optionally
+     * with `group_by`). See `GetDocumentsRequestV1` for the unified
+     * SQL-shaped surface. The v0-count endpoint shipped briefly in
+     * #3623 and never had stable callers; v1 supersedes it entirely.
+     * 
*/ public void getIdentityByPublicKeyHash(org.dash.platform.dapi.v0.PlatformOuterClass.GetIdentityByPublicKeyHashRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -2585,13 +2554,6 @@ public void getRecentCompactedNullifierChanges(org.dash.platform.dapi.v0.Platfor org.dash.platform.dapi.v0.PlatformOuterClass.GetDocumentsRequest, org.dash.platform.dapi.v0.PlatformOuterClass.GetDocumentsResponse>( this, METHODID_GET_DOCUMENTS))) - .addMethod( - getGetDocumentsCountMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - org.dash.platform.dapi.v0.PlatformOuterClass.GetDocumentsCountRequest, - org.dash.platform.dapi.v0.PlatformOuterClass.GetDocumentsCountResponse>( - this, METHODID_GET_DOCUMENTS_COUNT))) .addMethod( getGetIdentityByPublicKeyHashMethod(), io.grpc.stub.ServerCalls.asyncUnaryCall( @@ -3063,14 +3025,13 @@ public void getDocuments(org.dash.platform.dapi.v0.PlatformOuterClass.GetDocumen } /** - */ - public void getDocumentsCount(org.dash.platform.dapi.v0.PlatformOuterClass.GetDocumentsCountRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getGetDocumentsCountMethod(), getCallOptions()), request, responseObserver); - } - - /** + *
+     * `getDocumentsCount` removed in v1: callers express counts via
+     * `getDocuments` with `version.v1.select = COUNT` (optionally
+     * with `group_by`). See `GetDocumentsRequestV1` for the unified
+     * SQL-shaped surface. The v0-count endpoint shipped briefly in
+     * #3623 and never had stable callers; v1 supersedes it entirely.
+     * 
*/ public void getIdentityByPublicKeyHash(org.dash.platform.dapi.v0.PlatformOuterClass.GetIdentityByPublicKeyHashRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -3588,13 +3549,13 @@ public org.dash.platform.dapi.v0.PlatformOuterClass.GetDocumentsResponse getDocu } /** - */ - public org.dash.platform.dapi.v0.PlatformOuterClass.GetDocumentsCountResponse getDocumentsCount(org.dash.platform.dapi.v0.PlatformOuterClass.GetDocumentsCountRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getGetDocumentsCountMethod(), getCallOptions(), request); - } - - /** + *
+     * `getDocumentsCount` removed in v1: callers express counts via
+     * `getDocuments` with `version.v1.select = COUNT` (optionally
+     * with `group_by`). See `GetDocumentsRequestV1` for the unified
+     * SQL-shaped surface. The v0-count endpoint shipped briefly in
+     * #3623 and never had stable callers; v1 supersedes it entirely.
+     * 
*/ public org.dash.platform.dapi.v0.PlatformOuterClass.GetIdentityByPublicKeyHashResponse getIdentityByPublicKeyHash(org.dash.platform.dapi.v0.PlatformOuterClass.GetIdentityByPublicKeyHashRequest request) { return io.grpc.stub.ClientCalls.blockingUnaryCall( @@ -4080,14 +4041,13 @@ public com.google.common.util.concurrent.ListenableFuture getDocumentsCount( - org.dash.platform.dapi.v0.PlatformOuterClass.GetDocumentsCountRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getGetDocumentsCountMethod(), getCallOptions()), request); - } - - /** + *
+     * `getDocumentsCount` removed in v1: callers express counts via
+     * `getDocuments` with `version.v1.select = COUNT` (optionally
+     * with `group_by`). See `GetDocumentsRequestV1` for the unified
+     * SQL-shaped surface. The v0-count endpoint shipped briefly in
+     * #3623 and never had stable callers; v1 supersedes it entirely.
+     * 
*/ public com.google.common.util.concurrent.ListenableFuture getIdentityByPublicKeyHash( org.dash.platform.dapi.v0.PlatformOuterClass.GetIdentityByPublicKeyHashRequest request) { @@ -4497,54 +4457,53 @@ public com.google.common.util.concurrent.ListenableFuture implements io.grpc.stub.ServerCalls.UnaryMethod, @@ -4623,10 +4582,6 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv serviceImpl.getDocuments((org.dash.platform.dapi.v0.PlatformOuterClass.GetDocumentsRequest) request, (io.grpc.stub.StreamObserver) responseObserver); break; - case METHODID_GET_DOCUMENTS_COUNT: - serviceImpl.getDocumentsCount((org.dash.platform.dapi.v0.PlatformOuterClass.GetDocumentsCountRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; case METHODID_GET_IDENTITY_BY_PUBLIC_KEY_HASH: serviceImpl.getIdentityByPublicKeyHash((org.dash.platform.dapi.v0.PlatformOuterClass.GetIdentityByPublicKeyHashRequest) request, (io.grpc.stub.StreamObserver) responseObserver); @@ -4891,7 +4846,6 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { .addMethod(getGetDataContractHistoryMethod()) .addMethod(getGetDataContractsMethod()) .addMethod(getGetDocumentsMethod()) - .addMethod(getGetDocumentsCountMethod()) .addMethod(getGetIdentityByPublicKeyHashMethod()) .addMethod(getGetIdentityByNonUniquePublicKeyHashMethod()) .addMethod(getWaitForStateTransitionResultMethod()) 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 f4ef49f1d2b..d3559ff1efb 100644 --- a/packages/dapi-grpc/clients/platform/v0/nodejs/platform_pbjs.js +++ b/packages/dapi-grpc/clients/platform/v0/nodejs/platform_pbjs.js @@ -581,39 +581,6 @@ $root.org = (function() { * @variation 2 */ - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getDocumentsCount}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getDocumentsCountCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetDocumentsCountResponse} [response] GetDocumentsCountResponse - */ - - /** - * Calls getDocumentsCount. - * @function getDocumentsCount - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetDocumentsCountRequest} request GetDocumentsCountRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getDocumentsCountCallback} callback Node-style callback called with the error, if any, and GetDocumentsCountResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getDocumentsCount = function getDocumentsCount(request, callback) { - return this.rpcCall(getDocumentsCount, $root.org.dash.platform.dapi.v0.GetDocumentsCountRequest, $root.org.dash.platform.dapi.v0.GetDocumentsCountResponse, request, callback); - }, "name", { value: "getDocumentsCount" }); - - /** - * Calls getDocumentsCount. - * @function getDocumentsCount - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetDocumentsCountRequest} request GetDocumentsCountRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - /** * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getIdentityByPublicKeyHash}. * @memberof org.dash.platform.dapi.v0.Platform @@ -19380,6 +19347,7 @@ $root.org = (function() { * @memberof org.dash.platform.dapi.v0 * @interface IGetDocumentsRequest * @property {org.dash.platform.dapi.v0.GetDocumentsRequest.IGetDocumentsRequestV0|null} [v0] GetDocumentsRequest v0 + * @property {org.dash.platform.dapi.v0.GetDocumentsRequest.IGetDocumentsRequestV1|null} [v1] GetDocumentsRequest v1 */ /** @@ -19405,17 +19373,25 @@ $root.org = (function() { */ GetDocumentsRequest.prototype.v0 = null; + /** + * GetDocumentsRequest v1. + * @member {org.dash.platform.dapi.v0.GetDocumentsRequest.IGetDocumentsRequestV1|null|undefined} v1 + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest + * @instance + */ + GetDocumentsRequest.prototype.v1 = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; /** * GetDocumentsRequest version. - * @member {"v0"|undefined} version + * @member {"v0"|"v1"|undefined} version * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest * @instance */ Object.defineProperty(GetDocumentsRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), + get: $util.oneOfGetter($oneOfFields = ["v0", "v1"]), set: $util.oneOfSetter($oneOfFields) }); @@ -19445,6 +19421,8 @@ $root.org = (function() { writer = $Writer.create(); if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) $root.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.v1 != null && Object.hasOwnProperty.call(message, "v1")) + $root.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.encode(message.v1, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -19482,6 +19460,9 @@ $root.org = (function() { case 1: message.v0 = $root.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0.decode(reader, reader.uint32()); break; + case 2: + message.v1 = $root.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -19526,6 +19507,16 @@ $root.org = (function() { return "v0." + error; } } + if (message.v1 != null && message.hasOwnProperty("v1")) { + if (properties.version === 1) + return "version: multiple values"; + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.verify(message.v1); + if (error) + return "v1." + error; + } + } return null; }; @@ -19546,6 +19537,11 @@ $root.org = (function() { throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsRequest.v0: object expected"); message.v0 = $root.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0.fromObject(object.v0); } + if (object.v1 != null) { + if (typeof object.v1 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsRequest.v1: object expected"); + message.v1 = $root.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.fromObject(object.v1); + } return message; }; @@ -19567,6 +19563,11 @@ $root.org = (function() { if (options.oneofs) object.version = "v0"; } + if (message.v1 != null && message.hasOwnProperty("v1")) { + object.v1 = $root.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.toObject(message.v1, options); + if (options.oneofs) + object.version = "v1"; + } return object; }; @@ -19981,353 +19982,258 @@ $root.org = (function() { return GetDocumentsRequestV0; })(); - return GetDocumentsRequest; - })(); + GetDocumentsRequest.GetDocumentsRequestV1 = (function() { - v0.GetDocumentsResponse = (function() { + /** + * Properties of a GetDocumentsRequestV1. + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest + * @interface IGetDocumentsRequestV1 + * @property {Uint8Array|null} [dataContractId] GetDocumentsRequestV1 dataContractId + * @property {string|null} [documentType] GetDocumentsRequestV1 documentType + * @property {Uint8Array|null} [where] GetDocumentsRequestV1 where + * @property {Uint8Array|null} [orderBy] GetDocumentsRequestV1 orderBy + * @property {number|null} [limit] GetDocumentsRequestV1 limit + * @property {Uint8Array|null} [startAfter] GetDocumentsRequestV1 startAfter + * @property {Uint8Array|null} [startAt] GetDocumentsRequestV1 startAt + * @property {boolean|null} [prove] GetDocumentsRequestV1 prove + * @property {org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.Select|null} [select] GetDocumentsRequestV1 select + * @property {Array.|null} [groupBy] GetDocumentsRequestV1 groupBy + * @property {Uint8Array|null} [having] GetDocumentsRequestV1 having + */ + + /** + * Constructs a new GetDocumentsRequestV1. + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest + * @classdesc Represents a GetDocumentsRequestV1. + * @implements IGetDocumentsRequestV1 + * @constructor + * @param {org.dash.platform.dapi.v0.GetDocumentsRequest.IGetDocumentsRequestV1=} [properties] Properties to set + */ + function GetDocumentsRequestV1(properties) { + this.groupBy = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Properties of a GetDocumentsResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetDocumentsResponse - * @property {org.dash.platform.dapi.v0.GetDocumentsResponse.IGetDocumentsResponseV0|null} [v0] GetDocumentsResponse v0 - */ + /** + * GetDocumentsRequestV1 dataContractId. + * @member {Uint8Array} dataContractId + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1 + * @instance + */ + GetDocumentsRequestV1.prototype.dataContractId = $util.newBuffer([]); - /** - * Constructs a new GetDocumentsResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetDocumentsResponse. - * @implements IGetDocumentsResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetDocumentsResponse=} [properties] Properties to set - */ - function GetDocumentsResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * GetDocumentsRequestV1 documentType. + * @member {string} documentType + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1 + * @instance + */ + GetDocumentsRequestV1.prototype.documentType = ""; - /** - * GetDocumentsResponse v0. - * @member {org.dash.platform.dapi.v0.GetDocumentsResponse.IGetDocumentsResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse - * @instance - */ - GetDocumentsResponse.prototype.v0 = null; + /** + * GetDocumentsRequestV1 where. + * @member {Uint8Array} where + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1 + * @instance + */ + GetDocumentsRequestV1.prototype.where = $util.newBuffer([]); - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * GetDocumentsRequestV1 orderBy. + * @member {Uint8Array} orderBy + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1 + * @instance + */ + GetDocumentsRequestV1.prototype.orderBy = $util.newBuffer([]); - /** - * GetDocumentsResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse - * @instance - */ - Object.defineProperty(GetDocumentsResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); + /** + * GetDocumentsRequestV1 limit. + * @member {number} limit + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1 + * @instance + */ + GetDocumentsRequestV1.prototype.limit = 0; - /** - * Creates a new GetDocumentsResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetDocumentsResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse} GetDocumentsResponse instance - */ - GetDocumentsResponse.create = function create(properties) { - return new GetDocumentsResponse(properties); - }; + /** + * GetDocumentsRequestV1 startAfter. + * @member {Uint8Array} startAfter + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1 + * @instance + */ + GetDocumentsRequestV1.prototype.startAfter = $util.newBuffer([]); - /** - * Encodes the specified GetDocumentsResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetDocumentsResponse} message GetDocumentsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDocumentsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; + /** + * GetDocumentsRequestV1 startAt. + * @member {Uint8Array} startAt + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1 + * @instance + */ + GetDocumentsRequestV1.prototype.startAt = $util.newBuffer([]); - /** - * Encodes the specified GetDocumentsResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetDocumentsResponse} message GetDocumentsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDocumentsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * GetDocumentsRequestV1 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1 + * @instance + */ + GetDocumentsRequestV1.prototype.prove = false; - /** - * Decodes a GetDocumentsResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse} GetDocumentsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDocumentsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDocumentsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * GetDocumentsRequestV1 select. + * @member {org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.Select} select + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1 + * @instance + */ + GetDocumentsRequestV1.prototype.select = 0; - /** - * Decodes a GetDocumentsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse} GetDocumentsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDocumentsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * GetDocumentsRequestV1 groupBy. + * @member {Array.} groupBy + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1 + * @instance + */ + GetDocumentsRequestV1.prototype.groupBy = $util.emptyArray; - /** - * Verifies a GetDocumentsResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetDocumentsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; + /** + * GetDocumentsRequestV1 having. + * @member {Uint8Array} having + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1 + * @instance + */ + GetDocumentsRequestV1.prototype.having = $util.newBuffer([]); - /** - * Creates a GetDocumentsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse} GetDocumentsResponse - */ - GetDocumentsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetDocumentsResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetDocumentsResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetDocumentsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse - * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsResponse} message GetDocumentsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetDocumentsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetDocumentsResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse - * @instance - * @returns {Object.} JSON object - */ - GetDocumentsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetDocumentsResponse.GetDocumentsResponseV0 = (function() { - - /** - * Properties of a GetDocumentsResponseV0. - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse - * @interface IGetDocumentsResponseV0 - * @property {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.IDocuments|null} [documents] GetDocumentsResponseV0 documents - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetDocumentsResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetDocumentsResponseV0 metadata - */ - - /** - * Constructs a new GetDocumentsResponseV0. - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse - * @classdesc Represents a GetDocumentsResponseV0. - * @implements IGetDocumentsResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.IGetDocumentsResponseV0=} [properties] Properties to set - */ - function GetDocumentsResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetDocumentsResponseV0 documents. - * @member {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.IDocuments|null|undefined} documents - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 - * @instance - */ - GetDocumentsResponseV0.prototype.documents = null; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * GetDocumentsResponseV0 proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 - * @instance - */ - GetDocumentsResponseV0.prototype.proof = null; - - /** - * GetDocumentsResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 - * @instance - */ - GetDocumentsResponseV0.prototype.metadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetDocumentsResponseV0 result. - * @member {"documents"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 + * GetDocumentsRequestV1 start. + * @member {"startAfter"|"startAt"|undefined} start + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1 * @instance */ - Object.defineProperty(GetDocumentsResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["documents", "proof"]), + Object.defineProperty(GetDocumentsRequestV1.prototype, "start", { + get: $util.oneOfGetter($oneOfFields = ["startAfter", "startAt"]), set: $util.oneOfSetter($oneOfFields) }); /** - * Creates a new GetDocumentsResponseV0 instance using the specified properties. + * Creates a new GetDocumentsRequestV1 instance using the specified properties. * @function create - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1 * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.IGetDocumentsResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} GetDocumentsResponseV0 instance + * @param {org.dash.platform.dapi.v0.GetDocumentsRequest.IGetDocumentsRequestV1=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1} GetDocumentsRequestV1 instance */ - GetDocumentsResponseV0.create = function create(properties) { - return new GetDocumentsResponseV0(properties); + GetDocumentsRequestV1.create = function create(properties) { + return new GetDocumentsRequestV1(properties); }; /** - * Encodes the specified GetDocumentsResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.verify|verify} messages. + * Encodes the specified GetDocumentsRequestV1 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.verify|verify} messages. * @function encode - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1 * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.IGetDocumentsResponseV0} message GetDocumentsResponseV0 message or plain object to encode + * @param {org.dash.platform.dapi.v0.GetDocumentsRequest.IGetDocumentsRequestV1} message GetDocumentsRequestV1 message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetDocumentsResponseV0.encode = function encode(message, writer) { + GetDocumentsRequestV1.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.documents != null && Object.hasOwnProperty.call(message, "documents")) - $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.encode(message.documents, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.dataContractId != null && Object.hasOwnProperty.call(message, "dataContractId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.dataContractId); + if (message.documentType != null && Object.hasOwnProperty.call(message, "documentType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.documentType); + if (message.where != null && Object.hasOwnProperty.call(message, "where")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.where); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.orderBy); + if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) + writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.limit); + if (message.startAfter != null && Object.hasOwnProperty.call(message, "startAfter")) + writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.startAfter); + if (message.startAt != null && Object.hasOwnProperty.call(message, "startAt")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.startAt); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.prove); + if (message.select != null && Object.hasOwnProperty.call(message, "select")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.select); + if (message.groupBy != null && message.groupBy.length) + for (var i = 0; i < message.groupBy.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.groupBy[i]); + if (message.having != null && Object.hasOwnProperty.call(message, "having")) + writer.uint32(/* id 11, wireType 2 =*/90).bytes(message.having); return writer; }; /** - * Encodes the specified GetDocumentsResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.verify|verify} messages. + * Encodes the specified GetDocumentsRequestV1 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.verify|verify} messages. * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1 * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.IGetDocumentsResponseV0} message GetDocumentsResponseV0 message or plain object to encode + * @param {org.dash.platform.dapi.v0.GetDocumentsRequest.IGetDocumentsRequestV1} message GetDocumentsRequestV1 message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetDocumentsResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + GetDocumentsRequestV1.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetDocumentsResponseV0 message from the specified reader or buffer. + * Decodes a GetDocumentsRequestV1 message from the specified reader or buffer. * @function decode - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1 * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} GetDocumentsResponseV0 + * @returns {org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1} GetDocumentsRequestV1 * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetDocumentsResponseV0.decode = function decode(reader, length) { + GetDocumentsRequestV1.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.documents = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.decode(reader, reader.uint32()); + message.dataContractId = reader.bytes(); break; case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + message.documentType = reader.string(); break; case 3: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + message.where = reader.bytes(); + break; + case 4: + message.orderBy = reader.bytes(); + break; + case 5: + message.limit = reader.uint32(); + break; + case 6: + message.startAfter = reader.bytes(); + break; + case 7: + message.startAt = reader.bytes(); + break; + case 8: + message.prove = reader.bool(); + break; + case 9: + message.select = reader.int32(); + break; + case 10: + if (!(message.groupBy && message.groupBy.length)) + message.groupBy = []; + message.groupBy.push(reader.string()); + break; + case 11: + message.having = reader.bytes(); break; default: reader.skipType(tag & 7); @@ -20338,450 +20244,388 @@ $root.org = (function() { }; /** - * Decodes a GetDocumentsResponseV0 message from the specified reader or buffer, length delimited. + * Decodes a GetDocumentsRequestV1 message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1 * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} GetDocumentsResponseV0 + * @returns {org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1} GetDocumentsRequestV1 * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetDocumentsResponseV0.decodeDelimited = function decodeDelimited(reader) { + GetDocumentsRequestV1.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetDocumentsResponseV0 message. + * Verifies a GetDocumentsRequestV1 message. * @function verify - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1 * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetDocumentsResponseV0.verify = function verify(message) { + GetDocumentsRequestV1.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; var properties = {}; - if (message.documents != null && message.hasOwnProperty("documents")) { - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.verify(message.documents); - if (error) - return "documents." + error; - } + if (message.dataContractId != null && message.hasOwnProperty("dataContractId")) + if (!(message.dataContractId && typeof message.dataContractId.length === "number" || $util.isString(message.dataContractId))) + return "dataContractId: buffer expected"; + if (message.documentType != null && message.hasOwnProperty("documentType")) + if (!$util.isString(message.documentType)) + return "documentType: string expected"; + if (message.where != null && message.hasOwnProperty("where")) + if (!(message.where && typeof message.where.length === "number" || $util.isString(message.where))) + return "where: buffer expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!(message.orderBy && typeof message.orderBy.length === "number" || $util.isString(message.orderBy))) + return "orderBy: buffer expected"; + if (message.limit != null && message.hasOwnProperty("limit")) + if (!$util.isInteger(message.limit)) + return "limit: integer expected"; + if (message.startAfter != null && message.hasOwnProperty("startAfter")) { + properties.start = 1; + if (!(message.startAfter && typeof message.startAfter.length === "number" || $util.isString(message.startAfter))) + return "startAfter: buffer expected"; } - if (message.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.startAt != null && message.hasOwnProperty("startAt")) { + if (properties.start === 1) + return "start: multiple values"; + properties.start = 1; + if (!(message.startAt && typeof message.startAt.length === "number" || $util.isString(message.startAt))) + return "startAt: buffer expected"; } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + if (message.select != null && message.hasOwnProperty("select")) + switch (message.select) { + default: + return "select: enum value expected"; + case 0: + case 1: + break; + } + if (message.groupBy != null && message.hasOwnProperty("groupBy")) { + if (!Array.isArray(message.groupBy)) + return "groupBy: array expected"; + for (var i = 0; i < message.groupBy.length; ++i) + if (!$util.isString(message.groupBy[i])) + return "groupBy: string[] expected"; } + if (message.having != null && message.hasOwnProperty("having")) + if (!(message.having && typeof message.having.length === "number" || $util.isString(message.having))) + return "having: buffer expected"; return null; }; /** - * Creates a GetDocumentsResponseV0 message from a plain object. Also converts values to their respective internal types. + * Creates a GetDocumentsRequestV1 message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1 * @static * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} GetDocumentsResponseV0 + * @returns {org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1} GetDocumentsRequestV1 */ - GetDocumentsResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0) + GetDocumentsRequestV1.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1) return object; - var message = new $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0(); - if (object.documents != null) { - if (typeof object.documents !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.documents: object expected"); - message.documents = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.fromObject(object.documents); - } - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetDocumentsResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} message GetDocumentsResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetDocumentsResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.documents != null && message.hasOwnProperty("documents")) { - object.documents = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.toObject(message.documents, options); + var message = new $root.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1(); + if (object.dataContractId != null) + if (typeof object.dataContractId === "string") + $util.base64.decode(object.dataContractId, message.dataContractId = $util.newBuffer($util.base64.length(object.dataContractId)), 0); + else if (object.dataContractId.length >= 0) + message.dataContractId = object.dataContractId; + if (object.documentType != null) + message.documentType = String(object.documentType); + if (object.where != null) + if (typeof object.where === "string") + $util.base64.decode(object.where, message.where = $util.newBuffer($util.base64.length(object.where)), 0); + else if (object.where.length >= 0) + message.where = object.where; + if (object.orderBy != null) + if (typeof object.orderBy === "string") + $util.base64.decode(object.orderBy, message.orderBy = $util.newBuffer($util.base64.length(object.orderBy)), 0); + else if (object.orderBy.length >= 0) + message.orderBy = object.orderBy; + if (object.limit != null) + message.limit = object.limit >>> 0; + if (object.startAfter != null) + if (typeof object.startAfter === "string") + $util.base64.decode(object.startAfter, message.startAfter = $util.newBuffer($util.base64.length(object.startAfter)), 0); + else if (object.startAfter.length >= 0) + message.startAfter = object.startAfter; + if (object.startAt != null) + if (typeof object.startAt === "string") + $util.base64.decode(object.startAt, message.startAt = $util.newBuffer($util.base64.length(object.startAt)), 0); + else if (object.startAt.length >= 0) + message.startAt = object.startAt; + if (object.prove != null) + message.prove = Boolean(object.prove); + switch (object.select) { + case "DOCUMENTS": + case 0: + message.select = 0; + break; + case "COUNT": + case 1: + message.select = 1; + break; + } + if (object.groupBy) { + if (!Array.isArray(object.groupBy)) + throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.groupBy: array expected"); + message.groupBy = []; + for (var i = 0; i < object.groupBy.length; ++i) + message.groupBy[i] = String(object.groupBy[i]); + } + if (object.having != null) + if (typeof object.having === "string") + $util.base64.decode(object.having, message.having = $util.newBuffer($util.base64.length(object.having)), 0); + else if (object.having.length >= 0) + message.having = object.having; + return message; + }; + + /** + * Creates a plain object from a GetDocumentsRequestV1 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1 + * @static + * @param {org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1} message GetDocumentsRequestV1 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDocumentsRequestV1.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.groupBy = []; + if (options.defaults) { + if (options.bytes === String) + object.dataContractId = ""; + else { + object.dataContractId = []; + if (options.bytes !== Array) + object.dataContractId = $util.newBuffer(object.dataContractId); + } + object.documentType = ""; + if (options.bytes === String) + object.where = ""; + else { + object.where = []; + if (options.bytes !== Array) + object.where = $util.newBuffer(object.where); + } + if (options.bytes === String) + object.orderBy = ""; + else { + object.orderBy = []; + if (options.bytes !== Array) + object.orderBy = $util.newBuffer(object.orderBy); + } + object.limit = 0; + object.prove = false; + object.select = options.enums === String ? "DOCUMENTS" : 0; + if (options.bytes === String) + object.having = ""; + else { + object.having = []; + if (options.bytes !== Array) + object.having = $util.newBuffer(object.having); + } + } + if (message.dataContractId != null && message.hasOwnProperty("dataContractId")) + object.dataContractId = options.bytes === String ? $util.base64.encode(message.dataContractId, 0, message.dataContractId.length) : options.bytes === Array ? Array.prototype.slice.call(message.dataContractId) : message.dataContractId; + if (message.documentType != null && message.hasOwnProperty("documentType")) + object.documentType = message.documentType; + if (message.where != null && message.hasOwnProperty("where")) + object.where = options.bytes === String ? $util.base64.encode(message.where, 0, message.where.length) : options.bytes === Array ? Array.prototype.slice.call(message.where) : message.where; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = options.bytes === String ? $util.base64.encode(message.orderBy, 0, message.orderBy.length) : options.bytes === Array ? Array.prototype.slice.call(message.orderBy) : message.orderBy; + if (message.limit != null && message.hasOwnProperty("limit")) + object.limit = message.limit; + if (message.startAfter != null && message.hasOwnProperty("startAfter")) { + object.startAfter = options.bytes === String ? $util.base64.encode(message.startAfter, 0, message.startAfter.length) : options.bytes === Array ? Array.prototype.slice.call(message.startAfter) : message.startAfter; if (options.oneofs) - object.result = "documents"; + object.start = "startAfter"; } - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (message.startAt != null && message.hasOwnProperty("startAt")) { + object.startAt = options.bytes === String ? $util.base64.encode(message.startAt, 0, message.startAt.length) : options.bytes === Array ? Array.prototype.slice.call(message.startAt) : message.startAt; if (options.oneofs) - object.result = "proof"; + object.start = "startAt"; } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + if (message.select != null && message.hasOwnProperty("select")) + object.select = options.enums === String ? $root.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.Select[message.select] : message.select; + if (message.groupBy && message.groupBy.length) { + object.groupBy = []; + for (var j = 0; j < message.groupBy.length; ++j) + object.groupBy[j] = message.groupBy[j]; + } + if (message.having != null && message.hasOwnProperty("having")) + object.having = options.bytes === String ? $util.base64.encode(message.having, 0, message.having.length) : options.bytes === Array ? Array.prototype.slice.call(message.having) : message.having; return object; }; /** - * Converts this GetDocumentsResponseV0 to JSON. + * Converts this GetDocumentsRequestV1 to JSON. * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1 * @instance * @returns {Object.} JSON object */ - GetDocumentsResponseV0.prototype.toJSON = function toJSON() { + GetDocumentsRequestV1.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - GetDocumentsResponseV0.Documents = (function() { + /** + * Select enum. + * @name org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.Select + * @enum {number} + * @property {number} DOCUMENTS=0 DOCUMENTS value + * @property {number} COUNT=1 COUNT value + */ + GetDocumentsRequestV1.Select = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DOCUMENTS"] = 0; + values[valuesById[1] = "COUNT"] = 1; + return values; + })(); - /** - * Properties of a Documents. - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 - * @interface IDocuments - * @property {Array.|null} [documents] Documents documents - */ + return GetDocumentsRequestV1; + })(); - /** - * Constructs a new Documents. - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 - * @classdesc Represents a Documents. - * @implements IDocuments - * @constructor - * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.IDocuments=} [properties] Properties to set - */ - function Documents(properties) { - this.documents = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + return GetDocumentsRequest; + })(); - /** - * Documents documents. - * @member {Array.} documents - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents - * @instance - */ - Documents.prototype.documents = $util.emptyArray; + v0.GetDocumentsResponse = (function() { - /** - * Creates a new Documents instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents - * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.IDocuments=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} Documents instance - */ - Documents.create = function create(properties) { - return new Documents(properties); - }; + /** + * Properties of a GetDocumentsResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetDocumentsResponse + * @property {org.dash.platform.dapi.v0.GetDocumentsResponse.IGetDocumentsResponseV0|null} [v0] GetDocumentsResponse v0 + * @property {org.dash.platform.dapi.v0.GetDocumentsResponse.IGetDocumentsResponseV1|null} [v1] GetDocumentsResponse v1 + */ - /** - * Encodes the specified Documents message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents - * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.IDocuments} message Documents message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Documents.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.documents != null && message.documents.length) - for (var i = 0; i < message.documents.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.documents[i]); - return writer; - }; + /** + * Constructs a new GetDocumentsResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetDocumentsResponse. + * @implements IGetDocumentsResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetDocumentsResponse=} [properties] Properties to set + */ + function GetDocumentsResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Encodes the specified Documents message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents - * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.IDocuments} message Documents message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Documents.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * GetDocumentsResponse v0. + * @member {org.dash.platform.dapi.v0.GetDocumentsResponse.IGetDocumentsResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse + * @instance + */ + GetDocumentsResponse.prototype.v0 = null; - /** - * Decodes a Documents message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} Documents - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Documents.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.documents && message.documents.length)) - message.documents = []; - message.documents.push(reader.bytes()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Documents message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} Documents - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Documents.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Documents message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Documents.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.documents != null && message.hasOwnProperty("documents")) { - if (!Array.isArray(message.documents)) - return "documents: array expected"; - for (var i = 0; i < message.documents.length; ++i) - if (!(message.documents[i] && typeof message.documents[i].length === "number" || $util.isString(message.documents[i]))) - return "documents: buffer[] expected"; - } - return null; - }; - - /** - * Creates a Documents message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} Documents - */ - Documents.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents(); - if (object.documents) { - if (!Array.isArray(object.documents)) - throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.documents: array expected"); - message.documents = []; - for (var i = 0; i < object.documents.length; ++i) - if (typeof object.documents[i] === "string") - $util.base64.decode(object.documents[i], message.documents[i] = $util.newBuffer($util.base64.length(object.documents[i])), 0); - else if (object.documents[i].length >= 0) - message.documents[i] = object.documents[i]; - } - return message; - }; - - /** - * Creates a plain object from a Documents message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents - * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} message Documents - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Documents.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.documents = []; - if (message.documents && message.documents.length) { - object.documents = []; - for (var j = 0; j < message.documents.length; ++j) - object.documents[j] = options.bytes === String ? $util.base64.encode(message.documents[j], 0, message.documents[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.documents[j]) : message.documents[j]; - } - return object; - }; - - /** - * Converts this Documents to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents - * @instance - * @returns {Object.} JSON object - */ - Documents.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Documents; - })(); - - return GetDocumentsResponseV0; - })(); - - return GetDocumentsResponse; - })(); - - v0.GetDocumentsCountRequest = (function() { - - /** - * Properties of a GetDocumentsCountRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetDocumentsCountRequest - * @property {org.dash.platform.dapi.v0.GetDocumentsCountRequest.IGetDocumentsCountRequestV0|null} [v0] GetDocumentsCountRequest v0 - */ - - /** - * Constructs a new GetDocumentsCountRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetDocumentsCountRequest. - * @implements IGetDocumentsCountRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetDocumentsCountRequest=} [properties] Properties to set - */ - function GetDocumentsCountRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetDocumentsCountRequest v0. - * @member {org.dash.platform.dapi.v0.GetDocumentsCountRequest.IGetDocumentsCountRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountRequest - * @instance - */ - GetDocumentsCountRequest.prototype.v0 = null; + /** + * GetDocumentsResponse v1. + * @member {org.dash.platform.dapi.v0.GetDocumentsResponse.IGetDocumentsResponseV1|null|undefined} v1 + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse + * @instance + */ + GetDocumentsResponse.prototype.v1 = null; // OneOf field names bound to virtual getters and setters var $oneOfFields; /** - * GetDocumentsCountRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountRequest + * GetDocumentsResponse version. + * @member {"v0"|"v1"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse * @instance */ - Object.defineProperty(GetDocumentsCountRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), + Object.defineProperty(GetDocumentsResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0", "v1"]), set: $util.oneOfSetter($oneOfFields) }); /** - * Creates a new GetDocumentsCountRequest instance using the specified properties. + * Creates a new GetDocumentsResponse instance using the specified properties. * @function create - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountRequest + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse * @static - * @param {org.dash.platform.dapi.v0.IGetDocumentsCountRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetDocumentsCountRequest} GetDocumentsCountRequest instance + * @param {org.dash.platform.dapi.v0.IGetDocumentsResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse} GetDocumentsResponse instance */ - GetDocumentsCountRequest.create = function create(properties) { - return new GetDocumentsCountRequest(properties); + GetDocumentsResponse.create = function create(properties) { + return new GetDocumentsResponse(properties); }; /** - * Encodes the specified GetDocumentsCountRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsCountRequest.verify|verify} messages. + * Encodes the specified GetDocumentsResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.verify|verify} messages. * @function encode - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountRequest + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse * @static - * @param {org.dash.platform.dapi.v0.IGetDocumentsCountRequest} message GetDocumentsCountRequest message or plain object to encode + * @param {org.dash.platform.dapi.v0.IGetDocumentsResponse} message GetDocumentsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetDocumentsCountRequest.encode = function encode(message, writer) { + GetDocumentsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.v1 != null && Object.hasOwnProperty.call(message, "v1")) + $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.encode(message.v1, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified GetDocumentsCountRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsCountRequest.verify|verify} messages. + * Encodes the specified GetDocumentsResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountRequest + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse * @static - * @param {org.dash.platform.dapi.v0.IGetDocumentsCountRequest} message GetDocumentsCountRequest message or plain object to encode + * @param {org.dash.platform.dapi.v0.IGetDocumentsResponse} message GetDocumentsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetDocumentsCountRequest.encodeDelimited = function encodeDelimited(message, writer) { + GetDocumentsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetDocumentsCountRequest message from the specified reader or buffer. + * Decodes a GetDocumentsResponse message from the specified reader or buffer. * @function decode - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountRequest + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetDocumentsCountRequest} GetDocumentsCountRequest + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse} GetDocumentsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetDocumentsCountRequest.decode = function decode(reader, length) { + GetDocumentsResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDocumentsCountRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDocumentsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.decode(reader, reader.uint32()); + message.v0 = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.decode(reader, reader.uint32()); + break; + case 2: + message.v1 = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -20792,120 +20636,136 @@ $root.org = (function() { }; /** - * Decodes a GetDocumentsCountRequest message from the specified reader or buffer, length delimited. + * Decodes a GetDocumentsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountRequest + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetDocumentsCountRequest} GetDocumentsCountRequest + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse} GetDocumentsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetDocumentsCountRequest.decodeDelimited = function decodeDelimited(reader) { + GetDocumentsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetDocumentsCountRequest message. + * Verifies a GetDocumentsResponse message. * @function verify - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountRequest + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetDocumentsCountRequest.verify = function verify(message) { + GetDocumentsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; var properties = {}; if (message.v0 != null && message.hasOwnProperty("v0")) { properties.version = 1; { - var error = $root.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.verify(message.v0); + var error = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.verify(message.v0); if (error) return "v0." + error; } } + if (message.v1 != null && message.hasOwnProperty("v1")) { + if (properties.version === 1) + return "version: multiple values"; + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.verify(message.v1); + if (error) + return "v1." + error; + } + } return null; }; /** - * Creates a GetDocumentsCountRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetDocumentsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountRequest + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse * @static * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetDocumentsCountRequest} GetDocumentsCountRequest + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse} GetDocumentsResponse */ - GetDocumentsCountRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetDocumentsCountRequest) + GetDocumentsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDocumentsResponse) return object; - var message = new $root.org.dash.platform.dapi.v0.GetDocumentsCountRequest(); + var message = new $root.org.dash.platform.dapi.v0.GetDocumentsResponse(); if (object.v0 != null) { if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsCountRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.fromObject(object.v0); + throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.fromObject(object.v0); + } + if (object.v1 != null) { + if (typeof object.v1 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsResponse.v1: object expected"); + message.v1 = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.fromObject(object.v1); } return message; }; /** - * Creates a plain object from a GetDocumentsCountRequest message. Also converts values to other types if specified. + * Creates a plain object from a GetDocumentsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountRequest + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsCountRequest} message GetDocumentsCountRequest + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse} message GetDocumentsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetDocumentsCountRequest.toObject = function toObject(message, options) { + GetDocumentsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.toObject(message.v0, options); + object.v0 = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.toObject(message.v0, options); if (options.oneofs) object.version = "v0"; } + if (message.v1 != null && message.hasOwnProperty("v1")) { + object.v1 = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.toObject(message.v1, options); + if (options.oneofs) + object.version = "v1"; + } return object; }; /** - * Converts this GetDocumentsCountRequest to JSON. + * Converts this GetDocumentsResponse to JSON. * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountRequest + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse * @instance * @returns {Object.} JSON object */ - GetDocumentsCountRequest.prototype.toJSON = function toJSON() { + GetDocumentsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - GetDocumentsCountRequest.GetDocumentsCountRequestV0 = (function() { + GetDocumentsResponse.GetDocumentsResponseV0 = (function() { /** - * Properties of a GetDocumentsCountRequestV0. - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountRequest - * @interface IGetDocumentsCountRequestV0 - * @property {Uint8Array|null} [dataContractId] GetDocumentsCountRequestV0 dataContractId - * @property {string|null} [documentType] GetDocumentsCountRequestV0 documentType - * @property {Uint8Array|null} [where] GetDocumentsCountRequestV0 where - * @property {boolean|null} [returnDistinctCountsInRange] GetDocumentsCountRequestV0 returnDistinctCountsInRange - * @property {Uint8Array|null} [orderBy] GetDocumentsCountRequestV0 orderBy - * @property {number|null} [limit] GetDocumentsCountRequestV0 limit - * @property {boolean|null} [prove] GetDocumentsCountRequestV0 prove + * Properties of a GetDocumentsResponseV0. + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse + * @interface IGetDocumentsResponseV0 + * @property {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.IDocuments|null} [documents] GetDocumentsResponseV0 documents + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetDocumentsResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetDocumentsResponseV0 metadata */ /** - * Constructs a new GetDocumentsCountRequestV0. - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountRequest - * @classdesc Represents a GetDocumentsCountRequestV0. - * @implements IGetDocumentsCountRequestV0 + * Constructs a new GetDocumentsResponseV0. + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse + * @classdesc Represents a GetDocumentsResponseV0. + * @implements IGetDocumentsResponseV0 * @constructor - * @param {org.dash.platform.dapi.v0.GetDocumentsCountRequest.IGetDocumentsCountRequestV0=} [properties] Properties to set + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.IGetDocumentsResponseV0=} [properties] Properties to set */ - function GetDocumentsCountRequestV0(properties) { + function GetDocumentsResponseV0(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -20913,153 +20773,115 @@ $root.org = (function() { } /** - * GetDocumentsCountRequestV0 dataContractId. - * @member {Uint8Array} dataContractId - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0 - * @instance - */ - GetDocumentsCountRequestV0.prototype.dataContractId = $util.newBuffer([]); - - /** - * GetDocumentsCountRequestV0 documentType. - * @member {string} documentType - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0 - * @instance - */ - GetDocumentsCountRequestV0.prototype.documentType = ""; - - /** - * GetDocumentsCountRequestV0 where. - * @member {Uint8Array} where - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0 + * GetDocumentsResponseV0 documents. + * @member {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.IDocuments|null|undefined} documents + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 * @instance */ - GetDocumentsCountRequestV0.prototype.where = $util.newBuffer([]); + GetDocumentsResponseV0.prototype.documents = null; /** - * GetDocumentsCountRequestV0 returnDistinctCountsInRange. - * @member {boolean} returnDistinctCountsInRange - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0 + * GetDocumentsResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 * @instance */ - GetDocumentsCountRequestV0.prototype.returnDistinctCountsInRange = false; + GetDocumentsResponseV0.prototype.proof = null; /** - * GetDocumentsCountRequestV0 orderBy. - * @member {Uint8Array} orderBy - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0 + * GetDocumentsResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 * @instance */ - GetDocumentsCountRequestV0.prototype.orderBy = $util.newBuffer([]); + GetDocumentsResponseV0.prototype.metadata = null; - /** - * GetDocumentsCountRequestV0 limit. - * @member {number} limit - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0 - * @instance - */ - GetDocumentsCountRequestV0.prototype.limit = 0; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * GetDocumentsCountRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0 + * GetDocumentsResponseV0 result. + * @member {"documents"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 * @instance */ - GetDocumentsCountRequestV0.prototype.prove = false; + Object.defineProperty(GetDocumentsResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["documents", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Creates a new GetDocumentsCountRequestV0 instance using the specified properties. + * Creates a new GetDocumentsResponseV0 instance using the specified properties. * @function create - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0 + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsCountRequest.IGetDocumentsCountRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0} GetDocumentsCountRequestV0 instance + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.IGetDocumentsResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} GetDocumentsResponseV0 instance */ - GetDocumentsCountRequestV0.create = function create(properties) { - return new GetDocumentsCountRequestV0(properties); + GetDocumentsResponseV0.create = function create(properties) { + return new GetDocumentsResponseV0(properties); }; /** - * Encodes the specified GetDocumentsCountRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.verify|verify} messages. + * Encodes the specified GetDocumentsResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.verify|verify} messages. * @function encode - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0 + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsCountRequest.IGetDocumentsCountRequestV0} message GetDocumentsCountRequestV0 message or plain object to encode + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.IGetDocumentsResponseV0} message GetDocumentsResponseV0 message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetDocumentsCountRequestV0.encode = function encode(message, writer) { + GetDocumentsResponseV0.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.dataContractId != null && Object.hasOwnProperty.call(message, "dataContractId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.dataContractId); - if (message.documentType != null && Object.hasOwnProperty.call(message, "documentType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.documentType); - if (message.where != null && Object.hasOwnProperty.call(message, "where")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.where); - if (message.returnDistinctCountsInRange != null && Object.hasOwnProperty.call(message, "returnDistinctCountsInRange")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.returnDistinctCountsInRange); - if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.orderBy); - if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) - writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.limit); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 7, wireType 0 =*/56).bool(message.prove); + if (message.documents != null && Object.hasOwnProperty.call(message, "documents")) + $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.encode(message.documents, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified GetDocumentsCountRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.verify|verify} messages. + * Encodes the specified GetDocumentsResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.verify|verify} messages. * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0 + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsCountRequest.IGetDocumentsCountRequestV0} message GetDocumentsCountRequestV0 message or plain object to encode + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.IGetDocumentsResponseV0} message GetDocumentsResponseV0 message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetDocumentsCountRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + GetDocumentsResponseV0.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetDocumentsCountRequestV0 message from the specified reader or buffer. + * Decodes a GetDocumentsResponseV0 message from the specified reader or buffer. * @function decode - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0 + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0} GetDocumentsCountRequestV0 + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} GetDocumentsResponseV0 * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetDocumentsCountRequestV0.decode = function decode(reader, length) { + GetDocumentsResponseV0.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.dataContractId = reader.bytes(); + message.documents = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.decode(reader, reader.uint32()); break; case 2: - message.documentType = reader.string(); + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); break; case 3: - message.where = reader.bytes(); - break; - case 4: - message.returnDistinctCountsInRange = reader.bool(); - break; - case 5: - message.orderBy = reader.bytes(); - break; - case 6: - message.limit = reader.uint32(); - break; - case 7: - message.prove = reader.bool(); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -21070,396 +20892,359 @@ $root.org = (function() { }; /** - * Decodes a GetDocumentsCountRequestV0 message from the specified reader or buffer, length delimited. + * Decodes a GetDocumentsResponseV0 message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0 + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0} GetDocumentsCountRequestV0 + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} GetDocumentsResponseV0 * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetDocumentsCountRequestV0.decodeDelimited = function decodeDelimited(reader) { + GetDocumentsResponseV0.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetDocumentsCountRequestV0 message. + * Verifies a GetDocumentsResponseV0 message. * @function verify - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0 + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetDocumentsCountRequestV0.verify = function verify(message) { + GetDocumentsResponseV0.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.dataContractId != null && message.hasOwnProperty("dataContractId")) - if (!(message.dataContractId && typeof message.dataContractId.length === "number" || $util.isString(message.dataContractId))) - return "dataContractId: buffer expected"; - if (message.documentType != null && message.hasOwnProperty("documentType")) - if (!$util.isString(message.documentType)) - return "documentType: string expected"; - if (message.where != null && message.hasOwnProperty("where")) - if (!(message.where && typeof message.where.length === "number" || $util.isString(message.where))) - return "where: buffer expected"; - if (message.returnDistinctCountsInRange != null && message.hasOwnProperty("returnDistinctCountsInRange")) - if (typeof message.returnDistinctCountsInRange !== "boolean") - return "returnDistinctCountsInRange: boolean expected"; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - if (!(message.orderBy && typeof message.orderBy.length === "number" || $util.isString(message.orderBy))) - return "orderBy: buffer expected"; - if (message.limit != null && message.hasOwnProperty("limit")) - if (!$util.isInteger(message.limit)) - return "limit: integer expected"; - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; + var properties = {}; + if (message.documents != null && message.hasOwnProperty("documents")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.verify(message.documents); + if (error) + return "documents." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } return null; }; /** - * Creates a GetDocumentsCountRequestV0 message from a plain object. Also converts values to their respective internal types. + * Creates a GetDocumentsResponseV0 message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0 + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 * @static * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0} GetDocumentsCountRequestV0 + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} GetDocumentsResponseV0 */ - GetDocumentsCountRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0) + GetDocumentsResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0) return object; - var message = new $root.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0(); - if (object.dataContractId != null) - if (typeof object.dataContractId === "string") - $util.base64.decode(object.dataContractId, message.dataContractId = $util.newBuffer($util.base64.length(object.dataContractId)), 0); - else if (object.dataContractId.length >= 0) - message.dataContractId = object.dataContractId; - if (object.documentType != null) - message.documentType = String(object.documentType); - if (object.where != null) - if (typeof object.where === "string") - $util.base64.decode(object.where, message.where = $util.newBuffer($util.base64.length(object.where)), 0); - else if (object.where.length >= 0) - message.where = object.where; - if (object.returnDistinctCountsInRange != null) - message.returnDistinctCountsInRange = Boolean(object.returnDistinctCountsInRange); - if (object.orderBy != null) - if (typeof object.orderBy === "string") - $util.base64.decode(object.orderBy, message.orderBy = $util.newBuffer($util.base64.length(object.orderBy)), 0); - else if (object.orderBy.length >= 0) - message.orderBy = object.orderBy; - if (object.limit != null) - message.limit = object.limit >>> 0; - if (object.prove != null) - message.prove = Boolean(object.prove); + var message = new $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0(); + if (object.documents != null) { + if (typeof object.documents !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.documents: object expected"); + message.documents = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.fromObject(object.documents); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } return message; }; /** - * Creates a plain object from a GetDocumentsCountRequestV0 message. Also converts values to other types if specified. + * Creates a plain object from a GetDocumentsResponseV0 message. Also converts values to other types if specified. * @function toObject - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0 + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0} message GetDocumentsCountRequestV0 + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} message GetDocumentsResponseV0 * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetDocumentsCountRequestV0.toObject = function toObject(message, options) { + GetDocumentsResponseV0.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.dataContractId = ""; - else { - object.dataContractId = []; - if (options.bytes !== Array) - object.dataContractId = $util.newBuffer(object.dataContractId); - } - object.documentType = ""; - if (options.bytes === String) - object.where = ""; - else { - object.where = []; - if (options.bytes !== Array) - object.where = $util.newBuffer(object.where); - } - object.returnDistinctCountsInRange = false; - if (options.bytes === String) - object.orderBy = ""; - else { - object.orderBy = []; - if (options.bytes !== Array) - object.orderBy = $util.newBuffer(object.orderBy); - } - object.limit = 0; - object.prove = false; + if (options.defaults) + object.metadata = null; + if (message.documents != null && message.hasOwnProperty("documents")) { + object.documents = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.toObject(message.documents, options); + if (options.oneofs) + object.result = "documents"; } - if (message.dataContractId != null && message.hasOwnProperty("dataContractId")) - object.dataContractId = options.bytes === String ? $util.base64.encode(message.dataContractId, 0, message.dataContractId.length) : options.bytes === Array ? Array.prototype.slice.call(message.dataContractId) : message.dataContractId; - if (message.documentType != null && message.hasOwnProperty("documentType")) - object.documentType = message.documentType; - if (message.where != null && message.hasOwnProperty("where")) - object.where = options.bytes === String ? $util.base64.encode(message.where, 0, message.where.length) : options.bytes === Array ? Array.prototype.slice.call(message.where) : message.where; - if (message.returnDistinctCountsInRange != null && message.hasOwnProperty("returnDistinctCountsInRange")) - object.returnDistinctCountsInRange = message.returnDistinctCountsInRange; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = options.bytes === String ? $util.base64.encode(message.orderBy, 0, message.orderBy.length) : options.bytes === Array ? Array.prototype.slice.call(message.orderBy) : message.orderBy; - if (message.limit != null && message.hasOwnProperty("limit")) - object.limit = message.limit; - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; + 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 GetDocumentsCountRequestV0 to JSON. + * Converts this GetDocumentsResponseV0 to JSON. * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0 + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 * @instance * @returns {Object.} JSON object */ - GetDocumentsCountRequestV0.prototype.toJSON = function toJSON() { + GetDocumentsResponseV0.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GetDocumentsCountRequestV0; - })(); - - return GetDocumentsCountRequest; - })(); - - v0.GetDocumentsCountResponse = (function() { + GetDocumentsResponseV0.Documents = (function() { - /** - * Properties of a GetDocumentsCountResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetDocumentsCountResponse - * @property {org.dash.platform.dapi.v0.GetDocumentsCountResponse.IGetDocumentsCountResponseV0|null} [v0] GetDocumentsCountResponse v0 - */ + /** + * Properties of a Documents. + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 + * @interface IDocuments + * @property {Array.|null} [documents] Documents documents + */ - /** - * Constructs a new GetDocumentsCountResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetDocumentsCountResponse. - * @implements IGetDocumentsCountResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetDocumentsCountResponse=} [properties] Properties to set - */ - function GetDocumentsCountResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Constructs a new Documents. + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 + * @classdesc Represents a Documents. + * @implements IDocuments + * @constructor + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.IDocuments=} [properties] Properties to set + */ + function Documents(properties) { + this.documents = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * GetDocumentsCountResponse v0. - * @member {org.dash.platform.dapi.v0.GetDocumentsCountResponse.IGetDocumentsCountResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse - * @instance - */ - GetDocumentsCountResponse.prototype.v0 = null; + /** + * Documents documents. + * @member {Array.} documents + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents + * @instance + */ + Documents.prototype.documents = $util.emptyArray; - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * Creates a new Documents instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents + * @static + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.IDocuments=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} Documents instance + */ + Documents.create = function create(properties) { + return new Documents(properties); + }; - /** - * GetDocumentsCountResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse - * @instance - */ - Object.defineProperty(GetDocumentsCountResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); + /** + * Encodes the specified Documents message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents + * @static + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.IDocuments} message Documents message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Documents.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.documents != null && message.documents.length) + for (var i = 0; i < message.documents.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.documents[i]); + return writer; + }; - /** - * Creates a new GetDocumentsCountResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetDocumentsCountResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetDocumentsCountResponse} GetDocumentsCountResponse instance - */ - GetDocumentsCountResponse.create = function create(properties) { - return new GetDocumentsCountResponse(properties); - }; + /** + * Encodes the specified Documents message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents + * @static + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.IDocuments} message Documents message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Documents.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Encodes the specified GetDocumentsCountResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsCountResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetDocumentsCountResponse} message GetDocumentsCountResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDocumentsCountResponse.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.GetDocumentsCountResponse.GetDocumentsCountResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; + /** + * Decodes a Documents message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} Documents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Documents.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.documents && message.documents.length)) + message.documents = []; + message.documents.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Encodes the specified GetDocumentsCountResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsCountResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetDocumentsCountResponse} message GetDocumentsCountResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDocumentsCountResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Decodes a Documents message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} Documents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Documents.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Decodes a GetDocumentsCountResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetDocumentsCountResponse} GetDocumentsCountResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDocumentsCountResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDocumentsCountResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Verifies a Documents message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Documents.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.documents != null && message.hasOwnProperty("documents")) { + if (!Array.isArray(message.documents)) + return "documents: array expected"; + for (var i = 0; i < message.documents.length; ++i) + if (!(message.documents[i] && typeof message.documents[i].length === "number" || $util.isString(message.documents[i]))) + return "documents: buffer[] expected"; + } + return null; + }; - /** - * Decodes a GetDocumentsCountResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetDocumentsCountResponse} GetDocumentsCountResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDocumentsCountResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Creates a Documents message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} Documents + */ + Documents.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents(); + if (object.documents) { + if (!Array.isArray(object.documents)) + throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.documents: array expected"); + message.documents = []; + for (var i = 0; i < object.documents.length; ++i) + if (typeof object.documents[i] === "string") + $util.base64.decode(object.documents[i], message.documents[i] = $util.newBuffer($util.base64.length(object.documents[i])), 0); + else if (object.documents[i].length >= 0) + message.documents[i] = object.documents[i]; + } + return message; + }; - /** - * Verifies a GetDocumentsCountResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetDocumentsCountResponse.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.GetDocumentsCountResponse.GetDocumentsCountResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; + /** + * Creates a plain object from a Documents message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents + * @static + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} message Documents + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Documents.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.documents = []; + if (message.documents && message.documents.length) { + object.documents = []; + for (var j = 0; j < message.documents.length; ++j) + object.documents[j] = options.bytes === String ? $util.base64.encode(message.documents[j], 0, message.documents[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.documents[j]) : message.documents[j]; + } + return object; + }; - /** - * Creates a GetDocumentsCountResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetDocumentsCountResponse} GetDocumentsCountResponse - */ - GetDocumentsCountResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetDocumentsCountResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetDocumentsCountResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsCountResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.fromObject(object.v0); - } - return message; - }; + /** + * Converts this Documents to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents + * @instance + * @returns {Object.} JSON object + */ + Documents.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Creates a plain object from a GetDocumentsCountResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse - * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsCountResponse} message GetDocumentsCountResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetDocumentsCountResponse.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.GetDocumentsCountResponse.GetDocumentsCountResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; + return Documents; + })(); - /** - * Converts this GetDocumentsCountResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse - * @instance - * @returns {Object.} JSON object - */ - GetDocumentsCountResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return GetDocumentsResponseV0; + })(); - GetDocumentsCountResponse.GetDocumentsCountResponseV0 = (function() { + GetDocumentsResponse.GetDocumentsResponseV1 = (function() { /** - * Properties of a GetDocumentsCountResponseV0. - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse - * @interface IGetDocumentsCountResponseV0 - * @property {org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.ICountResults|null} [counts] GetDocumentsCountResponseV0 counts - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetDocumentsCountResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetDocumentsCountResponseV0 metadata + * Properties of a GetDocumentsResponseV1. + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse + * @interface IGetDocumentsResponseV1 + * @property {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.IResultData|null} [data] GetDocumentsResponseV1 data + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetDocumentsResponseV1 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetDocumentsResponseV1 metadata */ /** - * Constructs a new GetDocumentsCountResponseV0. - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse - * @classdesc Represents a GetDocumentsCountResponseV0. - * @implements IGetDocumentsCountResponseV0 + * Constructs a new GetDocumentsResponseV1. + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse + * @classdesc Represents a GetDocumentsResponseV1. + * @implements IGetDocumentsResponseV1 * @constructor - * @param {org.dash.platform.dapi.v0.GetDocumentsCountResponse.IGetDocumentsCountResponseV0=} [properties] Properties to set + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.IGetDocumentsResponseV1=} [properties] Properties to set */ - function GetDocumentsCountResponseV0(properties) { + function GetDocumentsResponseV1(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -21467,69 +21252,69 @@ $root.org = (function() { } /** - * GetDocumentsCountResponseV0 counts. - * @member {org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.ICountResults|null|undefined} counts - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0 + * GetDocumentsResponseV1 data. + * @member {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.IResultData|null|undefined} data + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1 * @instance */ - GetDocumentsCountResponseV0.prototype.counts = null; + GetDocumentsResponseV1.prototype.data = null; /** - * GetDocumentsCountResponseV0 proof. + * GetDocumentsResponseV1 proof. * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0 + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1 * @instance */ - GetDocumentsCountResponseV0.prototype.proof = null; + GetDocumentsResponseV1.prototype.proof = null; /** - * GetDocumentsCountResponseV0 metadata. + * GetDocumentsResponseV1 metadata. * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0 + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1 * @instance */ - GetDocumentsCountResponseV0.prototype.metadata = null; + GetDocumentsResponseV1.prototype.metadata = null; // OneOf field names bound to virtual getters and setters var $oneOfFields; /** - * GetDocumentsCountResponseV0 result. - * @member {"counts"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0 + * GetDocumentsResponseV1 result. + * @member {"data"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1 * @instance */ - Object.defineProperty(GetDocumentsCountResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["counts", "proof"]), + Object.defineProperty(GetDocumentsResponseV1.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["data", "proof"]), set: $util.oneOfSetter($oneOfFields) }); /** - * Creates a new GetDocumentsCountResponseV0 instance using the specified properties. + * Creates a new GetDocumentsResponseV1 instance using the specified properties. * @function create - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0 + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1 * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsCountResponse.IGetDocumentsCountResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0} GetDocumentsCountResponseV0 instance + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.IGetDocumentsResponseV1=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1} GetDocumentsResponseV1 instance */ - GetDocumentsCountResponseV0.create = function create(properties) { - return new GetDocumentsCountResponseV0(properties); + GetDocumentsResponseV1.create = function create(properties) { + return new GetDocumentsResponseV1(properties); }; /** - * Encodes the specified GetDocumentsCountResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.verify|verify} messages. + * Encodes the specified GetDocumentsResponseV1 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.verify|verify} messages. * @function encode - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0 + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1 * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsCountResponse.IGetDocumentsCountResponseV0} message GetDocumentsCountResponseV0 message or plain object to encode + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.IGetDocumentsResponseV1} message GetDocumentsResponseV1 message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetDocumentsCountResponseV0.encode = function encode(message, writer) { + GetDocumentsResponseV1.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.counts != null && Object.hasOwnProperty.call(message, "counts")) - $root.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.encode(message.counts, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.data != null && Object.hasOwnProperty.call(message, "data")) + $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.encode(message.data, 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")) @@ -21538,38 +21323,38 @@ $root.org = (function() { }; /** - * Encodes the specified GetDocumentsCountResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.verify|verify} messages. + * Encodes the specified GetDocumentsResponseV1 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.verify|verify} messages. * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0 + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1 * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsCountResponse.IGetDocumentsCountResponseV0} message GetDocumentsCountResponseV0 message or plain object to encode + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.IGetDocumentsResponseV1} message GetDocumentsResponseV1 message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetDocumentsCountResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + GetDocumentsResponseV1.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetDocumentsCountResponseV0 message from the specified reader or buffer. + * Decodes a GetDocumentsResponseV1 message from the specified reader or buffer. * @function decode - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0 + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1 * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0} GetDocumentsCountResponseV0 + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1} GetDocumentsResponseV1 * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetDocumentsCountResponseV0.decode = function decode(reader, length) { + GetDocumentsResponseV1.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.counts = $root.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.decode(reader, reader.uint32()); + message.data = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.decode(reader, reader.uint32()); break; case 2: message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); @@ -21586,39 +21371,39 @@ $root.org = (function() { }; /** - * Decodes a GetDocumentsCountResponseV0 message from the specified reader or buffer, length delimited. + * Decodes a GetDocumentsResponseV1 message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0 + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1 * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0} GetDocumentsCountResponseV0 + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1} GetDocumentsResponseV1 * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetDocumentsCountResponseV0.decodeDelimited = function decodeDelimited(reader) { + GetDocumentsResponseV1.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetDocumentsCountResponseV0 message. + * Verifies a GetDocumentsResponseV1 message. * @function verify - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0 + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1 * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetDocumentsCountResponseV0.verify = function verify(message) { + GetDocumentsResponseV1.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; var properties = {}; - if (message.counts != null && message.hasOwnProperty("counts")) { + if (message.data != null && message.hasOwnProperty("data")) { properties.result = 1; { - var error = $root.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.verify(message.counts); + var error = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.verify(message.data); if (error) - return "counts." + error; + return "data." + error; } } if (message.proof != null && message.hasOwnProperty("proof")) { @@ -21630,91 +21415,297 @@ $root.org = (function() { 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; - }; + } + 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 GetDocumentsResponseV1 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1} GetDocumentsResponseV1 + */ + GetDocumentsResponseV1.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1(); + if (object.data != null) { + if (typeof object.data !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.data: object expected"); + message.data = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.fromObject(object.data); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetDocumentsResponseV1 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1 + * @static + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1} message GetDocumentsResponseV1 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDocumentsResponseV1.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.data != null && message.hasOwnProperty("data")) { + object.data = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.toObject(message.data, options); + if (options.oneofs) + object.result = "data"; + } + 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 GetDocumentsResponseV1 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1 + * @instance + * @returns {Object.} JSON object + */ + GetDocumentsResponseV1.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetDocumentsResponseV1.Documents = (function() { + + /** + * Properties of a Documents. + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1 + * @interface IDocuments + * @property {Array.|null} [documents] Documents documents + */ + + /** + * Constructs a new Documents. + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1 + * @classdesc Represents a Documents. + * @implements IDocuments + * @constructor + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.IDocuments=} [properties] Properties to set + */ + function Documents(properties) { + this.documents = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Documents documents. + * @member {Array.} documents + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents + * @instance + */ + Documents.prototype.documents = $util.emptyArray; + + /** + * Creates a new Documents instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents + * @static + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.IDocuments=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents} Documents instance + */ + Documents.create = function create(properties) { + return new Documents(properties); + }; + + /** + * Encodes the specified Documents message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents + * @static + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.IDocuments} message Documents message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Documents.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.documents != null && message.documents.length) + for (var i = 0; i < message.documents.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.documents[i]); + return writer; + }; + + /** + * Encodes the specified Documents message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents + * @static + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.IDocuments} message Documents message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Documents.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Documents message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents} Documents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Documents.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.documents && message.documents.length)) + message.documents = []; + message.documents.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Documents message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents} Documents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Documents.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Documents message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Documents.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.documents != null && message.hasOwnProperty("documents")) { + if (!Array.isArray(message.documents)) + return "documents: array expected"; + for (var i = 0; i < message.documents.length; ++i) + if (!(message.documents[i] && typeof message.documents[i].length === "number" || $util.isString(message.documents[i]))) + return "documents: buffer[] expected"; + } + return null; + }; + + /** + * Creates a Documents message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents} Documents + */ + Documents.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents(); + if (object.documents) { + if (!Array.isArray(object.documents)) + throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents.documents: array expected"); + message.documents = []; + for (var i = 0; i < object.documents.length; ++i) + if (typeof object.documents[i] === "string") + $util.base64.decode(object.documents[i], message.documents[i] = $util.newBuffer($util.base64.length(object.documents[i])), 0); + else if (object.documents[i].length >= 0) + message.documents[i] = object.documents[i]; + } + return message; + }; - /** - * Creates a GetDocumentsCountResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0} GetDocumentsCountResponseV0 - */ - GetDocumentsCountResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0) + /** + * Creates a plain object from a Documents message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents + * @static + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents} message Documents + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Documents.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.documents = []; + if (message.documents && message.documents.length) { + object.documents = []; + for (var j = 0; j < message.documents.length; ++j) + object.documents[j] = options.bytes === String ? $util.base64.encode(message.documents[j], 0, message.documents[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.documents[j]) : message.documents[j]; + } return object; - var message = new $root.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0(); - if (object.counts != null) { - if (typeof object.counts !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.counts: object expected"); - message.counts = $root.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.fromObject(object.counts); - } - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.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.GetDocumentsCountResponse.GetDocumentsCountResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; + }; - /** - * Creates a plain object from a GetDocumentsCountResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0} message GetDocumentsCountResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetDocumentsCountResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.counts != null && message.hasOwnProperty("counts")) { - object.counts = $root.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.toObject(message.counts, options); - if (options.oneofs) - object.result = "counts"; - } - 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 Documents to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents + * @instance + * @returns {Object.} JSON object + */ + Documents.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Converts this GetDocumentsCountResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetDocumentsCountResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return Documents; + })(); - GetDocumentsCountResponseV0.CountEntry = (function() { + GetDocumentsResponseV1.CountEntry = (function() { /** * Properties of a CountEntry. - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0 + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1 * @interface ICountEntry * @property {Uint8Array|null} [inKey] CountEntry inKey * @property {Uint8Array|null} [key] CountEntry key @@ -21723,11 +21714,11 @@ $root.org = (function() { /** * Constructs a new CountEntry. - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0 + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1 * @classdesc Represents a CountEntry. * @implements ICountEntry * @constructor - * @param {org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.ICountEntry=} [properties] Properties to set + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ICountEntry=} [properties] Properties to set */ function CountEntry(properties) { if (properties) @@ -21739,7 +21730,7 @@ $root.org = (function() { /** * CountEntry inKey. * @member {Uint8Array} inKey - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry * @instance */ CountEntry.prototype.inKey = $util.newBuffer([]); @@ -21747,7 +21738,7 @@ $root.org = (function() { /** * CountEntry key. * @member {Uint8Array} key - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry * @instance */ CountEntry.prototype.key = $util.newBuffer([]); @@ -21755,7 +21746,7 @@ $root.org = (function() { /** * CountEntry count. * @member {number|Long} count - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry * @instance */ CountEntry.prototype.count = $util.Long ? $util.Long.fromBits(0,0,true) : 0; @@ -21763,21 +21754,21 @@ $root.org = (function() { /** * Creates a new CountEntry instance using the specified properties. * @function create - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.ICountEntry=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry} CountEntry instance + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ICountEntry=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry} CountEntry instance */ CountEntry.create = function create(properties) { return new CountEntry(properties); }; /** - * Encodes the specified CountEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry.verify|verify} messages. + * Encodes the specified CountEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry.verify|verify} messages. * @function encode - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.ICountEntry} message CountEntry message or plain object to encode + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ICountEntry} message CountEntry message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -21794,11 +21785,11 @@ $root.org = (function() { }; /** - * Encodes the specified CountEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry.verify|verify} messages. + * Encodes the specified CountEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry.verify|verify} messages. * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.ICountEntry} message CountEntry message or plain object to encode + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ICountEntry} message CountEntry message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -21809,18 +21800,18 @@ $root.org = (function() { /** * Decodes a CountEntry message from the specified reader or buffer. * @function decode - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry} CountEntry + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry} CountEntry * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ CountEntry.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -21844,10 +21835,10 @@ $root.org = (function() { /** * Decodes a CountEntry message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry} CountEntry + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry} CountEntry * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -21860,7 +21851,7 @@ $root.org = (function() { /** * Verifies a CountEntry message. * @function verify - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -21883,15 +21874,15 @@ $root.org = (function() { /** * Creates a CountEntry message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry * @static * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry} CountEntry + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry} CountEntry */ CountEntry.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry) + if (object instanceof $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry) return object; - var message = new $root.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry(); + var message = new $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry(); if (object.inKey != null) if (typeof object.inKey === "string") $util.base64.decode(object.inKey, message.inKey = $util.newBuffer($util.base64.length(object.inKey)), 0); @@ -21917,9 +21908,9 @@ $root.org = (function() { /** * Creates a plain object from a CountEntry message. Also converts values to other types if specified. * @function toObject - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry} message CountEntry + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry} message CountEntry * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -21963,7 +21954,7 @@ $root.org = (function() { /** * Converts this CountEntry to JSON. * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry * @instance * @returns {Object.} JSON object */ @@ -21974,22 +21965,22 @@ $root.org = (function() { return CountEntry; })(); - GetDocumentsCountResponseV0.CountEntries = (function() { + GetDocumentsResponseV1.CountEntries = (function() { /** * Properties of a CountEntries. - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0 + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1 * @interface ICountEntries - * @property {Array.|null} [entries] CountEntries entries + * @property {Array.|null} [entries] CountEntries entries */ /** * Constructs a new CountEntries. - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0 + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1 * @classdesc Represents a CountEntries. * @implements ICountEntries * @constructor - * @param {org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.ICountEntries=} [properties] Properties to set + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ICountEntries=} [properties] Properties to set */ function CountEntries(properties) { this.entries = []; @@ -22001,8 +21992,8 @@ $root.org = (function() { /** * CountEntries entries. - * @member {Array.} entries - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries + * @member {Array.} entries + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries * @instance */ CountEntries.prototype.entries = $util.emptyArray; @@ -22010,21 +22001,21 @@ $root.org = (function() { /** * Creates a new CountEntries instance using the specified properties. * @function create - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.ICountEntries=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries} CountEntries instance + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ICountEntries=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries} CountEntries instance */ CountEntries.create = function create(properties) { return new CountEntries(properties); }; /** - * Encodes the specified CountEntries message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries.verify|verify} messages. + * Encodes the specified CountEntries message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries.verify|verify} messages. * @function encode - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.ICountEntries} message CountEntries message or plain object to encode + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ICountEntries} message CountEntries message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -22033,16 +22024,16 @@ $root.org = (function() { writer = $Writer.create(); if (message.entries != null && message.entries.length) for (var i = 0; i < message.entries.length; ++i) - $root.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry.encode(message.entries[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry.encode(message.entries[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified CountEntries message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries.verify|verify} messages. + * Encodes the specified CountEntries message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries.verify|verify} messages. * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.ICountEntries} message CountEntries message or plain object to encode + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ICountEntries} message CountEntries message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -22053,25 +22044,25 @@ $root.org = (function() { /** * Decodes a CountEntries message from the specified reader or buffer. * @function decode - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries} CountEntries + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries} CountEntries * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ CountEntries.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: if (!(message.entries && message.entries.length)) message.entries = []; - message.entries.push($root.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry.decode(reader, reader.uint32())); + message.entries.push($root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -22084,10 +22075,10 @@ $root.org = (function() { /** * Decodes a CountEntries message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries} CountEntries + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries} CountEntries * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -22100,7 +22091,7 @@ $root.org = (function() { /** * Verifies a CountEntries message. * @function verify - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -22112,7 +22103,7 @@ $root.org = (function() { if (!Array.isArray(message.entries)) return "entries: array expected"; for (var i = 0; i < message.entries.length; ++i) { - var error = $root.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry.verify(message.entries[i]); + var error = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry.verify(message.entries[i]); if (error) return "entries." + error; } @@ -22123,23 +22114,23 @@ $root.org = (function() { /** * Creates a CountEntries message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries * @static * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries} CountEntries + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries} CountEntries */ CountEntries.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries) + if (object instanceof $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries) return object; - var message = new $root.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries(); + var message = new $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries(); if (object.entries) { if (!Array.isArray(object.entries)) - throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries.entries: array expected"); + throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries.entries: array expected"); message.entries = []; for (var i = 0; i < object.entries.length; ++i) { if (typeof object.entries[i] !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries.entries: object expected"); - message.entries[i] = $root.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry.fromObject(object.entries[i]); + throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries.entries: object expected"); + message.entries[i] = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry.fromObject(object.entries[i]); } } return message; @@ -22148,9 +22139,9 @@ $root.org = (function() { /** * Creates a plain object from a CountEntries message. Also converts values to other types if specified. * @function toObject - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries} message CountEntries + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries} message CountEntries * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -22163,7 +22154,7 @@ $root.org = (function() { if (message.entries && message.entries.length) { object.entries = []; for (var j = 0; j < message.entries.length; ++j) - object.entries[j] = $root.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry.toObject(message.entries[j], options); + object.entries[j] = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry.toObject(message.entries[j], options); } return object; }; @@ -22171,7 +22162,7 @@ $root.org = (function() { /** * Converts this CountEntries to JSON. * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries * @instance * @returns {Object.} JSON object */ @@ -22182,23 +22173,23 @@ $root.org = (function() { return CountEntries; })(); - GetDocumentsCountResponseV0.CountResults = (function() { + GetDocumentsResponseV1.CountResults = (function() { /** * Properties of a CountResults. - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0 + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1 * @interface ICountResults * @property {number|Long|null} [aggregateCount] CountResults aggregateCount - * @property {org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.ICountEntries|null} [entries] CountResults entries + * @property {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ICountEntries|null} [entries] CountResults entries */ /** * Constructs a new CountResults. - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0 + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1 * @classdesc Represents a CountResults. * @implements ICountResults * @constructor - * @param {org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.ICountResults=} [properties] Properties to set + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ICountResults=} [properties] Properties to set */ function CountResults(properties) { if (properties) @@ -22210,15 +22201,15 @@ $root.org = (function() { /** * CountResults aggregateCount. * @member {number|Long} aggregateCount - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults * @instance */ CountResults.prototype.aggregateCount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; /** * CountResults entries. - * @member {org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.ICountEntries|null|undefined} entries - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults + * @member {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ICountEntries|null|undefined} entries + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults * @instance */ CountResults.prototype.entries = null; @@ -22229,7 +22220,7 @@ $root.org = (function() { /** * CountResults variant. * @member {"aggregateCount"|"entries"|undefined} variant - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults * @instance */ Object.defineProperty(CountResults.prototype, "variant", { @@ -22240,21 +22231,21 @@ $root.org = (function() { /** * Creates a new CountResults instance using the specified properties. * @function create - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.ICountResults=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults} CountResults instance + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ICountResults=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults} CountResults instance */ CountResults.create = function create(properties) { return new CountResults(properties); }; /** - * Encodes the specified CountResults message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.verify|verify} messages. + * Encodes the specified CountResults message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.verify|verify} messages. * @function encode - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.ICountResults} message CountResults message or plain object to encode + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ICountResults} message CountResults message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -22264,16 +22255,16 @@ $root.org = (function() { if (message.aggregateCount != null && Object.hasOwnProperty.call(message, "aggregateCount")) writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.aggregateCount); if (message.entries != null && Object.hasOwnProperty.call(message, "entries")) - $root.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries.encode(message.entries, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries.encode(message.entries, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified CountResults message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.verify|verify} messages. + * Encodes the specified CountResults message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.verify|verify} messages. * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.ICountResults} message CountResults message or plain object to encode + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ICountResults} message CountResults message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -22284,18 +22275,18 @@ $root.org = (function() { /** * Decodes a CountResults message from the specified reader or buffer. * @function decode - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults} CountResults + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults} CountResults * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ CountResults.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -22303,7 +22294,7 @@ $root.org = (function() { message.aggregateCount = reader.uint64(); break; case 2: - message.entries = $root.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries.decode(reader, reader.uint32()); + message.entries = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -22316,10 +22307,10 @@ $root.org = (function() { /** * Decodes a CountResults message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults} CountResults + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults} CountResults * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -22332,7 +22323,7 @@ $root.org = (function() { /** * Verifies a CountResults message. * @function verify - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -22351,7 +22342,7 @@ $root.org = (function() { return "variant: multiple values"; properties.variant = 1; { - var error = $root.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries.verify(message.entries); + var error = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries.verify(message.entries); if (error) return "entries." + error; } @@ -22362,15 +22353,15 @@ $root.org = (function() { /** * Creates a CountResults message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults * @static * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults} CountResults + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults} CountResults */ CountResults.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults) + if (object instanceof $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults) return object; - var message = new $root.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults(); + var message = new $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults(); if (object.aggregateCount != null) if ($util.Long) (message.aggregateCount = $util.Long.fromValue(object.aggregateCount)).unsigned = true; @@ -22382,8 +22373,8 @@ $root.org = (function() { message.aggregateCount = new $util.LongBits(object.aggregateCount.low >>> 0, object.aggregateCount.high >>> 0).toNumber(true); if (object.entries != null) { if (typeof object.entries !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.entries: object expected"); - message.entries = $root.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries.fromObject(object.entries); + throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.entries: object expected"); + message.entries = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries.fromObject(object.entries); } return message; }; @@ -22391,9 +22382,9 @@ $root.org = (function() { /** * Creates a plain object from a CountResults message. Also converts values to other types if specified. * @function toObject - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults} message CountResults + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults} message CountResults * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -22410,7 +22401,7 @@ $root.org = (function() { object.variant = "aggregateCount"; } if (message.entries != null && message.hasOwnProperty("entries")) { - object.entries = $root.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries.toObject(message.entries, options); + object.entries = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries.toObject(message.entries, options); if (options.oneofs) object.variant = "entries"; } @@ -22420,7 +22411,7 @@ $root.org = (function() { /** * Converts this CountResults to JSON. * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults * @instance * @returns {Object.} JSON object */ @@ -22431,10 +22422,255 @@ $root.org = (function() { return CountResults; })(); - return GetDocumentsCountResponseV0; + GetDocumentsResponseV1.ResultData = (function() { + + /** + * Properties of a ResultData. + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1 + * @interface IResultData + * @property {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.IDocuments|null} [documents] ResultData documents + * @property {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ICountResults|null} [counts] ResultData counts + */ + + /** + * Constructs a new ResultData. + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1 + * @classdesc Represents a ResultData. + * @implements IResultData + * @constructor + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.IResultData=} [properties] Properties to set + */ + function ResultData(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResultData documents. + * @member {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.IDocuments|null|undefined} documents + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData + * @instance + */ + ResultData.prototype.documents = null; + + /** + * ResultData counts. + * @member {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ICountResults|null|undefined} counts + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData + * @instance + */ + ResultData.prototype.counts = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ResultData variant. + * @member {"documents"|"counts"|undefined} variant + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData + * @instance + */ + Object.defineProperty(ResultData.prototype, "variant", { + get: $util.oneOfGetter($oneOfFields = ["documents", "counts"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ResultData instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData + * @static + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.IResultData=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData} ResultData instance + */ + ResultData.create = function create(properties) { + return new ResultData(properties); + }; + + /** + * Encodes the specified ResultData message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData + * @static + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.IResultData} message ResultData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResultData.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.documents != null && Object.hasOwnProperty.call(message, "documents")) + $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents.encode(message.documents, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.counts != null && Object.hasOwnProperty.call(message, "counts")) + $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.encode(message.counts, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ResultData message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData + * @static + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.IResultData} message ResultData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResultData.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResultData message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData} ResultData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResultData.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.documents = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents.decode(reader, reader.uint32()); + break; + case 2: + message.counts = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResultData message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData} ResultData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResultData.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResultData message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResultData.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.documents != null && message.hasOwnProperty("documents")) { + properties.variant = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents.verify(message.documents); + if (error) + return "documents." + error; + } + } + if (message.counts != null && message.hasOwnProperty("counts")) { + if (properties.variant === 1) + return "variant: multiple values"; + properties.variant = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.verify(message.counts); + if (error) + return "counts." + error; + } + } + return null; + }; + + /** + * Creates a ResultData message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData} ResultData + */ + ResultData.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData(); + if (object.documents != null) { + if (typeof object.documents !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.documents: object expected"); + message.documents = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents.fromObject(object.documents); + } + if (object.counts != null) { + if (typeof object.counts !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.counts: object expected"); + message.counts = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.fromObject(object.counts); + } + return message; + }; + + /** + * Creates a plain object from a ResultData message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData + * @static + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData} message ResultData + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResultData.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.documents != null && message.hasOwnProperty("documents")) { + object.documents = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents.toObject(message.documents, options); + if (options.oneofs) + object.variant = "documents"; + } + if (message.counts != null && message.hasOwnProperty("counts")) { + object.counts = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.toObject(message.counts, options); + if (options.oneofs) + object.variant = "counts"; + } + return object; + }; + + /** + * Converts this ResultData to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData + * @instance + * @returns {Object.} JSON object + */ + ResultData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResultData; + })(); + + return GetDocumentsResponseV1; })(); - return GetDocumentsCountResponse; + return GetDocumentsResponse; })(); v0.GetIdentityByPublicKeyHashRequest = (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 d70c2e95669..7e9deb3b0c3 100644 --- a/packages/dapi-grpc/clients/platform/v0/nodejs/platform_protoc.js +++ b/packages/dapi-grpc/clients/platform/v0/nodejs/platform_protoc.js @@ -150,25 +150,26 @@ goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractsResponse.Data goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0.ResultCase', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractsResponse.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.VariantCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.ResultCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.VersionCase', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsRequest', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0.StartCase', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.Select', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.StartCase', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsRequest.VersionCase', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsResponse', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.ResultCase', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.VariantCase', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultCase', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.VariantCase', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsResponse.VersionCase', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetEpochsInfoRequest', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0', null, { proto }); @@ -2193,16 +2194,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.oneofGroups_); +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1 = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.repeatedFields_, proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.oneofGroups_); }; -goog.inherits(proto.org.dash.platform.dapi.v0.GetDocumentsResponse, jspb.Message); +goog.inherits(proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.org.dash.platform.dapi.v0.GetDocumentsResponse.displayName = 'proto.org.dash.platform.dapi.v0.GetDocumentsResponse'; + proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.displayName = 'proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1'; } /** * Generated by JsPbCodeGenerator. @@ -2214,16 +2215,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.oneofGroups_); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.oneofGroups_); }; -goog.inherits(proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0, jspb.Message); +goog.inherits(proto.org.dash.platform.dapi.v0.GetDocumentsResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.displayName = 'proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0'; + proto.org.dash.platform.dapi.v0.GetDocumentsResponse.displayName = 'proto.org.dash.platform.dapi.v0.GetDocumentsResponse'; } /** * Generated by JsPbCodeGenerator. @@ -2235,16 +2236,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.repeatedFields_, null); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.oneofGroups_); }; -goog.inherits(proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents, jspb.Message); +goog.inherits(proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.displayName = 'proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents'; + proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.displayName = 'proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0'; } /** * Generated by JsPbCodeGenerator. @@ -2256,16 +2257,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.oneofGroups_); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.repeatedFields_, null); }; -goog.inherits(proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest, jspb.Message); +goog.inherits(proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.displayName = 'proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest'; + proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.displayName = 'proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents'; } /** * Generated by JsPbCodeGenerator. @@ -2277,16 +2278,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0 = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1 = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.oneofGroups_); }; -goog.inherits(proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0, jspb.Message); +goog.inherits(proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.displayName = 'proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0'; + proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.displayName = 'proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1'; } /** * Generated by JsPbCodeGenerator. @@ -2298,16 +2299,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.oneofGroups_); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents.repeatedFields_, null); }; -goog.inherits(proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse, jspb.Message); +goog.inherits(proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.displayName = 'proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse'; + proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents.displayName = 'proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents'; } /** * Generated by JsPbCodeGenerator. @@ -2319,16 +2320,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0 = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.oneofGroups_); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0, jspb.Message); +goog.inherits(proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.displayName = 'proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0'; + proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry.displayName = 'proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry'; } /** * Generated by JsPbCodeGenerator. @@ -2340,16 +2341,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries.repeatedFields_, null); }; -goog.inherits(proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry, jspb.Message); +goog.inherits(proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry.displayName = 'proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry'; + proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries.displayName = 'proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries'; } /** * Generated by JsPbCodeGenerator. @@ -2361,16 +2362,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries.repeatedFields_, null); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.oneofGroups_); }; -goog.inherits(proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries, jspb.Message); +goog.inherits(proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries.displayName = 'proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries'; + proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.displayName = 'proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults'; } /** * Generated by JsPbCodeGenerator. @@ -2382,16 +2383,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.oneofGroups_); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.oneofGroups_); }; -goog.inherits(proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults, jspb.Message); +goog.inherits(proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.displayName = 'proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults'; + proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.displayName = 'proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData'; } /** * Generated by JsPbCodeGenerator. @@ -24092,14 +24093,15 @@ proto.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.prototype.hasV0 = * @private {!Array>} * @const */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.oneofGroups_ = [[1]]; +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.oneofGroups_ = [[1,2]]; /** * @enum {number} */ proto.org.dash.platform.dapi.v0.GetDocumentsRequest.VersionCase = { VERSION_NOT_SET: 0, - V0: 1 + V0: 1, + V1: 2 }; /** @@ -24140,7 +24142,8 @@ proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.toObject = functio */ proto.org.dash.platform.dapi.v0.GetDocumentsRequest.toObject = function(includeInstance, msg) { var f, obj = { - v0: (f = msg.getV0()) && proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0.toObject(includeInstance, f) + v0: (f = msg.getV0()) && proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0.toObject(includeInstance, f), + v1: (f = msg.getV1()) && proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.toObject(includeInstance, f) }; if (includeInstance) { @@ -24182,6 +24185,11 @@ proto.org.dash.platform.dapi.v0.GetDocumentsRequest.deserializeBinaryFromReader reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0.deserializeBinaryFromReader); msg.setV0(value); break; + case 2: + var value = new proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.deserializeBinaryFromReader); + msg.setV1(value); + break; default: reader.skipField(); break; @@ -24219,6 +24227,14 @@ proto.org.dash.platform.dapi.v0.GetDocumentsRequest.serializeBinaryToWriter = fu proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0.serializeBinaryToWriter ); } + f = message.getV1(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.serializeBinaryToWriter + ); + } }; @@ -24744,43 +24760,13 @@ proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0.protot }; -/** - * optional GetDocumentsRequestV0 v0 = 1; - * @return {?proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0} - */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getV0 = function() { - return /** @type{?proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0} */ ( - jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0, 1)); -}; - - -/** - * @param {?proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0|undefined} value - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest} returns this -*/ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.setV0 = function(value) { - return jspb.Message.setOneofWrapperField(this, 1, proto.org.dash.platform.dapi.v0.GetDocumentsRequest.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest} returns this - */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.clearV0 = function() { - return this.setV0(undefined); -}; - /** - * Returns whether this field is set. - * @return {boolean} + * List of repeated fields within this message type. + * @private {!Array} + * @const */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.hasV0 = function() { - return jspb.Message.getField(this, 1) != null; -}; - - +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.repeatedFields_ = [10]; /** * Oneof group definitions for this message. Each group defines the field @@ -24790,21 +24776,22 @@ proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.hasV0 = function() * @private {!Array>} * @const */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.oneofGroups_ = [[1]]; +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.oneofGroups_ = [[6,7]]; /** * @enum {number} */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.VersionCase = { - VERSION_NOT_SET: 0, - V0: 1 +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.StartCase = { + START_NOT_SET: 0, + START_AFTER: 6, + START_AT: 7 }; /** - * @return {proto.org.dash.platform.dapi.v0.GetDocumentsResponse.VersionCase} + * @return {proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.StartCase} */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.getVersionCase = function() { - return /** @type {proto.org.dash.platform.dapi.v0.GetDocumentsResponse.VersionCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.oneofGroups_[0])); +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.getStartCase = function() { + return /** @type {proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.StartCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.oneofGroups_[0])); }; @@ -24822,8 +24809,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.toObject = function(opt_includeInstance) { - return proto.org.dash.platform.dapi.v0.GetDocumentsResponse.toObject(opt_includeInstance, this); +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.toObject(opt_includeInstance, this); }; @@ -24832,13 +24819,23 @@ proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.toObject = functi * @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.GetDocumentsResponse} msg The msg instance to transform. + * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.toObject = function(includeInstance, msg) { +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.toObject = function(includeInstance, msg) { var f, obj = { - v0: (f = msg.getV0()) && proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.toObject(includeInstance, f) + dataContractId: msg.getDataContractId_asB64(), + documentType: jspb.Message.getFieldWithDefault(msg, 2, ""), + where: msg.getWhere_asB64(), + orderBy: msg.getOrderBy_asB64(), + limit: jspb.Message.getFieldWithDefault(msg, 5, 0), + startAfter: msg.getStartAfter_asB64(), + startAt: msg.getStartAt_asB64(), + prove: jspb.Message.getBooleanFieldWithDefault(msg, 8, false), + select: jspb.Message.getFieldWithDefault(msg, 9, 0), + groupByList: (f = jspb.Message.getRepeatedField(msg, 10)) == null ? undefined : f, + having: msg.getHaving_asB64() }; if (includeInstance) { @@ -24852,23 +24849,23 @@ proto.org.dash.platform.dapi.v0.GetDocumentsResponse.toObject = function(include /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse} + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1} */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.deserializeBinary = function(bytes) { +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.org.dash.platform.dapi.v0.GetDocumentsResponse; - return proto.org.dash.platform.dapi.v0.GetDocumentsResponse.deserializeBinaryFromReader(msg, reader); + var msg = new proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1; + return proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.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.GetDocumentsResponse} msg The message object to deserialize into. + * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse} + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1} */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.deserializeBinaryFromReader = function(msg, reader) { +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -24876,9 +24873,48 @@ proto.org.dash.platform.dapi.v0.GetDocumentsResponse.deserializeBinaryFromReader var field = reader.getFieldNumber(); switch (field) { case 1: - var value = new proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0; - reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.deserializeBinaryFromReader); - msg.setV0(value); + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setDataContractId(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setDocumentType(value); + break; + case 3: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setWhere(value); + break; + case 4: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setOrderBy(value); + break; + case 5: + var value = /** @type {number} */ (reader.readUint32()); + msg.setLimit(value); + break; + case 6: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setStartAfter(value); + break; + case 7: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setStartAt(value); + break; + case 8: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setProve(value); + break; + case 9: + var value = /** @type {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.Select} */ (reader.readEnum()); + msg.setSelect(value); + break; + case 10: + var value = /** @type {string} */ (reader.readString()); + msg.addGroupBy(value); + break; + case 11: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setHaving(value); break; default: reader.skipField(); @@ -24893,9 +24929,9 @@ proto.org.dash.platform.dapi.v0.GetDocumentsResponse.deserializeBinaryFromReader * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.serializeBinary = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.org.dash.platform.dapi.v0.GetDocumentsResponse.serializeBinaryToWriter(this, writer); + proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -24903,396 +24939,540 @@ proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.serializeBinary = /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse} message + * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.serializeBinaryToWriter = function(message, writer) { +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getV0(); - if (f != null) { - writer.writeMessage( + f = message.getDataContractId_asU8(); + if (f.length > 0) { + writer.writeBytes( 1, - f, - proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.serializeBinaryToWriter + f + ); + } + f = message.getDocumentType(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getWhere_asU8(); + if (f.length > 0) { + writer.writeBytes( + 3, + f + ); + } + f = message.getOrderBy_asU8(); + if (f.length > 0) { + writer.writeBytes( + 4, + f + ); + } + f = /** @type {number} */ (jspb.Message.getField(message, 5)); + if (f != null) { + writer.writeUint32( + 5, + f + ); + } + f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 6)); + if (f != null) { + writer.writeBytes( + 6, + f + ); + } + f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 7)); + if (f != null) { + writer.writeBytes( + 7, + f + ); + } + f = message.getProve(); + if (f) { + writer.writeBool( + 8, + f + ); + } + f = message.getSelect(); + if (f !== 0.0) { + writer.writeEnum( + 9, + f + ); + } + f = message.getGroupByList(); + if (f.length > 0) { + writer.writeRepeatedString( + 10, + f + ); + } + f = message.getHaving_asU8(); + if (f.length > 0) { + writer.writeBytes( + 11, + f ); } }; - /** - * 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 + * @enum {number} */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.oneofGroups_ = [[1,2]]; +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.Select = { + DOCUMENTS: 0, + COUNT: 1 +}; /** - * @enum {number} + * optional bytes data_contract_id = 1; + * @return {string} */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.ResultCase = { - RESULT_NOT_SET: 0, - DOCUMENTS: 1, - PROOF: 2 +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.getDataContractId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; + /** - * @return {proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.ResultCase} + * optional bytes data_contract_id = 1; + * This is a type-conversion wrapper around `getDataContractId()` + * @return {string} */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.prototype.getResultCase = function() { - return /** @type {proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.ResultCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.oneofGroups_[0])); +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.getDataContractId_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getDataContractId())); }; - -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} + * optional bytes data_contract_id = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getDataContractId()` + * @return {!Uint8Array} */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.prototype.toObject = function(opt_includeInstance) { - return proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.toObject(opt_includeInstance, this); +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.getDataContractId_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getDataContractId())); }; /** - * 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.GetDocumentsResponse.GetDocumentsResponseV0} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages + * @param {!(string|Uint8Array)} value + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.toObject = function(includeInstance, msg) { - var f, obj = { - documents: (f = msg.getDocuments()) && proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.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) - }; +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.setDataContractId = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); +}; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; + +/** + * optional string document_type = 2; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.getDocumentType = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; -} /** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} + * @param {string} value + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0; - return proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.deserializeBinaryFromReader(msg, reader); +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.setDocumentType = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); }; /** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} + * optional bytes where = 3; + * @return {string} */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.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.GetDocumentsResponse.GetDocumentsResponseV0.Documents; - reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.deserializeBinaryFromReader); - msg.setDocuments(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; +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.getWhere = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); }; /** - * Serializes the message to binary data (in protobuf wire format). + * optional bytes where = 3; + * This is a type-conversion wrapper around `getWhere()` + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.getWhere_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getWhere())); +}; + + +/** + * optional bytes where = 3; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getWhere()` * @return {!Uint8Array} */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.getWhere_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getWhere())); }; /** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages + * @param {!(string|Uint8Array)} value + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getDocuments(); - if (f != null) { - writer.writeMessage( - 1, - f, - proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.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 - ); - } +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.setWhere = function(value) { + return jspb.Message.setProto3BytesField(this, 3, value); }; +/** + * optional bytes order_by = 4; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.getOrderBy = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + /** - * List of repeated fields within this message type. - * @private {!Array} - * @const + * optional bytes order_by = 4; + * This is a type-conversion wrapper around `getOrderBy()` + * @return {string} */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.repeatedFields_ = [1]; +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.getOrderBy_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getOrderBy())); +}; +/** + * optional bytes order_by = 4; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getOrderBy()` + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.getOrderBy_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getOrderBy())); +}; + -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} + * @param {!(string|Uint8Array)} value + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.prototype.toObject = function(opt_includeInstance) { - return proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.toObject(opt_includeInstance, this); +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.setOrderBy = function(value) { + return jspb.Message.setProto3BytesField(this, 4, value); }; /** - * 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.GetDocumentsResponse.GetDocumentsResponseV0.Documents} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages + * optional uint32 limit = 5; + * @return {number} */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.toObject = function(includeInstance, msg) { - var f, obj = { - documentsList: msg.getDocumentsList_asB64() - }; +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.getLimit = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); +}; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; + +/** + * @param {number} value + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1} returns this + */ +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.setLimit = function(value) { + return jspb.Message.setField(this, 5, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1} returns this + */ +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.clearLimit = function() { + return jspb.Message.setField(this, 5, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.hasLimit = function() { + return jspb.Message.getField(this, 5) != null; +}; + + +/** + * optional bytes start_after = 6; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.getStartAfter = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, "")); +}; + + +/** + * optional bytes start_after = 6; + * This is a type-conversion wrapper around `getStartAfter()` + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.getStartAfter_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getStartAfter())); +}; + + +/** + * optional bytes start_after = 6; + * 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.GetDocumentsRequest.GetDocumentsRequestV1.prototype.getStartAfter_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getStartAfter())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1} returns this + */ +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.setStartAfter = function(value) { + return jspb.Message.setOneofField(this, 6, proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.oneofGroups_[0], value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1} returns this + */ +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.clearStartAfter = function() { + return jspb.Message.setOneofField(this, 6, proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.oneofGroups_[0], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.hasStartAfter = function() { + return jspb.Message.getField(this, 6) != null; +}; + + +/** + * optional bytes start_at = 7; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.getStartAt = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 7, "")); +}; + + +/** + * optional bytes start_at = 7; + * This is a type-conversion wrapper around `getStartAt()` + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.getStartAt_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getStartAt())); +}; + + +/** + * optional bytes start_at = 7; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getStartAt()` + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.getStartAt_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getStartAt())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1} returns this + */ +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.setStartAt = function(value) { + return jspb.Message.setOneofField(this, 7, proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.oneofGroups_[0], value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1} returns this + */ +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.clearStartAt = function() { + return jspb.Message.setOneofField(this, 7, proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.oneofGroups_[0], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.hasStartAt = function() { + return jspb.Message.getField(this, 7) != null; +}; + + +/** + * optional bool prove = 8; + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.getProve = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 8, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1} returns this + */ +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.setProve = function(value) { + return jspb.Message.setProto3BooleanField(this, 8, value); }; -} /** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} + * optional Select select = 9; + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.Select} */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents; - return proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.deserializeBinaryFromReader(msg, reader); +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.getSelect = function() { + return /** @type {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.Select} */ (jspb.Message.getFieldWithDefault(this, 9, 0)); }; /** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} + * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.Select} value + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.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.addDocuments(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.setSelect = function(value) { + return jspb.Message.setProto3EnumField(this, 9, value); }; /** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} + * repeated string group_by = 10; + * @return {!Array} */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.getGroupByList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 10)); }; /** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages + * @param {!Array} value + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getDocumentsList_asU8(); - if (f.length > 0) { - writer.writeRepeatedBytes( - 1, - f - ); - } +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.setGroupByList = function(value) { + return jspb.Message.setField(this, 10, value || []); }; /** - * repeated bytes documents = 1; - * @return {!Array} + * @param {string} value + * @param {number=} opt_index + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.prototype.getDocumentsList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.addGroupBy = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 10, value, opt_index); }; /** - * repeated bytes documents = 1; - * This is a type-conversion wrapper around `getDocumentsList()` - * @return {!Array} + * Clears the list making it empty but non-null. + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.prototype.getDocumentsList_asB64 = function() { - return /** @type {!Array} */ (jspb.Message.bytesListAsB64( - this.getDocumentsList())); +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.clearGroupByList = function() { + return this.setGroupByList([]); }; /** - * repeated bytes documents = 1; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getDocumentsList()` - * @return {!Array} + * optional bytes having = 11; + * @return {string} */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.prototype.getDocumentsList_asU8 = function() { - return /** @type {!Array} */ (jspb.Message.bytesListAsU8( - this.getDocumentsList())); +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.getHaving = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 11, "")); }; /** - * @param {!(Array|Array)} value - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} returns this + * optional bytes having = 11; + * This is a type-conversion wrapper around `getHaving()` + * @return {string} */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.prototype.setDocumentsList = function(value) { - return jspb.Message.setField(this, 1, value || []); +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.getHaving_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getHaving())); }; /** - * @param {!(string|Uint8Array)} value - * @param {number=} opt_index - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} returns this + * optional bytes having = 11; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getHaving()` + * @return {!Uint8Array} */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.prototype.addDocuments = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 1, value, opt_index); +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.getHaving_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getHaving())); }; /** - * Clears the list making it empty but non-null. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} returns this + * @param {!(string|Uint8Array)} value + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.prototype.clearDocumentsList = function() { - return this.setDocumentsList([]); +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.setHaving = function(value) { + return jspb.Message.setProto3BytesField(this, 11, value); }; /** - * optional Documents documents = 1; - * @return {?proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} + * optional GetDocumentsRequestV0 v0 = 1; + * @return {?proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0} */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.prototype.getDocuments = function() { - return /** @type{?proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} */ ( - jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents, 1)); +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getV0 = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0, 1)); }; /** - * @param {?proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents|undefined} value - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} returns this + * @param {?proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.prototype.setDocuments = function(value) { - return jspb.Message.setOneofWrapperField(this, 1, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.oneofGroups_[0], value); +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.setV0 = function(value) { + return jspb.Message.setOneofWrapperField(this, 1, proto.org.dash.platform.dapi.v0.GetDocumentsRequest.oneofGroups_[0], value); }; /** * Clears the message field making it undefined. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.prototype.clearDocuments = function() { - return this.setDocuments(undefined); +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.clearV0 = function() { + return this.setV0(undefined); }; @@ -25300,36 +25480,36 @@ proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.prot * Returns whether this field is set. * @return {boolean} */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.prototype.hasDocuments = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.hasV0 = function() { return jspb.Message.getField(this, 1) != null; }; /** - * optional Proof proof = 2; - * @return {?proto.org.dash.platform.dapi.v0.Proof} + * optional GetDocumentsRequestV1 v1 = 2; + * @return {?proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1} */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.prototype.getProof = function() { - return /** @type{?proto.org.dash.platform.dapi.v0.Proof} */ ( - jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.Proof, 2)); +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getV1 = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1, 2)); }; /** - * @param {?proto.org.dash.platform.dapi.v0.Proof|undefined} value - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} returns this + * @param {?proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.prototype.setProof = function(value) { - return jspb.Message.setOneofWrapperField(this, 2, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.oneofGroups_[0], value); +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.setV1 = function(value) { + return jspb.Message.setOneofWrapperField(this, 2, proto.org.dash.platform.dapi.v0.GetDocumentsRequest.oneofGroups_[0], value); }; /** * Clears the message field making it undefined. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.prototype.clearProof = function() { - return this.setProof(undefined); +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.clearV1 = function() { + return this.setV1(undefined); }; @@ -25337,82 +25517,162 @@ proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.prot * Returns whether this field is set. * @return {boolean} */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.prototype.hasProof = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.hasV1 = function() { return jspb.Message.getField(this, 2) != null; }; + /** - * optional ResponseMetadata metadata = 3; - * @return {?proto.org.dash.platform.dapi.v0.ResponseMetadata} + * 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.GetDocumentsResponse.GetDocumentsResponseV0.prototype.getMetadata = function() { - return /** @type{?proto.org.dash.platform.dapi.v0.ResponseMetadata} */ ( - jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.ResponseMetadata, 3)); -}; +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.oneofGroups_ = [[1,2]]; +/** + * @enum {number} + */ +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.VersionCase = { + VERSION_NOT_SET: 0, + V0: 1, + V1: 2 +}; /** - * @param {?proto.org.dash.platform.dapi.v0.ResponseMetadata|undefined} value - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} returns this -*/ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.prototype.setMetadata = function(value) { - return jspb.Message.setWrapperField(this, 3, value); + * @return {proto.org.dash.platform.dapi.v0.GetDocumentsResponse.VersionCase} + */ +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.getVersionCase = function() { + return /** @type {proto.org.dash.platform.dapi.v0.GetDocumentsResponse.VersionCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.oneofGroups_[0])); }; + +if (jspb.Message.GENERATE_TO_OBJECT) { /** - * Clears the message field making it undefined. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} returns this + * 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.GetDocumentsResponse.GetDocumentsResponseV0.prototype.clearMetadata = function() { - return this.setMetadata(undefined); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetDocumentsResponse.toObject(opt_includeInstance, this); }; /** - * Returns whether this field is set. - * @return {boolean} + * 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.GetDocumentsResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.prototype.hasMetadata = function() { - return jspb.Message.getField(this, 3) != null; +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.toObject = function(includeInstance, msg) { + var f, obj = { + v0: (f = msg.getV0()) && proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.toObject(includeInstance, f), + v1: (f = msg.getV1()) && proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; }; +} /** - * optional GetDocumentsResponseV0 v0 = 1; - * @return {?proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse} */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.getV0 = function() { - return /** @type{?proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} */ ( - jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0, 1)); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetDocumentsResponse; + return proto.org.dash.platform.dapi.v0.GetDocumentsResponse.deserializeBinaryFromReader(msg, reader); }; /** - * @param {?proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0|undefined} value - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse} returns this -*/ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.setV0 = function(value) { - return jspb.Message.setOneofWrapperField(this, 1, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.oneofGroups_[0], value); + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse} + */ +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.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.GetDocumentsResponse.GetDocumentsResponseV0; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.deserializeBinaryFromReader); + msg.setV0(value); + break; + case 2: + var value = new proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.deserializeBinaryFromReader); + msg.setV1(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; }; /** - * Clears the message field making it undefined. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse} returns this + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.clearV0 = function() { - return this.setV0(undefined); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetDocumentsResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); }; /** - * Returns whether this field is set. - * @return {boolean} + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.hasV0 = function() { - return jspb.Message.getField(this, 1) != null; +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getV0(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.serializeBinaryToWriter + ); + } + f = message.getV1(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.serializeBinaryToWriter + ); + } }; @@ -25425,21 +25685,22 @@ proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.hasV0 = function( * @private {!Array>} * @const */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.oneofGroups_ = [[1]]; +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.oneofGroups_ = [[1,2]]; /** * @enum {number} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.VersionCase = { - VERSION_NOT_SET: 0, - V0: 1 +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.ResultCase = { + RESULT_NOT_SET: 0, + DOCUMENTS: 1, + PROOF: 2 }; /** - * @return {proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.VersionCase} + * @return {proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.ResultCase} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.prototype.getVersionCase = function() { - return /** @type {proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.VersionCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.oneofGroups_[0])); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.prototype.getResultCase = function() { + return /** @type {proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.ResultCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.oneofGroups_[0])); }; @@ -25457,8 +25718,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.prototype.toObject = function(opt_includeInstance) { - return proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.toObject(opt_includeInstance, this); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.toObject(opt_includeInstance, this); }; @@ -25467,13 +25728,15 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.prototype.toObject = fu * @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.GetDocumentsCountRequest} msg The msg instance to transform. + * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.toObject = function(includeInstance, msg) { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.toObject = function(includeInstance, msg) { var f, obj = { - v0: (f = msg.getV0()) && proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.toObject(includeInstance, f) + documents: (f = msg.getDocuments()) && proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.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) { @@ -25487,23 +25750,23 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.toObject = function(inc /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest} + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.deserializeBinary = function(bytes) { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest; - return proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.deserializeBinaryFromReader(msg, reader); + var msg = new proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0; + return proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.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.GetDocumentsCountRequest} msg The message object to deserialize into. + * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest} + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.deserializeBinaryFromReader = function(msg, reader) { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -25511,9 +25774,19 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.deserializeBinaryFromRe var field = reader.getFieldNumber(); switch (field) { case 1: - var value = new proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0; - reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.deserializeBinaryFromReader); - msg.setV0(value); + var value = new proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.deserializeBinaryFromReader); + msg.setDocuments(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(); @@ -25528,9 +25801,9 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.deserializeBinaryFromRe * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.prototype.serializeBinary = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.serializeBinaryToWriter(this, writer); + proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -25538,24 +25811,47 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.prototype.serializeBina /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest} message + * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.serializeBinaryToWriter = function(message, writer) { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getV0(); + f = message.getDocuments(); if (f != null) { writer.writeMessage( 1, f, - proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.serializeBinaryToWriter + proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.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 ); } }; +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.repeatedFields_ = [1]; + if (jspb.Message.GENERATE_TO_OBJECT) { @@ -25571,8 +25867,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.prototype.toObject = function(opt_includeInstance) { - return proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.toObject(opt_includeInstance, this); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.toObject(opt_includeInstance, this); }; @@ -25581,19 +25877,13 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountReques * @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.GetDocumentsCountRequest.GetDocumentsCountRequestV0} msg The msg instance to transform. + * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.toObject = function(includeInstance, msg) { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.toObject = function(includeInstance, msg) { var f, obj = { - dataContractId: msg.getDataContractId_asB64(), - documentType: jspb.Message.getFieldWithDefault(msg, 2, ""), - where: msg.getWhere_asB64(), - returnDistinctCountsInRange: jspb.Message.getBooleanFieldWithDefault(msg, 4, false), - orderBy: msg.getOrderBy_asB64(), - limit: jspb.Message.getFieldWithDefault(msg, 6, 0), - prove: jspb.Message.getBooleanFieldWithDefault(msg, 7, false) + documentsList: msg.getDocumentsList_asB64() }; if (includeInstance) { @@ -25607,23 +25897,23 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountReques /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0} + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.deserializeBinary = function(bytes) { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0; - return proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.deserializeBinaryFromReader(msg, reader); + var msg = new proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents; + return proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.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.GetDocumentsCountRequest.GetDocumentsCountRequestV0} msg The message object to deserialize into. + * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0} + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.deserializeBinaryFromReader = function(msg, reader) { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -25632,31 +25922,7 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountReques switch (field) { case 1: var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setDataContractId(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setDocumentType(value); - break; - case 3: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setWhere(value); - break; - case 4: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setReturnDistinctCountsInRange(value); - break; - case 5: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setOrderBy(value); - break; - case 6: - var value = /** @type {number} */ (reader.readUint32()); - msg.setLimit(value); - break; - case 7: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setProve(value); + msg.addDocuments(value); break; default: reader.skipField(); @@ -25671,9 +25937,9 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountReques * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.prototype.serializeBinary = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.serializeBinaryToWriter(this, writer); + proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -25681,305 +25947,182 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountReques /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0} message + * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.serializeBinaryToWriter = function(message, writer) { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getDataContractId_asU8(); - if (f.length > 0) { - writer.writeBytes( - 1, - f - ); - } - f = message.getDocumentType(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } - f = message.getWhere_asU8(); - if (f.length > 0) { - writer.writeBytes( - 3, - f - ); - } - f = message.getReturnDistinctCountsInRange(); - if (f) { - writer.writeBool( - 4, - f - ); - } - f = message.getOrderBy_asU8(); - if (f.length > 0) { - writer.writeBytes( - 5, - f - ); - } - f = /** @type {number} */ (jspb.Message.getField(message, 6)); - if (f != null) { - writer.writeUint32( - 6, - f - ); - } - f = message.getProve(); - if (f) { - writer.writeBool( - 7, - f - ); - } -}; - - -/** - * optional bytes data_contract_id = 1; - * @return {string} - */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.prototype.getDataContractId = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * optional bytes data_contract_id = 1; - * This is a type-conversion wrapper around `getDataContractId()` - * @return {string} - */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.prototype.getDataContractId_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getDataContractId())); -}; - - -/** - * optional bytes data_contract_id = 1; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getDataContractId()` - * @return {!Uint8Array} - */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.prototype.getDataContractId_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getDataContractId())); -}; - - -/** - * @param {!(string|Uint8Array)} value - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0} returns this - */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.prototype.setDataContractId = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); -}; - - -/** - * optional string document_type = 2; - * @return {string} - */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.prototype.getDocumentType = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0} returns this - */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.prototype.setDocumentType = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - - -/** - * optional bytes where = 3; - * @return {string} - */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.prototype.getWhere = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); -}; - - -/** - * optional bytes where = 3; - * This is a type-conversion wrapper around `getWhere()` - * @return {string} - */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.prototype.getWhere_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getWhere())); + f = message.getDocumentsList_asU8(); + if (f.length > 0) { + writer.writeRepeatedBytes( + 1, + f + ); + } }; /** - * optional bytes where = 3; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getWhere()` - * @return {!Uint8Array} + * repeated bytes documents = 1; + * @return {!Array} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.prototype.getWhere_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getWhere())); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.prototype.getDocumentsList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); }; /** - * @param {!(string|Uint8Array)} value - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0} returns this + * repeated bytes documents = 1; + * This is a type-conversion wrapper around `getDocumentsList()` + * @return {!Array} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.prototype.setWhere = function(value) { - return jspb.Message.setProto3BytesField(this, 3, value); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.prototype.getDocumentsList_asB64 = function() { + return /** @type {!Array} */ (jspb.Message.bytesListAsB64( + this.getDocumentsList())); }; /** - * optional bool return_distinct_counts_in_range = 4; - * @return {boolean} + * repeated bytes documents = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getDocumentsList()` + * @return {!Array} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.prototype.getReturnDistinctCountsInRange = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 4, false)); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.prototype.getDocumentsList_asU8 = function() { + return /** @type {!Array} */ (jspb.Message.bytesListAsU8( + this.getDocumentsList())); }; /** - * @param {boolean} value - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0} returns this + * @param {!(Array|Array)} value + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.prototype.setReturnDistinctCountsInRange = function(value) { - return jspb.Message.setProto3BooleanField(this, 4, value); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.prototype.setDocumentsList = function(value) { + return jspb.Message.setField(this, 1, value || []); }; /** - * optional bytes order_by = 5; - * @return {string} + * @param {!(string|Uint8Array)} value + * @param {number=} opt_index + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.prototype.getOrderBy = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, "")); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.prototype.addDocuments = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 1, value, opt_index); }; /** - * optional bytes order_by = 5; - * This is a type-conversion wrapper around `getOrderBy()` - * @return {string} + * Clears the list making it empty but non-null. + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.prototype.getOrderBy_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getOrderBy())); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.prototype.clearDocumentsList = function() { + return this.setDocumentsList([]); }; /** - * optional bytes order_by = 5; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getOrderBy()` - * @return {!Uint8Array} + * optional Documents documents = 1; + * @return {?proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.prototype.getOrderBy_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getOrderBy())); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.prototype.getDocuments = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents, 1)); }; /** - * @param {!(string|Uint8Array)} value - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0} returns this - */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.prototype.setOrderBy = function(value) { - return jspb.Message.setProto3BytesField(this, 5, value); + * @param {?proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} returns this +*/ +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.prototype.setDocuments = function(value) { + return jspb.Message.setOneofWrapperField(this, 1, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.oneofGroups_[0], value); }; /** - * optional uint32 limit = 6; - * @return {number} + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.prototype.getLimit = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 6, 0)); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.prototype.clearDocuments = function() { + return this.setDocuments(undefined); }; /** - * @param {number} value - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0} returns this + * Returns whether this field is set. + * @return {boolean} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.prototype.setLimit = function(value) { - return jspb.Message.setField(this, 6, value); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.prototype.hasDocuments = function() { + return jspb.Message.getField(this, 1) != null; }; /** - * Clears the field making it undefined. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0} returns this + * optional Proof proof = 2; + * @return {?proto.org.dash.platform.dapi.v0.Proof} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.prototype.clearLimit = function() { - return jspb.Message.setField(this, 6, undefined); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.prototype.getProof = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.Proof} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.Proof, 2)); }; /** - * Returns whether this field is set. - * @return {boolean} - */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.prototype.hasLimit = function() { - return jspb.Message.getField(this, 6) != null; + * @param {?proto.org.dash.platform.dapi.v0.Proof|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} returns this +*/ +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.prototype.setProof = function(value) { + return jspb.Message.setOneofWrapperField(this, 2, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.oneofGroups_[0], value); }; /** - * optional bool prove = 7; - * @return {boolean} + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.prototype.getProve = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 7, false)); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.prototype.clearProof = function() { + return this.setProof(undefined); }; /** - * @param {boolean} value - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0} returns this + * Returns whether this field is set. + * @return {boolean} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.prototype.setProve = function(value) { - return jspb.Message.setProto3BooleanField(this, 7, value); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.prototype.hasProof = function() { + return jspb.Message.getField(this, 2) != null; }; /** - * optional GetDocumentsCountRequestV0 v0 = 1; - * @return {?proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0} + * optional ResponseMetadata metadata = 3; + * @return {?proto.org.dash.platform.dapi.v0.ResponseMetadata} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.prototype.getV0 = function() { - return /** @type{?proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0} */ ( - jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0, 1)); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.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.GetDocumentsCountRequest.GetDocumentsCountRequestV0|undefined} value - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest} returns this + * @param {?proto.org.dash.platform.dapi.v0.ResponseMetadata|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.prototype.setV0 = function(value) { - return jspb.Message.setOneofWrapperField(this, 1, proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.oneofGroups_[0], value); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.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.GetDocumentsCountRequest} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.prototype.clearV0 = function() { - return this.setV0(undefined); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.prototype.clearMetadata = function() { + return this.setMetadata(undefined); }; @@ -25987,8 +26130,8 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.prototype.clearV0 = fun * Returns whether this field is set. * @return {boolean} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.prototype.hasV0 = function() { - return jspb.Message.getField(this, 1) != null; +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.prototype.hasMetadata = function() { + return jspb.Message.getField(this, 3) != null; }; @@ -26001,21 +26144,22 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.prototype.hasV0 = funct * @private {!Array>} * @const */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.oneofGroups_ = [[1]]; +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.oneofGroups_ = [[1,2]]; /** * @enum {number} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.VersionCase = { - VERSION_NOT_SET: 0, - V0: 1 +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultCase = { + RESULT_NOT_SET: 0, + DATA: 1, + PROOF: 2 }; /** - * @return {proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.VersionCase} + * @return {proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultCase} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.prototype.getVersionCase = function() { - return /** @type {proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.VersionCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.oneofGroups_[0])); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.prototype.getResultCase = function() { + return /** @type {proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.oneofGroups_[0])); }; @@ -26033,8 +26177,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.prototype.toObject = function(opt_includeInstance) { - return proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.toObject(opt_includeInstance, this); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.toObject(opt_includeInstance, this); }; @@ -26043,13 +26187,15 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.prototype.toObject = f * @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.GetDocumentsCountResponse} msg The msg instance to transform. + * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.toObject = function(includeInstance, msg) { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.toObject = function(includeInstance, msg) { var f, obj = { - v0: (f = msg.getV0()) && proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.toObject(includeInstance, f) + data: (f = msg.getData()) && proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.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) { @@ -26063,23 +26209,23 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.toObject = function(in /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse} + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.deserializeBinary = function(bytes) { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse; - return proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.deserializeBinaryFromReader(msg, reader); + var msg = new proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1; + return proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.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.GetDocumentsCountResponse} msg The message object to deserialize into. + * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse} + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.deserializeBinaryFromReader = function(msg, reader) { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -26087,9 +26233,19 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.deserializeBinaryFromR var field = reader.getFieldNumber(); switch (field) { case 1: - var value = new proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0; - reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.deserializeBinaryFromReader); - msg.setV0(value); + var value = new proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.deserializeBinaryFromReader); + msg.setData(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(); @@ -26104,9 +26260,9 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.deserializeBinaryFromR * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.prototype.serializeBinary = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.serializeBinaryToWriter(this, writer); + proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -26114,18 +26270,34 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.prototype.serializeBin /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse} message + * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.serializeBinaryToWriter = function(message, writer) { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getV0(); + f = message.getData(); if (f != null) { writer.writeMessage( 1, f, - proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.serializeBinaryToWriter + proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.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 ); } }; @@ -26133,30 +26305,11 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.serializeBinaryToWrite /** - * 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>} + * List of repeated fields within this message type. + * @private {!Array} * @const */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.oneofGroups_ = [[1,2]]; - -/** - * @enum {number} - */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.ResultCase = { - RESULT_NOT_SET: 0, - COUNTS: 1, - PROOF: 2 -}; - -/** - * @return {proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.ResultCase} - */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.prototype.getResultCase = function() { - return /** @type {proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.ResultCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.oneofGroups_[0])); -}; +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents.repeatedFields_ = [1]; @@ -26173,8 +26326,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.prototype.toObject = function(opt_includeInstance) { - return proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.toObject(opt_includeInstance, this); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents.toObject(opt_includeInstance, this); }; @@ -26183,15 +26336,13 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo * @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.GetDocumentsCountResponse.GetDocumentsCountResponseV0} msg The msg instance to transform. + * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.toObject = function(includeInstance, msg) { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents.toObject = function(includeInstance, msg) { var f, obj = { - counts: (f = msg.getCounts()) && proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.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) + documentsList: msg.getDocumentsList_asB64() }; if (includeInstance) { @@ -26205,23 +26356,23 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0} + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.deserializeBinary = function(bytes) { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0; - return proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.deserializeBinaryFromReader(msg, reader); + var msg = new proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents; + return proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents.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.GetDocumentsCountResponse.GetDocumentsCountResponseV0} msg The message object to deserialize into. + * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0} + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.deserializeBinaryFromReader = function(msg, reader) { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -26229,19 +26380,8 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo var field = reader.getFieldNumber(); switch (field) { case 1: - var value = new proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults; - reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.deserializeBinaryFromReader); - msg.setCounts(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); + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.addDocuments(value); break; default: reader.skipField(); @@ -26253,49 +26393,93 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo /** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents.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.GetDocumentsResponse.GetDocumentsResponseV1.Documents} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getDocumentsList_asU8(); + if (f.length > 0) { + writer.writeRepeatedBytes( + 1, + f + ); + } +}; + + +/** + * repeated bytes documents = 1; + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents.prototype.getDocumentsList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); +}; + + +/** + * repeated bytes documents = 1; + * This is a type-conversion wrapper around `getDocumentsList()` + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents.prototype.getDocumentsList_asB64 = function() { + return /** @type {!Array} */ (jspb.Message.bytesListAsB64( + this.getDocumentsList())); +}; + + +/** + * repeated bytes documents = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getDocumentsList()` + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents.prototype.getDocumentsList_asU8 = function() { + return /** @type {!Array} */ (jspb.Message.bytesListAsU8( + this.getDocumentsList())); +}; + + +/** + * @param {!(Array|Array)} value + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents} returns this + */ +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents.prototype.setDocumentsList = function(value) { + return jspb.Message.setField(this, 1, value || []); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @param {number=} opt_index + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents.prototype.addDocuments = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 1, value, opt_index); }; /** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages + * Clears the list making it empty but non-null. + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getCounts(); - if (f != null) { - writer.writeMessage( - 1, - f, - proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.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 - ); - } +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents.prototype.clearDocumentsList = function() { + return this.setDocumentsList([]); }; @@ -26315,8 +26499,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry.prototype.toObject = function(opt_includeInstance) { - return proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry.toObject(opt_includeInstance, this); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry.toObject(opt_includeInstance, this); }; @@ -26325,11 +26509,11 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo * @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.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry} msg The msg instance to transform. + * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry.toObject = function(includeInstance, msg) { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry.toObject = function(includeInstance, msg) { var f, obj = { inKey: msg.getInKey_asB64(), key: msg.getKey_asB64(), @@ -26347,23 +26531,23 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry} + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry.deserializeBinary = function(bytes) { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry; - return proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry.deserializeBinaryFromReader(msg, reader); + var msg = new proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry; + return proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry.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.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry} msg The message object to deserialize into. + * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry} + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry.deserializeBinaryFromReader = function(msg, reader) { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -26395,9 +26579,9 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry.prototype.serializeBinary = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry.serializeBinaryToWriter(this, writer); + proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -26405,11 +26589,11 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry} message + * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry.serializeBinaryToWriter = function(message, writer) { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 1)); if (f != null) { @@ -26439,7 +26623,7 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo * optional bytes in_key = 1; * @return {string} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry.prototype.getInKey = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry.prototype.getInKey = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; @@ -26449,7 +26633,7 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo * This is a type-conversion wrapper around `getInKey()` * @return {string} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry.prototype.getInKey_asB64 = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry.prototype.getInKey_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getInKey())); }; @@ -26462,7 +26646,7 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo * This is a type-conversion wrapper around `getInKey()` * @return {!Uint8Array} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry.prototype.getInKey_asU8 = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry.prototype.getInKey_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getInKey())); }; @@ -26470,18 +26654,18 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo /** * @param {!(string|Uint8Array)} value - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry.prototype.setInKey = function(value) { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry.prototype.setInKey = function(value) { return jspb.Message.setField(this, 1, value); }; /** * Clears the field making it undefined. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry.prototype.clearInKey = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry.prototype.clearInKey = function() { return jspb.Message.setField(this, 1, undefined); }; @@ -26490,7 +26674,7 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo * Returns whether this field is set. * @return {boolean} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry.prototype.hasInKey = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry.prototype.hasInKey = function() { return jspb.Message.getField(this, 1) != null; }; @@ -26499,7 +26683,7 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo * optional bytes key = 2; * @return {string} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry.prototype.getKey = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry.prototype.getKey = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; @@ -26509,7 +26693,7 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo * This is a type-conversion wrapper around `getKey()` * @return {string} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry.prototype.getKey_asB64 = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry.prototype.getKey_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getKey())); }; @@ -26522,7 +26706,7 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo * This is a type-conversion wrapper around `getKey()` * @return {!Uint8Array} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry.prototype.getKey_asU8 = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry.prototype.getKey_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getKey())); }; @@ -26530,9 +26714,9 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo /** * @param {!(string|Uint8Array)} value - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry.prototype.setKey = function(value) { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry.prototype.setKey = function(value) { return jspb.Message.setProto3BytesField(this, 2, value); }; @@ -26541,16 +26725,16 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo * optional uint64 count = 3; * @return {string} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry.prototype.getCount = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry.prototype.getCount = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "0")); }; /** * @param {string} value - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry.prototype.setCount = function(value) { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry.prototype.setCount = function(value) { return jspb.Message.setProto3StringIntField(this, 3, value); }; @@ -26561,7 +26745,7 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo * @private {!Array} * @const */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries.repeatedFields_ = [1]; +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries.repeatedFields_ = [1]; @@ -26578,8 +26762,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries.prototype.toObject = function(opt_includeInstance) { - return proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries.toObject(opt_includeInstance, this); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries.toObject(opt_includeInstance, this); }; @@ -26588,14 +26772,14 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo * @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.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries} msg The msg instance to transform. + * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries.toObject = function(includeInstance, msg) { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries.toObject = function(includeInstance, msg) { var f, obj = { entriesList: jspb.Message.toObjectList(msg.getEntriesList(), - proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry.toObject, includeInstance) + proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry.toObject, includeInstance) }; if (includeInstance) { @@ -26609,23 +26793,23 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries} + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries.deserializeBinary = function(bytes) { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries; - return proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries.deserializeBinaryFromReader(msg, reader); + var msg = new proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries; + return proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries.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.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries} msg The message object to deserialize into. + * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries} + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries.deserializeBinaryFromReader = function(msg, reader) { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -26633,8 +26817,8 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo var field = reader.getFieldNumber(); switch (field) { case 1: - var value = new proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry; - reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry.deserializeBinaryFromReader); + var value = new proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry.deserializeBinaryFromReader); msg.addEntries(value); break; default: @@ -26650,9 +26834,9 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries.prototype.serializeBinary = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries.serializeBinaryToWriter(this, writer); + proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -26660,18 +26844,18 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries} message + * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries.serializeBinaryToWriter = function(message, writer) { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getEntriesList(); if (f.length > 0) { writer.writeRepeatedMessage( 1, f, - proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry.serializeBinaryToWriter + proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry.serializeBinaryToWriter ); } }; @@ -26679,38 +26863,38 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo /** * repeated CountEntry entries = 1; - * @return {!Array} + * @return {!Array} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries.prototype.getEntriesList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry, 1)); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries.prototype.getEntriesList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry, 1)); }; /** - * @param {!Array} value - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries} returns this + * @param {!Array} value + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries.prototype.setEntriesList = function(value) { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries.prototype.setEntriesList = function(value) { return jspb.Message.setRepeatedWrapperField(this, 1, value); }; /** - * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry=} opt_value + * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry=} opt_value * @param {number=} opt_index - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry} + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries.prototype.addEntries = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry, opt_index); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries.prototype.addEntries = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry, opt_index); }; /** * Clears the list making it empty but non-null. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries.prototype.clearEntriesList = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries.prototype.clearEntriesList = function() { return this.setEntriesList([]); }; @@ -26724,22 +26908,22 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo * @private {!Array>} * @const */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.oneofGroups_ = [[1,2]]; +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.oneofGroups_ = [[1,2]]; /** * @enum {number} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.VariantCase = { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.VariantCase = { VARIANT_NOT_SET: 0, AGGREGATE_COUNT: 1, ENTRIES: 2 }; /** - * @return {proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.VariantCase} + * @return {proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.VariantCase} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.prototype.getVariantCase = function() { - return /** @type {proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.VariantCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.oneofGroups_[0])); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.prototype.getVariantCase = function() { + return /** @type {proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.VariantCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.oneofGroups_[0])); }; @@ -26757,8 +26941,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.prototype.toObject = function(opt_includeInstance) { - return proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.toObject(opt_includeInstance, this); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.toObject(opt_includeInstance, this); }; @@ -26767,14 +26951,14 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo * @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.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults} msg The msg instance to transform. + * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.toObject = function(includeInstance, msg) { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.toObject = function(includeInstance, msg) { var f, obj = { aggregateCount: jspb.Message.getFieldWithDefault(msg, 1, "0"), - entries: (f = msg.getEntries()) && proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries.toObject(includeInstance, f) + entries: (f = msg.getEntries()) && proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries.toObject(includeInstance, f) }; if (includeInstance) { @@ -26788,23 +26972,23 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults} + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.deserializeBinary = function(bytes) { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults; - return proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.deserializeBinaryFromReader(msg, reader); + var msg = new proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults; + return proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.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.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults} msg The message object to deserialize into. + * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults} + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.deserializeBinaryFromReader = function(msg, reader) { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -26816,8 +27000,8 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo msg.setAggregateCount(value); break; case 2: - var value = new proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries; - reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries.deserializeBinaryFromReader); + var value = new proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries.deserializeBinaryFromReader); msg.setEntries(value); break; default: @@ -26833,9 +27017,9 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.prototype.serializeBinary = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.serializeBinaryToWriter(this, writer); + proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -26843,11 +27027,11 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults} message + * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.serializeBinaryToWriter = function(message, writer) { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = /** @type {string} */ (jspb.Message.getField(message, 1)); if (f != null) { @@ -26861,7 +27045,7 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo writer.writeMessage( 2, f, - proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries.serializeBinaryToWriter + proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries.serializeBinaryToWriter ); } }; @@ -26871,26 +27055,26 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo * optional uint64 aggregate_count = 1; * @return {string} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.prototype.getAggregateCount = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.prototype.getAggregateCount = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "0")); }; /** * @param {string} value - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.prototype.setAggregateCount = function(value) { - return jspb.Message.setOneofField(this, 1, proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.oneofGroups_[0], value); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.prototype.setAggregateCount = function(value) { + return jspb.Message.setOneofField(this, 1, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.oneofGroups_[0], value); }; /** * Clears the field making it undefined. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.prototype.clearAggregateCount = function() { - return jspb.Message.setOneofField(this, 1, proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.oneofGroups_[0], undefined); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.prototype.clearAggregateCount = function() { + return jspb.Message.setOneofField(this, 1, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.oneofGroups_[0], undefined); }; @@ -26898,35 +27082,35 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo * Returns whether this field is set. * @return {boolean} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.prototype.hasAggregateCount = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.prototype.hasAggregateCount = function() { return jspb.Message.getField(this, 1) != null; }; /** * optional CountEntries entries = 2; - * @return {?proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries} + * @return {?proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.prototype.getEntries = function() { - return /** @type{?proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries} */ ( - jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries, 2)); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.prototype.getEntries = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries, 2)); }; /** - * @param {?proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries|undefined} value - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults} returns this + * @param {?proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.prototype.setEntries = function(value) { - return jspb.Message.setOneofWrapperField(this, 2, proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.oneofGroups_[0], value); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.prototype.setEntries = function(value) { + return jspb.Message.setOneofWrapperField(this, 2, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.oneofGroups_[0], value); }; /** * Clears the message field making it undefined. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.prototype.clearEntries = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.prototype.clearEntries = function() { return this.setEntries(undefined); }; @@ -26935,35 +27119,226 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo * Returns whether this field is set. * @return {boolean} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.prototype.hasEntries = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.prototype.hasEntries = 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.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.oneofGroups_ = [[1,2]]; + +/** + * @enum {number} + */ +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.VariantCase = { + VARIANT_NOT_SET: 0, + DOCUMENTS: 1, + COUNTS: 2 +}; + +/** + * @return {proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.VariantCase} + */ +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.prototype.getVariantCase = function() { + return /** @type {proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.VariantCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.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.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.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.GetDocumentsResponse.GetDocumentsResponseV1.ResultData} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.toObject = function(includeInstance, msg) { + var f, obj = { + documents: (f = msg.getDocuments()) && proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents.toObject(includeInstance, f), + counts: (f = msg.getCounts()) && proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.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.GetDocumentsResponse.GetDocumentsResponseV1.ResultData} + */ +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData; + return proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.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.GetDocumentsResponse.GetDocumentsResponseV1.ResultData} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData} + */ +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.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.GetDocumentsResponse.GetDocumentsResponseV1.Documents; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents.deserializeBinaryFromReader); + msg.setDocuments(value); + break; + case 2: + var value = new proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.deserializeBinaryFromReader); + msg.setCounts(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.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.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.GetDocumentsResponse.GetDocumentsResponseV1.ResultData} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getDocuments(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents.serializeBinaryToWriter + ); + } + f = message.getCounts(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.serializeBinaryToWriter + ); + } +}; + + +/** + * optional Documents documents = 1; + * @return {?proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents} + */ +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.prototype.getDocuments = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents, 1)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData} returns this +*/ +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.prototype.setDocuments = function(value) { + return jspb.Message.setOneofWrapperField(this, 1, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData} returns this + */ +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.prototype.clearDocuments = function() { + return this.setDocuments(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.prototype.hasDocuments = function() { + return jspb.Message.getField(this, 1) != null; +}; + + /** - * optional CountResults counts = 1; - * @return {?proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults} + * optional CountResults counts = 2; + * @return {?proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.prototype.getCounts = function() { - return /** @type{?proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults} */ ( - jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults, 1)); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.prototype.getCounts = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults, 2)); }; /** - * @param {?proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults|undefined} value - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0} returns this + * @param {?proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.prototype.setCounts = function(value) { - return jspb.Message.setOneofWrapperField(this, 1, proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.oneofGroups_[0], value); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.prototype.setCounts = function(value) { + return jspb.Message.setOneofWrapperField(this, 2, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.oneofGroups_[0], value); }; /** * Clears the message field making it undefined. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.prototype.clearCounts = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.prototype.clearCounts = function() { return this.setCounts(undefined); }; @@ -26972,7 +27347,44 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo * Returns whether this field is set. * @return {boolean} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.prototype.hasCounts = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.prototype.hasCounts = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional ResultData data = 1; + * @return {?proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData} + */ +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.prototype.getData = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData, 1)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1} returns this +*/ +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.prototype.setData = function(value) { + return jspb.Message.setOneofWrapperField(this, 1, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1} returns this + */ +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.prototype.clearData = function() { + return this.setData(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.prototype.hasData = function() { return jspb.Message.getField(this, 1) != null; }; @@ -26981,7 +27393,7 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo * optional Proof proof = 2; * @return {?proto.org.dash.platform.dapi.v0.Proof} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.prototype.getProof = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.prototype.getProof = function() { return /** @type{?proto.org.dash.platform.dapi.v0.Proof} */ ( jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.Proof, 2)); }; @@ -26989,18 +27401,18 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo /** * @param {?proto.org.dash.platform.dapi.v0.Proof|undefined} value - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.prototype.setProof = function(value) { - return jspb.Message.setOneofWrapperField(this, 2, proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.oneofGroups_[0], value); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.prototype.setProof = function(value) { + return jspb.Message.setOneofWrapperField(this, 2, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.oneofGroups_[0], value); }; /** * Clears the message field making it undefined. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.prototype.clearProof = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.prototype.clearProof = function() { return this.setProof(undefined); }; @@ -27009,7 +27421,7 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo * Returns whether this field is set. * @return {boolean} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.prototype.hasProof = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.prototype.hasProof = function() { return jspb.Message.getField(this, 2) != null; }; @@ -27018,7 +27430,7 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo * optional ResponseMetadata metadata = 3; * @return {?proto.org.dash.platform.dapi.v0.ResponseMetadata} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.prototype.getMetadata = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.prototype.getMetadata = function() { return /** @type{?proto.org.dash.platform.dapi.v0.ResponseMetadata} */ ( jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.ResponseMetadata, 3)); }; @@ -27026,18 +27438,18 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo /** * @param {?proto.org.dash.platform.dapi.v0.ResponseMetadata|undefined} value - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.prototype.setMetadata = function(value) { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.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.GetDocumentsCountResponse.GetDocumentsCountResponseV0} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.prototype.clearMetadata = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.prototype.clearMetadata = function() { return this.setMetadata(undefined); }; @@ -27046,35 +27458,35 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo * Returns whether this field is set. * @return {boolean} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.prototype.hasMetadata = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.prototype.hasMetadata = function() { return jspb.Message.getField(this, 3) != null; }; /** - * optional GetDocumentsCountResponseV0 v0 = 1; - * @return {?proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0} + * optional GetDocumentsResponseV0 v0 = 1; + * @return {?proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.prototype.getV0 = function() { - return /** @type{?proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0} */ ( - jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0, 1)); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.getV0 = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0, 1)); }; /** - * @param {?proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0|undefined} value - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse} returns this + * @param {?proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.prototype.setV0 = function(value) { - return jspb.Message.setOneofWrapperField(this, 1, proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.oneofGroups_[0], value); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.setV0 = function(value) { + return jspb.Message.setOneofWrapperField(this, 1, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.oneofGroups_[0], value); }; /** * Clears the message field making it undefined. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.prototype.clearV0 = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.clearV0 = function() { return this.setV0(undefined); }; @@ -27083,11 +27495,48 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.prototype.clearV0 = fu * Returns whether this field is set. * @return {boolean} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.prototype.hasV0 = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.hasV0 = function() { return jspb.Message.getField(this, 1) != null; }; +/** + * optional GetDocumentsResponseV1 v1 = 2; + * @return {?proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1} + */ +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.getV1 = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1, 2)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse} returns this +*/ +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.setV1 = function(value) { + return jspb.Message.setOneofWrapperField(this, 2, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse} returns this + */ +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.clearV1 = function() { + return this.setV1(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.hasV1 = function() { + return jspb.Message.getField(this, 2) != null; +}; + + /** * Oneof group definitions for this message. Each group defines the field 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 e31d5f0735c..2e060899e81 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 @@ -90,14 +90,16 @@ CF_EXTERN_C_BEGIN @class GetDataContractsResponse_DataContractEntry; @class GetDataContractsResponse_DataContracts; @class GetDataContractsResponse_GetDataContractsResponseV0; -@class GetDocumentsCountRequest_GetDocumentsCountRequestV0; -@class GetDocumentsCountResponse_GetDocumentsCountResponseV0; -@class GetDocumentsCountResponse_GetDocumentsCountResponseV0_CountEntries; -@class GetDocumentsCountResponse_GetDocumentsCountResponseV0_CountEntry; -@class GetDocumentsCountResponse_GetDocumentsCountResponseV0_CountResults; @class GetDocumentsRequest_GetDocumentsRequestV0; +@class GetDocumentsRequest_GetDocumentsRequestV1; @class GetDocumentsResponse_GetDocumentsResponseV0; @class GetDocumentsResponse_GetDocumentsResponseV0_Documents; +@class GetDocumentsResponse_GetDocumentsResponseV1; +@class GetDocumentsResponse_GetDocumentsResponseV1_CountEntries; +@class GetDocumentsResponse_GetDocumentsResponseV1_CountEntry; +@class GetDocumentsResponse_GetDocumentsResponseV1_CountResults; +@class GetDocumentsResponse_GetDocumentsResponseV1_Documents; +@class GetDocumentsResponse_GetDocumentsResponseV1_ResultData; @class GetEpochsInfoRequest_GetEpochsInfoRequestV0; @class GetEpochsInfoResponse_GetEpochsInfoResponseV0; @class GetEpochsInfoResponse_GetEpochsInfoResponseV0_EpochInfo; @@ -342,6 +344,37 @@ GPBEnumDescriptor *SecurityLevelMap_KeyKindRequestType_EnumDescriptor(void); **/ BOOL SecurityLevelMap_KeyKindRequestType_IsValidValue(int32_t value); +#pragma mark - Enum GetDocumentsRequest_GetDocumentsRequestV1_Select + +/** + * Projection over the matched row set. Determines whether the + * response carries documents or count results. + **/ +typedef GPB_ENUM(GetDocumentsRequest_GetDocumentsRequestV1_Select) { + /** + * Value used if any message's field encounters a value that is not defined + * by this enum. The message will also have C functions to get/set the rawValue + * of the field. + **/ + GetDocumentsRequest_GetDocumentsRequestV1_Select_GPBUnrecognizedEnumeratorValue = kGPBUnrecognizedEnumeratorValue, + /** Return matched documents. `group_by` must be empty. */ + GetDocumentsRequest_GetDocumentsRequestV1_Select_Documents = 0, + + /** + * Return a count — single aggregate when `group_by` is empty, + * per-group entries when `group_by` names a field. + **/ + GetDocumentsRequest_GetDocumentsRequestV1_Select_Count = 1, +}; + +GPBEnumDescriptor *GetDocumentsRequest_GetDocumentsRequestV1_Select_EnumDescriptor(void); + +/** + * Checks to see if the given value is defined by the enum or was not known at + * the time this source was generated. + **/ +BOOL GetDocumentsRequest_GetDocumentsRequestV1_Select_IsValidValue(int32_t value); + #pragma mark - Enum GetContestedResourceVoteStateRequest_GetContestedResourceVoteStateRequestV0_ResultType typedef GPB_ENUM(GetContestedResourceVoteStateRequest_GetContestedResourceVoteStateRequestV0_ResultType) { @@ -2257,11 +2290,13 @@ GPB_FINAL @interface GetDataContractHistoryResponse_GetDataContractHistoryRespon typedef GPB_ENUM(GetDocumentsRequest_FieldNumber) { GetDocumentsRequest_FieldNumber_V0 = 1, + GetDocumentsRequest_FieldNumber_V1 = 2, }; typedef GPB_ENUM(GetDocumentsRequest_Version_OneOfCase) { GetDocumentsRequest_Version_OneOfCase_GPBUnsetOneOfCase = 0, GetDocumentsRequest_Version_OneOfCase_V0 = 1, + GetDocumentsRequest_Version_OneOfCase_V1 = 2, }; GPB_FINAL @interface GetDocumentsRequest : GPBMessage @@ -2270,6 +2305,8 @@ GPB_FINAL @interface GetDocumentsRequest : GPBMessage @property(nonatomic, readwrite, strong, null_resettable) GetDocumentsRequest_GetDocumentsRequestV0 *v0; +@property(nonatomic, readwrite, strong, null_resettable) GetDocumentsRequest_GetDocumentsRequestV1 *v1; + @end /** @@ -2332,15 +2369,197 @@ GPB_FINAL @interface GetDocumentsRequest_GetDocumentsRequestV0 : GPBMessage **/ void GetDocumentsRequest_GetDocumentsRequestV0_ClearStartOneOfCase(GetDocumentsRequest_GetDocumentsRequestV0 *message); +#pragma mark - GetDocumentsRequest_GetDocumentsRequestV1 + +typedef GPB_ENUM(GetDocumentsRequest_GetDocumentsRequestV1_FieldNumber) { + GetDocumentsRequest_GetDocumentsRequestV1_FieldNumber_DataContractId = 1, + GetDocumentsRequest_GetDocumentsRequestV1_FieldNumber_DocumentType = 2, + GetDocumentsRequest_GetDocumentsRequestV1_FieldNumber_Where = 3, + GetDocumentsRequest_GetDocumentsRequestV1_FieldNumber_OrderBy = 4, + GetDocumentsRequest_GetDocumentsRequestV1_FieldNumber_Limit = 5, + GetDocumentsRequest_GetDocumentsRequestV1_FieldNumber_StartAfter = 6, + GetDocumentsRequest_GetDocumentsRequestV1_FieldNumber_StartAt = 7, + GetDocumentsRequest_GetDocumentsRequestV1_FieldNumber_Prove = 8, + GetDocumentsRequest_GetDocumentsRequestV1_FieldNumber_Select = 9, + GetDocumentsRequest_GetDocumentsRequestV1_FieldNumber_GroupByArray = 10, + GetDocumentsRequest_GetDocumentsRequestV1_FieldNumber_Having = 11, +}; + +typedef GPB_ENUM(GetDocumentsRequest_GetDocumentsRequestV1_Start_OneOfCase) { + GetDocumentsRequest_GetDocumentsRequestV1_Start_OneOfCase_GPBUnsetOneOfCase = 0, + GetDocumentsRequest_GetDocumentsRequestV1_Start_OneOfCase_StartAfter = 6, + GetDocumentsRequest_GetDocumentsRequestV1_Start_OneOfCase_StartAt = 7, +}; + +/** + * SQL-shaped successor to v0 that unifies `getDocuments` and + * `getDocumentsCount` under a single request type with a typed + * `select` projection and optional `group_by` / `having` clauses. + * + * Mode is determined by `select` × `group_by` × `having`: + * + * * `select = DOCUMENTS, group_by = []`: return matched documents + * (identical semantics to v0). + * * `select = COUNT, group_by = []`: return a single aggregate + * count. With an `In` clause the server fans out per-In via + * `query_aggregate_count` and sums (O(|In| × log n), see + * `RangeNoProof`'s compound-summed path); with a range clause + * it uses `AggregateCountOnRange`. + * * `select = COUNT, group_by = []`: return per-group + * `CountEntry` rows. Only supported when the grouping field + * matches an `In`-constrained or range-constrained where clause; + * other shapes return `Unsupported` (see Phase 1 notes below). + * + * `having` is wire-reserved for Phase 2. Any non-empty `having` + * value returns `Unsupported("HAVING clause is not yet + * implemented")` regardless of `select` / `group_by`. + * + * **Phase 1 supported shapes** (everything else rejects with a + * typed `QuerySyntaxError::Unsupported` so callers can detect + * un-wired capabilities without parsing prose): + * + * select=DOCUMENTS, group_by=[]: + * any where shape v0 supports. + * + * select=COUNT, group_by=[]: + * - empty where → `documentsCountable: true` doctype. + * - `==` only → `countable: true` index covering the fields. + * - one `In` → `countable: true` index covering the fields + * (per-In aggregate fan-out). + * - one range → `rangeCountable: true` index. + * - one `In` + one range → `rangeCountable: true` compound + * index (per-In aggregate fan-out on no-proof; rejected on + * prove because the aggregate proof primitive can't fork). + * + * select=COUNT, group_by=[g]: + * - g is the In clause's field → `countable: true` index, + * grouped by g (PerInValue on no-proof, CountTree element + * proof per In branch on prove). + * - g is the range clause's field → `rangeCountable: true` + * index, grouped by g (RangeDistinct on no-proof, distinct + * range proof on prove). + * + * select=COUNT, group_by=[a, b]: + * - a is the In field AND b is the range field, in that order + * → existing compound distinct shape; entries carry both + * `in_key` (= a's value) and `key` (= b's value). + * + * **Phase 1 rejected shapes** (return `Unsupported`): + * - any non-empty `having` (always). + * - `select=DOCUMENTS` with non-empty `group_by`. + * - `select=COUNT` with `group_by` on a field that is not + * constrained by an `In` or range where clause. + * - `select=COUNT` with `group_by.len() > 2`. + * - `select=COUNT` with 2-field `group_by` that does not match + * the `(in_field, range_field)` shape above. + * + * **Zero-count entries on `In`-grouped queries**: when + * `select=COUNT, group_by=[in_field]` and an `In` value has no + * matching documents, v1 emits a `CountEntry { key: in_value, + * count: 0 }` for it — a deliberate divergence from SQL, which + * would skip empty groups. Callers can distinguish "no docs at + * this value" from "value filtered out" without re-querying. + * For range-grouped queries the existing walker only emits keys + * that exist in the index, which IS SQL-conformant; no change. + **/ +GPB_FINAL @interface GetDocumentsRequest_GetDocumentsRequestV1 : GPBMessage + +/** The data contract owning the documents */ +@property(nonatomic, readwrite, copy, null_resettable) NSData *dataContractId; + +/** Document type within the contract */ +@property(nonatomic, readwrite, copy, null_resettable) NSString *documentType; + +/** CBOR-encoded where clauses (same shape as v0) */ +@property(nonatomic, readwrite, copy, null_resettable) NSData *where; + +/** CBOR-encoded order_by clauses (same shape as v0) */ +@property(nonatomic, readwrite, copy, null_resettable) NSData *orderBy; + +/** + * Maximum number of rows to return. + * - `select=DOCUMENTS`: matched-document cap (same as v0). + * - `select=COUNT, group_by=[]`: ignored (aggregate is one row). + * - `select=COUNT, group_by=[…]`: entries cap. On prove paths + * this is validate-don't-clamp — `limit > max_query_limit` + * returns `InvalidLimit` rather than silent clamping (see + * `RangeDistinctProof`'s contract; unset falls back to the + * SDK-shared `DEFAULT_QUERY_LIMIT` compile-time constant so + * proof bytes are deterministic across operators). + **/ +@property(nonatomic, readwrite) uint32_t limit; + +@property(nonatomic, readwrite) BOOL hasLimit; +/** + * Pagination cursor. Valid for `select=DOCUMENTS` and for + * `select=COUNT` with non-empty `group_by` (paginate entries by + * the grouping field's serialized key). Rejected on + * `select=COUNT, group_by=[]` — no concept of "start" for a + * single aggregate. + **/ +@property(nonatomic, readonly) GetDocumentsRequest_GetDocumentsRequestV1_Start_OneOfCase startOneOfCase; + +@property(nonatomic, readwrite, copy, null_resettable) NSData *startAfter; + +@property(nonatomic, readwrite, copy, null_resettable) NSData *startAt; + +/** Request a grovedb proof instead of raw rows */ +@property(nonatomic, readwrite) BOOL prove; + +/** + * SQL `SELECT` projection. Default `DOCUMENTS` keeps v0 semantics + * for callers that just want documents back. + **/ +@property(nonatomic, readwrite) GetDocumentsRequest_GetDocumentsRequestV1_Select select; + +/** + * SQL `GROUP BY` field names, in left-to-right order. Empty = + * no explicit grouping (aggregate for `select=COUNT`). See + * message-level docstring for the Phase 1 supported shapes. + **/ +@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *groupByArray; +/** The number of items in @c groupByArray without causing the array to be created. */ +@property(nonatomic, readonly) NSUInteger groupByArray_Count; + +/** + * SQL `HAVING` clauses, CBOR-encoded the same way as `where`. + * **Phase 1: always rejected when non-empty** with + * `Unsupported("HAVING clause is not yet implemented")`. + * Reserved on the wire so future capability can land without + * another version bump. + **/ +@property(nonatomic, readwrite, copy, null_resettable) NSData *having; + +@end + +/** + * Fetches the raw value of a @c GetDocumentsRequest_GetDocumentsRequestV1's @c select property, even + * if the value was not defined by the enum at the time the code was generated. + **/ +int32_t GetDocumentsRequest_GetDocumentsRequestV1_Select_RawValue(GetDocumentsRequest_GetDocumentsRequestV1 *message); +/** + * Sets the raw value of an @c GetDocumentsRequest_GetDocumentsRequestV1's @c select property, allowing + * it to be set to a value that was not defined by the enum at the time the code + * was generated. + **/ +void SetGetDocumentsRequest_GetDocumentsRequestV1_Select_RawValue(GetDocumentsRequest_GetDocumentsRequestV1 *message, int32_t value); + +/** + * Clears whatever value was set for the oneof 'start'. + **/ +void GetDocumentsRequest_GetDocumentsRequestV1_ClearStartOneOfCase(GetDocumentsRequest_GetDocumentsRequestV1 *message); + #pragma mark - GetDocumentsResponse typedef GPB_ENUM(GetDocumentsResponse_FieldNumber) { GetDocumentsResponse_FieldNumber_V0 = 1, + GetDocumentsResponse_FieldNumber_V1 = 2, }; typedef GPB_ENUM(GetDocumentsResponse_Version_OneOfCase) { GetDocumentsResponse_Version_OneOfCase_GPBUnsetOneOfCase = 0, GetDocumentsResponse_Version_OneOfCase_V0 = 1, + GetDocumentsResponse_Version_OneOfCase_V1 = 2, }; GPB_FINAL @interface GetDocumentsResponse : GPBMessage @@ -2349,6 +2568,8 @@ GPB_FINAL @interface GetDocumentsResponse : GPBMessage @property(nonatomic, readwrite, strong, null_resettable) GetDocumentsResponse_GetDocumentsResponseV0 *v0; +@property(nonatomic, readwrite, strong, null_resettable) GetDocumentsResponse_GetDocumentsResponseV1 *v1; + @end /** @@ -2410,291 +2631,199 @@ GPB_FINAL @interface GetDocumentsResponse_GetDocumentsResponseV0_Documents : GPB @end -#pragma mark - GetDocumentsCountRequest +#pragma mark - GetDocumentsResponse_GetDocumentsResponseV1 -typedef GPB_ENUM(GetDocumentsCountRequest_FieldNumber) { - GetDocumentsCountRequest_FieldNumber_V0 = 1, +typedef GPB_ENUM(GetDocumentsResponse_GetDocumentsResponseV1_FieldNumber) { + GetDocumentsResponse_GetDocumentsResponseV1_FieldNumber_Data_p = 1, + GetDocumentsResponse_GetDocumentsResponseV1_FieldNumber_Proof = 2, + GetDocumentsResponse_GetDocumentsResponseV1_FieldNumber_Metadata = 3, }; -typedef GPB_ENUM(GetDocumentsCountRequest_Version_OneOfCase) { - GetDocumentsCountRequest_Version_OneOfCase_GPBUnsetOneOfCase = 0, - GetDocumentsCountRequest_Version_OneOfCase_V0 = 1, +typedef GPB_ENUM(GetDocumentsResponse_GetDocumentsResponseV1_Result_OneOfCase) { + GetDocumentsResponse_GetDocumentsResponseV1_Result_OneOfCase_GPBUnsetOneOfCase = 0, + GetDocumentsResponse_GetDocumentsResponseV1_Result_OneOfCase_Data_p = 1, + GetDocumentsResponse_GetDocumentsResponseV1_Result_OneOfCase_Proof = 2, }; /** - * Unified count query. + * v1 response. Two-variant outer `oneof` mirrors every other + * `Get*Response`: a non-proof result at position 1, the proof at + * position 2. The non-proof result is itself a `oneof` because + * a single v1 request can produce either matched documents (for + * `select=DOCUMENTS`) or count results (for `select=COUNT`) — + * wrapping them in an inner `ResultData` keeps the outer shape + * canonical without flattening to a three-variant oneof. * - * Mode is determined by the where clauses encoded in `where` plus - * the explicit `return_distinct_counts_in_range` flag. The wire - * shape of the no-proof response makes the mode explicit via - * `CountResults.variant`: - * * No `In` clause and `return_distinct_counts_in_range` = false: - * total count → `CountResults.aggregate_count` (single u64). - * * Exactly one `In` clause (no range): per-`In`-value counts → - * `CountResults.entries`, one `CountEntry` for each value in - * the `In` array constrained by the other `==` clauses. At - * most one `In` per request; multiple `In` clauses are an - * InvalidArgument error. - * * A range clause (`>`, `<`, `between*`, `startsWith`) and - * `return_distinct_counts_in_range` = true: per-distinct-value - * range histogram → `CountResults.entries`, one `CountEntry` - * per distinct value within the range. Requires - * `range_countable: true` on the index (see Indexes book - * chapter). Also supports an `In` clause on a prefix property - * of the index — in that case each entry carries BOTH the In - * value (`CountEntry.in_key`) and the terminator value - * (`CountEntry.key`). Cross-fork sums are NOT computed - * server-side; callers reduce client-side if they want a flat - * histogram (see book chapter "Range Modes"). - * * A range clause with `return_distinct_counts_in_range` = false: - * total over range → `CountResults.aggregate_count`. Also - * requires `range_countable: true`. + * Wire shape by `request.select` × `group_by` × `prove`: + * - `select=DOCUMENTS` (no prove) → `result.data.documents`. + * - `select=COUNT, group_by=[]` (no prove) → `result.data.counts.aggregate_count`. + * - `select=COUNT, group_by=[…]` (no prove) → `result.data.counts.entries`. + * - any select (prove) → `result.proof`. * - * When `prove = true`, the response is a grovedb proof instead of - * a `CountResults` value; the client verifies and recovers the - * same per-mode shape (single u64 for aggregate, per-key map for - * distinct). + * `CountResults` / `CountEntry` / `CountEntries` are nested in + * `GetDocumentsResponseV1` rather than re-exported from a + * top-level message — the v0 `getDocumentsCount` endpoint that + * previously owned them has been removed in this version (it + * shipped briefly in #3623 and never had stable callers); v1 is + * the single home for the count wire types. **/ -GPB_FINAL @interface GetDocumentsCountRequest : GPBMessage +GPB_FINAL @interface GetDocumentsResponse_GetDocumentsResponseV1 : GPBMessage -@property(nonatomic, readonly) GetDocumentsCountRequest_Version_OneOfCase versionOneOfCase; +@property(nonatomic, readonly) GetDocumentsResponse_GetDocumentsResponseV1_Result_OneOfCase resultOneOfCase; -@property(nonatomic, readwrite, strong, null_resettable) GetDocumentsCountRequest_GetDocumentsCountRequestV0 *v0; +@property(nonatomic, readwrite, strong, null_resettable) GetDocumentsResponse_GetDocumentsResponseV1_ResultData *data_p; -@end - -/** - * Clears whatever value was set for the oneof 'version'. - **/ -void GetDocumentsCountRequest_ClearVersionOneOfCase(GetDocumentsCountRequest *message); - -#pragma mark - GetDocumentsCountRequest_GetDocumentsCountRequestV0 - -typedef GPB_ENUM(GetDocumentsCountRequest_GetDocumentsCountRequestV0_FieldNumber) { - GetDocumentsCountRequest_GetDocumentsCountRequestV0_FieldNumber_DataContractId = 1, - GetDocumentsCountRequest_GetDocumentsCountRequestV0_FieldNumber_DocumentType = 2, - GetDocumentsCountRequest_GetDocumentsCountRequestV0_FieldNumber_Where = 3, - GetDocumentsCountRequest_GetDocumentsCountRequestV0_FieldNumber_ReturnDistinctCountsInRange = 4, - GetDocumentsCountRequest_GetDocumentsCountRequestV0_FieldNumber_OrderBy = 5, - GetDocumentsCountRequest_GetDocumentsCountRequestV0_FieldNumber_Limit = 6, - GetDocumentsCountRequest_GetDocumentsCountRequestV0_FieldNumber_Prove = 7, -}; - -GPB_FINAL @interface GetDocumentsCountRequest_GetDocumentsCountRequestV0 : GPBMessage - -@property(nonatomic, readwrite, copy, null_resettable) NSData *dataContractId; - -@property(nonatomic, readwrite, copy, null_resettable) NSString *documentType; - -/** CBOR-encoded where clauses */ -@property(nonatomic, readwrite, copy, null_resettable) NSData *where; +@property(nonatomic, readwrite, strong, null_resettable) Proof *proof; -/** - * Default false (single sum). When true and a range clause is - * present, return per-distinct-value entries within the range. - **/ -@property(nonatomic, readwrite) BOOL returnDistinctCountsInRange; +@property(nonatomic, readwrite, strong, null_resettable) ResponseMetadata *metadata; +/** Test to see if @c metadata has been set. */ +@property(nonatomic, readwrite) BOOL hasMetadata; -/** - * CBOR-encoded order_by clauses. Same encoding as - * `GetDocumentsRequestV0.order_by`. The first clause's direction - * controls entry ordering in split-mode responses (per-`In`-value - * or per-range-distinct-value). On the `RangeDistinctProof` prove - * path the direction is part of the proof's path query, so the - * SDK must reconstruct the same value — empty `order_by` defaults - * to ascending on both sides for determinism. Ignored for - * total-count responses and for the `PointLookupProof` path - * (which sorts In keys lex-ascending unconditionally for prove/ - * no-proof parity). - **/ -@property(nonatomic, readwrite, copy, null_resettable) NSData *orderBy; +@end /** - * Maximum number of entries to return. - * - **No-proof paths**: server clamps to its `max_query_limit` - * config; unset → server default. - * - **Prove paths** (`RangeDistinctProof`): validate-don't-clamp. - * `limit > max_query_limit` returns `InvalidLimit` rather than - * silently clamping, because silent clamping would invisibly - * break verification (proof determinism requires the SDK to - * reconstruct the same path query). Unset falls back to - * `crate::config::DEFAULT_QUERY_LIMIT` (a compile-time constant - * the SDK also reads) — explicitly NOT the operator-tunable - * `default_query_limit`, so proof bytes are deterministic - * across operators regardless of their runtime config. - * Has no effect on total-count responses. + * Clears whatever value was set for the oneof 'result'. **/ -@property(nonatomic, readwrite) uint32_t limit; - -@property(nonatomic, readwrite) BOOL hasLimit; -@property(nonatomic, readwrite) BOOL prove; - -@end - -#pragma mark - GetDocumentsCountResponse +void GetDocumentsResponse_GetDocumentsResponseV1_ClearResultOneOfCase(GetDocumentsResponse_GetDocumentsResponseV1 *message); -typedef GPB_ENUM(GetDocumentsCountResponse_FieldNumber) { - GetDocumentsCountResponse_FieldNumber_V0 = 1, -}; +#pragma mark - GetDocumentsResponse_GetDocumentsResponseV1_Documents -typedef GPB_ENUM(GetDocumentsCountResponse_Version_OneOfCase) { - GetDocumentsCountResponse_Version_OneOfCase_GPBUnsetOneOfCase = 0, - GetDocumentsCountResponse_Version_OneOfCase_V0 = 1, +typedef GPB_ENUM(GetDocumentsResponse_GetDocumentsResponseV1_Documents_FieldNumber) { + GetDocumentsResponse_GetDocumentsResponseV1_Documents_FieldNumber_DocumentsArray = 1, }; -GPB_FINAL @interface GetDocumentsCountResponse : GPBMessage - -@property(nonatomic, readonly) GetDocumentsCountResponse_Version_OneOfCase versionOneOfCase; - -@property(nonatomic, readwrite, strong, null_resettable) GetDocumentsCountResponse_GetDocumentsCountResponseV0 *v0; - -@end - /** - * Clears whatever value was set for the oneof 'version'. + * Documents result variant — matches the v0 `Documents` + * message field-for-field (kept distinct so v1 doesn't reach + * into v0's namespace once v0 is eventually retired). **/ -void GetDocumentsCountResponse_ClearVersionOneOfCase(GetDocumentsCountResponse *message); - -#pragma mark - GetDocumentsCountResponse_GetDocumentsCountResponseV0 +GPB_FINAL @interface GetDocumentsResponse_GetDocumentsResponseV1_Documents : GPBMessage -typedef GPB_ENUM(GetDocumentsCountResponse_GetDocumentsCountResponseV0_FieldNumber) { - GetDocumentsCountResponse_GetDocumentsCountResponseV0_FieldNumber_Counts = 1, - GetDocumentsCountResponse_GetDocumentsCountResponseV0_FieldNumber_Proof = 2, - GetDocumentsCountResponse_GetDocumentsCountResponseV0_FieldNumber_Metadata = 3, -}; - -typedef GPB_ENUM(GetDocumentsCountResponse_GetDocumentsCountResponseV0_Result_OneOfCase) { - GetDocumentsCountResponse_GetDocumentsCountResponseV0_Result_OneOfCase_GPBUnsetOneOfCase = 0, - GetDocumentsCountResponse_GetDocumentsCountResponseV0_Result_OneOfCase_Counts = 1, - GetDocumentsCountResponse_GetDocumentsCountResponseV0_Result_OneOfCase_Proof = 2, -}; - -GPB_FINAL @interface GetDocumentsCountResponse_GetDocumentsCountResponseV0 : GPBMessage - -@property(nonatomic, readonly) GetDocumentsCountResponse_GetDocumentsCountResponseV0_Result_OneOfCase resultOneOfCase; - -@property(nonatomic, readwrite, strong, null_resettable) GetDocumentsCountResponse_GetDocumentsCountResponseV0_CountResults *counts; - -@property(nonatomic, readwrite, strong, null_resettable) Proof *proof; - -@property(nonatomic, readwrite, strong, null_resettable) ResponseMetadata *metadata; -/** Test to see if @c metadata has been set. */ -@property(nonatomic, readwrite) BOOL hasMetadata; +@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *documentsArray; +/** The number of items in @c documentsArray without causing the array to be created. */ +@property(nonatomic, readonly) NSUInteger documentsArray_Count; @end -/** - * Clears whatever value was set for the oneof 'result'. - **/ -void GetDocumentsCountResponse_GetDocumentsCountResponseV0_ClearResultOneOfCase(GetDocumentsCountResponse_GetDocumentsCountResponseV0 *message); - -#pragma mark - GetDocumentsCountResponse_GetDocumentsCountResponseV0_CountEntry +#pragma mark - GetDocumentsResponse_GetDocumentsResponseV1_CountEntry -typedef GPB_ENUM(GetDocumentsCountResponse_GetDocumentsCountResponseV0_CountEntry_FieldNumber) { - GetDocumentsCountResponse_GetDocumentsCountResponseV0_CountEntry_FieldNumber_InKey = 1, - GetDocumentsCountResponse_GetDocumentsCountResponseV0_CountEntry_FieldNumber_Key = 2, - GetDocumentsCountResponse_GetDocumentsCountResponseV0_CountEntry_FieldNumber_Count = 3, +typedef GPB_ENUM(GetDocumentsResponse_GetDocumentsResponseV1_CountEntry_FieldNumber) { + GetDocumentsResponse_GetDocumentsResponseV1_CountEntry_FieldNumber_InKey = 1, + GetDocumentsResponse_GetDocumentsResponseV1_CountEntry_FieldNumber_Key = 2, + GetDocumentsResponse_GetDocumentsResponseV1_CountEntry_FieldNumber_Count = 3, }; /** - * A single per-key entry: the splitting key value and how many - * documents match. Used by the `entries` variant of - * `CountResults` for per-`In`-value and per-distinct-value-in- - * range modes. - * - * For compound queries (an `In` clause on a prefix property of a - * `range_countable` index plus a range clause on the terminator), - * each entry carries BOTH the In-fork's prefix value - * (`in_key`) and the terminator value (`key`). Cross-fork - * aggregation is intentionally NOT done server-side — callers - * get the unmerged per-(in_key, key) view and can sum - * client-side if they want a flat histogram. See the book - * chapter ("Range Modes") for rationale. + * A single per-key entry. Carries `in_key` for compound + * queries (`In` on a prefix property of a `range_countable` + * index plus a range clause on the terminator) where each + * entry is keyed by both the In-fork's prefix value (`in_key`) + * and the terminator value (`key`). Cross-fork aggregation is + * intentionally NOT done server-side — callers get the + * unmerged per-`(in_key, key)` view and can reduce client-side + * if they want a flat histogram. **/ -GPB_FINAL @interface GetDocumentsCountResponse_GetDocumentsCountResponseV0_CountEntry : GPBMessage +GPB_FINAL @interface GetDocumentsResponse_GetDocumentsResponseV1_CountEntry : GPBMessage -/** - * Serialized prefix key for compound queries — the In's value - * for this fork. Absent for flat queries with no `In` on - * prefix (in which case entries are keyed purely by `key`). - **/ @property(nonatomic, readwrite, copy, null_resettable) NSData *inKey; /** Test to see if @c inKey has been set. */ @property(nonatomic, readwrite) BOOL hasInKey; -/** - * Serialized terminator key (the range-property value for - * distinct-range modes, or the `In` value for per-In-value - * mode without a range clause). - **/ @property(nonatomic, readwrite, copy, null_resettable) NSData *key; /** - * `jstype = JS_STRING` so JS/Web clients receive a string and don't - * round counts > 2^53-1 to the nearest representable Number. Matches - * the convention used elsewhere in this proto for `uint64` fields - * that can exceed Number.MAX_SAFE_INTEGER. + * `jstype = JS_STRING` so JS/Web clients receive a string + * and don't round counts > 2^53−1 to the nearest + * representable Number. **/ @property(nonatomic, readwrite) uint64_t count; @end -#pragma mark - GetDocumentsCountResponse_GetDocumentsCountResponseV0_CountEntries +#pragma mark - GetDocumentsResponse_GetDocumentsResponseV1_CountEntries -typedef GPB_ENUM(GetDocumentsCountResponse_GetDocumentsCountResponseV0_CountEntries_FieldNumber) { - GetDocumentsCountResponse_GetDocumentsCountResponseV0_CountEntries_FieldNumber_EntriesArray = 1, +typedef GPB_ENUM(GetDocumentsResponse_GetDocumentsResponseV1_CountEntries_FieldNumber) { + GetDocumentsResponse_GetDocumentsResponseV1_CountEntries_FieldNumber_EntriesArray = 1, }; -GPB_FINAL @interface GetDocumentsCountResponse_GetDocumentsCountResponseV0_CountEntries : GPBMessage +GPB_FINAL @interface GetDocumentsResponse_GetDocumentsResponseV1_CountEntries : GPBMessage -@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *entriesArray; +@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *entriesArray; /** The number of items in @c entriesArray without causing the array to be created. */ @property(nonatomic, readonly) NSUInteger entriesArray_Count; @end -#pragma mark - GetDocumentsCountResponse_GetDocumentsCountResponseV0_CountResults +#pragma mark - GetDocumentsResponse_GetDocumentsResponseV1_CountResults -typedef GPB_ENUM(GetDocumentsCountResponse_GetDocumentsCountResponseV0_CountResults_FieldNumber) { - GetDocumentsCountResponse_GetDocumentsCountResponseV0_CountResults_FieldNumber_AggregateCount = 1, - GetDocumentsCountResponse_GetDocumentsCountResponseV0_CountResults_FieldNumber_Entries = 2, +typedef GPB_ENUM(GetDocumentsResponse_GetDocumentsResponseV1_CountResults_FieldNumber) { + GetDocumentsResponse_GetDocumentsResponseV1_CountResults_FieldNumber_AggregateCount = 1, + GetDocumentsResponse_GetDocumentsResponseV1_CountResults_FieldNumber_Entries = 2, }; -typedef GPB_ENUM(GetDocumentsCountResponse_GetDocumentsCountResponseV0_CountResults_Variant_OneOfCase) { - GetDocumentsCountResponse_GetDocumentsCountResponseV0_CountResults_Variant_OneOfCase_GPBUnsetOneOfCase = 0, - GetDocumentsCountResponse_GetDocumentsCountResponseV0_CountResults_Variant_OneOfCase_AggregateCount = 1, - GetDocumentsCountResponse_GetDocumentsCountResponseV0_CountResults_Variant_OneOfCase_Entries = 2, +typedef GPB_ENUM(GetDocumentsResponse_GetDocumentsResponseV1_CountResults_Variant_OneOfCase) { + GetDocumentsResponse_GetDocumentsResponseV1_CountResults_Variant_OneOfCase_GPBUnsetOneOfCase = 0, + GetDocumentsResponse_GetDocumentsResponseV1_CountResults_Variant_OneOfCase_AggregateCount = 1, + GetDocumentsResponse_GetDocumentsResponseV1_CountResults_Variant_OneOfCase_Entries = 2, }; /** * Non-proof count result. Shape is mode-dependent and made * explicit on the wire via the inner `variant` oneof: - * * `aggregate_count`: total-count and range-without-distinct - * modes — a single u64 with no per-key breakdown. Callers - * read the total directly without scanning an entries list. - * * `entries`: per-`In`-value and per-distinct-value-in-range - * modes — one CountEntry per distinct value, in serialized- - * key order subject to the first `order_by` clause's - * direction and `limit`. + * * `aggregate_count`: `select=COUNT, group_by=[]` — + * single u64 with no per-key breakdown. + * * `entries`: `select=COUNT, group_by=[…]` — one + * CountEntry per distinct group, in serialized-key order + * (subject to the first `order_by` clause's direction and + * `limit`). **/ -GPB_FINAL @interface GetDocumentsCountResponse_GetDocumentsCountResponseV0_CountResults : GPBMessage +GPB_FINAL @interface GetDocumentsResponse_GetDocumentsResponseV1_CountResults : GPBMessage + +@property(nonatomic, readonly) GetDocumentsResponse_GetDocumentsResponseV1_CountResults_Variant_OneOfCase variantOneOfCase; + +@property(nonatomic, readwrite) uint64_t aggregateCount; + +@property(nonatomic, readwrite, strong, null_resettable) GetDocumentsResponse_GetDocumentsResponseV1_CountEntries *entries; -@property(nonatomic, readonly) GetDocumentsCountResponse_GetDocumentsCountResponseV0_CountResults_Variant_OneOfCase variantOneOfCase; +@end /** - * `jstype = JS_STRING` for the same reason as - * `CountEntry.count` — JS Number rounds at 2^53−1. + * Clears whatever value was set for the oneof 'variant'. **/ -@property(nonatomic, readwrite) uint64_t aggregateCount; +void GetDocumentsResponse_GetDocumentsResponseV1_CountResults_ClearVariantOneOfCase(GetDocumentsResponse_GetDocumentsResponseV1_CountResults *message); + +#pragma mark - GetDocumentsResponse_GetDocumentsResponseV1_ResultData + +typedef GPB_ENUM(GetDocumentsResponse_GetDocumentsResponseV1_ResultData_FieldNumber) { + GetDocumentsResponse_GetDocumentsResponseV1_ResultData_FieldNumber_Documents = 1, + GetDocumentsResponse_GetDocumentsResponseV1_ResultData_FieldNumber_Counts = 2, +}; + +typedef GPB_ENUM(GetDocumentsResponse_GetDocumentsResponseV1_ResultData_Variant_OneOfCase) { + GetDocumentsResponse_GetDocumentsResponseV1_ResultData_Variant_OneOfCase_GPBUnsetOneOfCase = 0, + GetDocumentsResponse_GetDocumentsResponseV1_ResultData_Variant_OneOfCase_Documents = 1, + GetDocumentsResponse_GetDocumentsResponseV1_ResultData_Variant_OneOfCase_Counts = 2, +}; + +/** + * Non-proof result wrapper. The outer `oneof result` switches + * between this and `proof`; this inner oneof switches between + * the two non-proof shapes the v1 surface can return. + **/ +GPB_FINAL @interface GetDocumentsResponse_GetDocumentsResponseV1_ResultData : GPBMessage + +@property(nonatomic, readonly) GetDocumentsResponse_GetDocumentsResponseV1_ResultData_Variant_OneOfCase variantOneOfCase; + +@property(nonatomic, readwrite, strong, null_resettable) GetDocumentsResponse_GetDocumentsResponseV1_Documents *documents; -@property(nonatomic, readwrite, strong, null_resettable) GetDocumentsCountResponse_GetDocumentsCountResponseV0_CountEntries *entries; +@property(nonatomic, readwrite, strong, null_resettable) GetDocumentsResponse_GetDocumentsResponseV1_CountResults *counts; @end /** * Clears whatever value was set for the oneof 'variant'. **/ -void GetDocumentsCountResponse_GetDocumentsCountResponseV0_CountResults_ClearVariantOneOfCase(GetDocumentsCountResponse_GetDocumentsCountResponseV0_CountResults *message); +void GetDocumentsResponse_GetDocumentsResponseV1_ResultData_ClearVariantOneOfCase(GetDocumentsResponse_GetDocumentsResponseV1_ResultData *message); #pragma mark - GetIdentityByPublicKeyHashRequest 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 c4e72e7c9ef..04fe7e93eb9 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 @@ -116,18 +116,18 @@ GPBObjCClassDeclaration(GetDataContractsResponse_DataContractEntry); GPBObjCClassDeclaration(GetDataContractsResponse_DataContracts); GPBObjCClassDeclaration(GetDataContractsResponse_GetDataContractsResponseV0); -GPBObjCClassDeclaration(GetDocumentsCountRequest); -GPBObjCClassDeclaration(GetDocumentsCountRequest_GetDocumentsCountRequestV0); -GPBObjCClassDeclaration(GetDocumentsCountResponse); -GPBObjCClassDeclaration(GetDocumentsCountResponse_GetDocumentsCountResponseV0); -GPBObjCClassDeclaration(GetDocumentsCountResponse_GetDocumentsCountResponseV0_CountEntries); -GPBObjCClassDeclaration(GetDocumentsCountResponse_GetDocumentsCountResponseV0_CountEntry); -GPBObjCClassDeclaration(GetDocumentsCountResponse_GetDocumentsCountResponseV0_CountResults); GPBObjCClassDeclaration(GetDocumentsRequest); GPBObjCClassDeclaration(GetDocumentsRequest_GetDocumentsRequestV0); +GPBObjCClassDeclaration(GetDocumentsRequest_GetDocumentsRequestV1); GPBObjCClassDeclaration(GetDocumentsResponse); GPBObjCClassDeclaration(GetDocumentsResponse_GetDocumentsResponseV0); GPBObjCClassDeclaration(GetDocumentsResponse_GetDocumentsResponseV0_Documents); +GPBObjCClassDeclaration(GetDocumentsResponse_GetDocumentsResponseV1); +GPBObjCClassDeclaration(GetDocumentsResponse_GetDocumentsResponseV1_CountEntries); +GPBObjCClassDeclaration(GetDocumentsResponse_GetDocumentsResponseV1_CountEntry); +GPBObjCClassDeclaration(GetDocumentsResponse_GetDocumentsResponseV1_CountResults); +GPBObjCClassDeclaration(GetDocumentsResponse_GetDocumentsResponseV1_Documents); +GPBObjCClassDeclaration(GetDocumentsResponse_GetDocumentsResponseV1_ResultData); GPBObjCClassDeclaration(GetEpochsInfoRequest); GPBObjCClassDeclaration(GetEpochsInfoRequest_GetEpochsInfoRequestV0); GPBObjCClassDeclaration(GetEpochsInfoResponse); @@ -5078,10 +5078,12 @@ @implementation GetDocumentsRequest @dynamic versionOneOfCase; @dynamic v0; +@dynamic v1; typedef struct GetDocumentsRequest__storage_ { uint32_t _has_storage_[2]; GetDocumentsRequest_GetDocumentsRequestV0 *v0; + GetDocumentsRequest_GetDocumentsRequestV1 *v1; } GetDocumentsRequest__storage_; // This method is threadsafe because it is initially called @@ -5099,6 +5101,15 @@ + (GPBDescriptor *)descriptor { .flags = GPBFieldOptional, .dataType = GPBDataTypeMessage, }, + { + .name = "v1", + .dataTypeSpecific.clazz = GPBObjCClass(GetDocumentsRequest_GetDocumentsRequestV1), + .number = GetDocumentsRequest_FieldNumber_V1, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GetDocumentsRequest__storage_, v1), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, }; GPBDescriptor *localDescriptor = [GPBDescriptor allocDescriptorForClass:[GetDocumentsRequest class] @@ -5263,16 +5274,232 @@ void GetDocumentsRequest_GetDocumentsRequestV0_ClearStartOneOfCase(GetDocumentsR GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0]; GPBClearOneof(message, oneof); } +#pragma mark - GetDocumentsRequest_GetDocumentsRequestV1 + +@implementation GetDocumentsRequest_GetDocumentsRequestV1 + +@dynamic startOneOfCase; +@dynamic dataContractId; +@dynamic documentType; +@dynamic where; +@dynamic orderBy; +@dynamic hasLimit, limit; +@dynamic startAfter; +@dynamic startAt; +@dynamic prove; +@dynamic select; +@dynamic groupByArray, groupByArray_Count; +@dynamic having; + +typedef struct GetDocumentsRequest_GetDocumentsRequestV1__storage_ { + uint32_t _has_storage_[2]; + uint32_t limit; + GetDocumentsRequest_GetDocumentsRequestV1_Select select; + NSData *dataContractId; + NSString *documentType; + NSData *where; + NSData *orderBy; + NSData *startAfter; + NSData *startAt; + NSMutableArray *groupByArray; + NSData *having; +} GetDocumentsRequest_GetDocumentsRequestV1__storage_; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = nil; + if (!descriptor) { + static GPBMessageFieldDescription fields[] = { + { + .name = "dataContractId", + .dataTypeSpecific.clazz = Nil, + .number = GetDocumentsRequest_GetDocumentsRequestV1_FieldNumber_DataContractId, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GetDocumentsRequest_GetDocumentsRequestV1__storage_, dataContractId), + .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), + .dataType = GPBDataTypeBytes, + }, + { + .name = "documentType", + .dataTypeSpecific.clazz = Nil, + .number = GetDocumentsRequest_GetDocumentsRequestV1_FieldNumber_DocumentType, + .hasIndex = 1, + .offset = (uint32_t)offsetof(GetDocumentsRequest_GetDocumentsRequestV1__storage_, documentType), + .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), + .dataType = GPBDataTypeString, + }, + { + .name = "where", + .dataTypeSpecific.clazz = Nil, + .number = GetDocumentsRequest_GetDocumentsRequestV1_FieldNumber_Where, + .hasIndex = 2, + .offset = (uint32_t)offsetof(GetDocumentsRequest_GetDocumentsRequestV1__storage_, where), + .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), + .dataType = GPBDataTypeBytes, + }, + { + .name = "orderBy", + .dataTypeSpecific.clazz = Nil, + .number = GetDocumentsRequest_GetDocumentsRequestV1_FieldNumber_OrderBy, + .hasIndex = 3, + .offset = (uint32_t)offsetof(GetDocumentsRequest_GetDocumentsRequestV1__storage_, orderBy), + .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), + .dataType = GPBDataTypeBytes, + }, + { + .name = "limit", + .dataTypeSpecific.clazz = Nil, + .number = GetDocumentsRequest_GetDocumentsRequestV1_FieldNumber_Limit, + .hasIndex = 4, + .offset = (uint32_t)offsetof(GetDocumentsRequest_GetDocumentsRequestV1__storage_, limit), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeUInt32, + }, + { + .name = "startAfter", + .dataTypeSpecific.clazz = Nil, + .number = GetDocumentsRequest_GetDocumentsRequestV1_FieldNumber_StartAfter, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GetDocumentsRequest_GetDocumentsRequestV1__storage_, startAfter), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeBytes, + }, + { + .name = "startAt", + .dataTypeSpecific.clazz = Nil, + .number = GetDocumentsRequest_GetDocumentsRequestV1_FieldNumber_StartAt, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GetDocumentsRequest_GetDocumentsRequestV1__storage_, startAt), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeBytes, + }, + { + .name = "prove", + .dataTypeSpecific.clazz = Nil, + .number = GetDocumentsRequest_GetDocumentsRequestV1_FieldNumber_Prove, + .hasIndex = 5, + .offset = 6, // Stored in _has_storage_ to save space. + .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), + .dataType = GPBDataTypeBool, + }, + { + .name = "select", + .dataTypeSpecific.enumDescFunc = GetDocumentsRequest_GetDocumentsRequestV1_Select_EnumDescriptor, + .number = GetDocumentsRequest_GetDocumentsRequestV1_FieldNumber_Select, + .hasIndex = 7, + .offset = (uint32_t)offsetof(GetDocumentsRequest_GetDocumentsRequestV1__storage_, select), + .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldHasEnumDescriptor | GPBFieldClearHasIvarOnZero), + .dataType = GPBDataTypeEnum, + }, + { + .name = "groupByArray", + .dataTypeSpecific.clazz = Nil, + .number = GetDocumentsRequest_GetDocumentsRequestV1_FieldNumber_GroupByArray, + .hasIndex = GPBNoHasBit, + .offset = (uint32_t)offsetof(GetDocumentsRequest_GetDocumentsRequestV1__storage_, groupByArray), + .flags = GPBFieldRepeated, + .dataType = GPBDataTypeString, + }, + { + .name = "having", + .dataTypeSpecific.clazz = Nil, + .number = GetDocumentsRequest_GetDocumentsRequestV1_FieldNumber_Having, + .hasIndex = 8, + .offset = (uint32_t)offsetof(GetDocumentsRequest_GetDocumentsRequestV1__storage_, having), + .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), + .dataType = GPBDataTypeBytes, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GetDocumentsRequest_GetDocumentsRequestV1 class] + rootClass:[PlatformRoot class] + file:PlatformRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GetDocumentsRequest_GetDocumentsRequestV1__storage_) + flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; + static const char *oneofs[] = { + "start", + }; + [localDescriptor setupOneofs:oneofs + count:(uint32_t)(sizeof(oneofs) / sizeof(char*)) + firstHasIndex:-1]; + [localDescriptor setupContainingMessageClass:GPBObjCClass(GetDocumentsRequest)]; + #if defined(DEBUG) && DEBUG + NSAssert(descriptor == nil, @"Startup recursed!"); + #endif // DEBUG + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +int32_t GetDocumentsRequest_GetDocumentsRequestV1_Select_RawValue(GetDocumentsRequest_GetDocumentsRequestV1 *message) { + GPBDescriptor *descriptor = [GetDocumentsRequest_GetDocumentsRequestV1 descriptor]; + GPBFieldDescriptor *field = [descriptor fieldWithNumber:GetDocumentsRequest_GetDocumentsRequestV1_FieldNumber_Select]; + return GPBGetMessageRawEnumField(message, field); +} + +void SetGetDocumentsRequest_GetDocumentsRequestV1_Select_RawValue(GetDocumentsRequest_GetDocumentsRequestV1 *message, int32_t value) { + GPBDescriptor *descriptor = [GetDocumentsRequest_GetDocumentsRequestV1 descriptor]; + GPBFieldDescriptor *field = [descriptor fieldWithNumber:GetDocumentsRequest_GetDocumentsRequestV1_FieldNumber_Select]; + GPBSetMessageRawEnumField(message, field, value); +} + +void GetDocumentsRequest_GetDocumentsRequestV1_ClearStartOneOfCase(GetDocumentsRequest_GetDocumentsRequestV1 *message) { + GPBDescriptor *descriptor = [GetDocumentsRequest_GetDocumentsRequestV1 descriptor]; + GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0]; + GPBClearOneof(message, oneof); +} +#pragma mark - Enum GetDocumentsRequest_GetDocumentsRequestV1_Select + +GPBEnumDescriptor *GetDocumentsRequest_GetDocumentsRequestV1_Select_EnumDescriptor(void) { + static _Atomic(GPBEnumDescriptor*) descriptor = nil; + if (!descriptor) { + static const char *valueNames = + "Documents\000Count\000"; + static const int32_t values[] = { + GetDocumentsRequest_GetDocumentsRequestV1_Select_Documents, + GetDocumentsRequest_GetDocumentsRequestV1_Select_Count, + }; + GPBEnumDescriptor *worker = + [GPBEnumDescriptor allocDescriptorForName:GPBNSStringifySymbol(GetDocumentsRequest_GetDocumentsRequestV1_Select) + valueNames:valueNames + values:values + count:(uint32_t)(sizeof(values) / sizeof(int32_t)) + enumVerifier:GetDocumentsRequest_GetDocumentsRequestV1_Select_IsValidValue]; + GPBEnumDescriptor *expected = nil; + if (!atomic_compare_exchange_strong(&descriptor, &expected, worker)) { + [worker release]; + } + } + return descriptor; +} + +BOOL GetDocumentsRequest_GetDocumentsRequestV1_Select_IsValidValue(int32_t value__) { + switch (value__) { + case GetDocumentsRequest_GetDocumentsRequestV1_Select_Documents: + case GetDocumentsRequest_GetDocumentsRequestV1_Select_Count: + return YES; + default: + return NO; + } +} + #pragma mark - GetDocumentsResponse @implementation GetDocumentsResponse @dynamic versionOneOfCase; @dynamic v0; +@dynamic v1; typedef struct GetDocumentsResponse__storage_ { uint32_t _has_storage_[2]; GetDocumentsResponse_GetDocumentsResponseV0 *v0; + GetDocumentsResponse_GetDocumentsResponseV1 *v1; } GetDocumentsResponse__storage_; // This method is threadsafe because it is initially called @@ -5290,6 +5517,15 @@ + (GPBDescriptor *)descriptor { .flags = GPBFieldOptional, .dataType = GPBDataTypeMessage, }, + { + .name = "v1", + .dataTypeSpecific.clazz = GPBObjCClass(GetDocumentsResponse_GetDocumentsResponseV1), + .number = GetDocumentsResponse_FieldNumber_V1, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GetDocumentsResponse__storage_, v1), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, }; GPBDescriptor *localDescriptor = [GPBDescriptor allocDescriptorForClass:[GetDocumentsResponse class] @@ -5446,17 +5682,21 @@ + (GPBDescriptor *)descriptor { @end -#pragma mark - GetDocumentsCountRequest +#pragma mark - GetDocumentsResponse_GetDocumentsResponseV1 -@implementation GetDocumentsCountRequest +@implementation GetDocumentsResponse_GetDocumentsResponseV1 -@dynamic versionOneOfCase; -@dynamic v0; +@dynamic resultOneOfCase; +@dynamic data_p; +@dynamic proof; +@dynamic hasMetadata, metadata; -typedef struct GetDocumentsCountRequest__storage_ { +typedef struct GetDocumentsResponse_GetDocumentsResponseV1__storage_ { uint32_t _has_storage_[2]; - GetDocumentsCountRequest_GetDocumentsCountRequestV0 *v0; -} GetDocumentsCountRequest__storage_; + GetDocumentsResponse_GetDocumentsResponseV1_ResultData *data_p; + Proof *proof; + ResponseMetadata *metadata; +} GetDocumentsResponse_GetDocumentsResponseV1__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. @@ -5465,196 +5705,48 @@ + (GPBDescriptor *)descriptor { if (!descriptor) { static GPBMessageFieldDescription fields[] = { { - .name = "v0", - .dataTypeSpecific.clazz = GPBObjCClass(GetDocumentsCountRequest_GetDocumentsCountRequestV0), - .number = GetDocumentsCountRequest_FieldNumber_V0, + .name = "data_p", + .dataTypeSpecific.clazz = GPBObjCClass(GetDocumentsResponse_GetDocumentsResponseV1_ResultData), + .number = GetDocumentsResponse_GetDocumentsResponseV1_FieldNumber_Data_p, .hasIndex = -1, - .offset = (uint32_t)offsetof(GetDocumentsCountRequest__storage_, v0), + .offset = (uint32_t)offsetof(GetDocumentsResponse_GetDocumentsResponseV1__storage_, data_p), .flags = GPBFieldOptional, .dataType = GPBDataTypeMessage, }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GetDocumentsCountRequest class] - rootClass:[PlatformRoot class] - file:PlatformRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GetDocumentsCountRequest__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 GetDocumentsCountRequest_ClearVersionOneOfCase(GetDocumentsCountRequest *message) { - GPBDescriptor *descriptor = [GetDocumentsCountRequest descriptor]; - GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0]; - GPBClearOneof(message, oneof); -} -#pragma mark - GetDocumentsCountRequest_GetDocumentsCountRequestV0 - -@implementation GetDocumentsCountRequest_GetDocumentsCountRequestV0 - -@dynamic dataContractId; -@dynamic documentType; -@dynamic where; -@dynamic returnDistinctCountsInRange; -@dynamic orderBy; -@dynamic hasLimit, limit; -@dynamic prove; - -typedef struct GetDocumentsCountRequest_GetDocumentsCountRequestV0__storage_ { - uint32_t _has_storage_[1]; - uint32_t limit; - NSData *dataContractId; - NSString *documentType; - NSData *where; - NSData *orderBy; -} GetDocumentsCountRequest_GetDocumentsCountRequestV0__storage_; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = nil; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "dataContractId", - .dataTypeSpecific.clazz = Nil, - .number = GetDocumentsCountRequest_GetDocumentsCountRequestV0_FieldNumber_DataContractId, - .hasIndex = 0, - .offset = (uint32_t)offsetof(GetDocumentsCountRequest_GetDocumentsCountRequestV0__storage_, dataContractId), - .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), - .dataType = GPBDataTypeBytes, - }, - { - .name = "documentType", - .dataTypeSpecific.clazz = Nil, - .number = GetDocumentsCountRequest_GetDocumentsCountRequestV0_FieldNumber_DocumentType, - .hasIndex = 1, - .offset = (uint32_t)offsetof(GetDocumentsCountRequest_GetDocumentsCountRequestV0__storage_, documentType), - .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), - .dataType = GPBDataTypeString, - }, - { - .name = "where", - .dataTypeSpecific.clazz = Nil, - .number = GetDocumentsCountRequest_GetDocumentsCountRequestV0_FieldNumber_Where, - .hasIndex = 2, - .offset = (uint32_t)offsetof(GetDocumentsCountRequest_GetDocumentsCountRequestV0__storage_, where), - .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), - .dataType = GPBDataTypeBytes, - }, { - .name = "returnDistinctCountsInRange", - .dataTypeSpecific.clazz = Nil, - .number = GetDocumentsCountRequest_GetDocumentsCountRequestV0_FieldNumber_ReturnDistinctCountsInRange, - .hasIndex = 3, - .offset = 4, // Stored in _has_storage_ to save space. - .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), - .dataType = GPBDataTypeBool, - }, - { - .name = "orderBy", - .dataTypeSpecific.clazz = Nil, - .number = GetDocumentsCountRequest_GetDocumentsCountRequestV0_FieldNumber_OrderBy, - .hasIndex = 5, - .offset = (uint32_t)offsetof(GetDocumentsCountRequest_GetDocumentsCountRequestV0__storage_, orderBy), - .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), - .dataType = GPBDataTypeBytes, - }, - { - .name = "limit", - .dataTypeSpecific.clazz = Nil, - .number = GetDocumentsCountRequest_GetDocumentsCountRequestV0_FieldNumber_Limit, - .hasIndex = 6, - .offset = (uint32_t)offsetof(GetDocumentsCountRequest_GetDocumentsCountRequestV0__storage_, limit), + .name = "proof", + .dataTypeSpecific.clazz = GPBObjCClass(Proof), + .number = GetDocumentsResponse_GetDocumentsResponseV1_FieldNumber_Proof, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GetDocumentsResponse_GetDocumentsResponseV1__storage_, proof), .flags = GPBFieldOptional, - .dataType = GPBDataTypeUInt32, - }, - { - .name = "prove", - .dataTypeSpecific.clazz = Nil, - .number = GetDocumentsCountRequest_GetDocumentsCountRequestV0_FieldNumber_Prove, - .hasIndex = 7, - .offset = 8, // Stored in _has_storage_ to save space. - .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), - .dataType = GPBDataTypeBool, + .dataType = GPBDataTypeMessage, }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GetDocumentsCountRequest_GetDocumentsCountRequestV0 class] - rootClass:[PlatformRoot class] - file:PlatformRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GetDocumentsCountRequest_GetDocumentsCountRequestV0__storage_) - flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; - [localDescriptor setupContainingMessageClass:GPBObjCClass(GetDocumentsCountRequest)]; - #if defined(DEBUG) && DEBUG - NSAssert(descriptor == nil, @"Startup recursed!"); - #endif // DEBUG - descriptor = localDescriptor; - } - return descriptor; -} - -@end - -#pragma mark - GetDocumentsCountResponse - -@implementation GetDocumentsCountResponse - -@dynamic versionOneOfCase; -@dynamic v0; - -typedef struct GetDocumentsCountResponse__storage_ { - uint32_t _has_storage_[2]; - GetDocumentsCountResponse_GetDocumentsCountResponseV0 *v0; -} GetDocumentsCountResponse__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(GetDocumentsCountResponse_GetDocumentsCountResponseV0), - .number = GetDocumentsCountResponse_FieldNumber_V0, - .hasIndex = -1, - .offset = (uint32_t)offsetof(GetDocumentsCountResponse__storage_, v0), + .name = "metadata", + .dataTypeSpecific.clazz = GPBObjCClass(ResponseMetadata), + .number = GetDocumentsResponse_GetDocumentsResponseV1_FieldNumber_Metadata, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GetDocumentsResponse_GetDocumentsResponseV1__storage_, metadata), .flags = GPBFieldOptional, .dataType = GPBDataTypeMessage, }, }; GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GetDocumentsCountResponse class] + [GPBDescriptor allocDescriptorForClass:[GetDocumentsResponse_GetDocumentsResponseV1 class] rootClass:[PlatformRoot class] file:PlatformRoot_FileDescriptor() fields:fields fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GetDocumentsCountResponse__storage_) + storageSize:sizeof(GetDocumentsResponse_GetDocumentsResponseV1__storage_) flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; static const char *oneofs[] = { - "version", + "result", }; [localDescriptor setupOneofs:oneofs count:(uint32_t)(sizeof(oneofs) / sizeof(char*)) firstHasIndex:-1]; + [localDescriptor setupContainingMessageClass:GPBObjCClass(GetDocumentsResponse)]; #if defined(DEBUG) && DEBUG NSAssert(descriptor == nil, @"Startup recursed!"); #endif // DEBUG @@ -5665,26 +5757,21 @@ + (GPBDescriptor *)descriptor { @end -void GetDocumentsCountResponse_ClearVersionOneOfCase(GetDocumentsCountResponse *message) { - GPBDescriptor *descriptor = [GetDocumentsCountResponse descriptor]; +void GetDocumentsResponse_GetDocumentsResponseV1_ClearResultOneOfCase(GetDocumentsResponse_GetDocumentsResponseV1 *message) { + GPBDescriptor *descriptor = [GetDocumentsResponse_GetDocumentsResponseV1 descriptor]; GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0]; GPBClearOneof(message, oneof); } -#pragma mark - GetDocumentsCountResponse_GetDocumentsCountResponseV0 +#pragma mark - GetDocumentsResponse_GetDocumentsResponseV1_Documents -@implementation GetDocumentsCountResponse_GetDocumentsCountResponseV0 +@implementation GetDocumentsResponse_GetDocumentsResponseV1_Documents -@dynamic resultOneOfCase; -@dynamic counts; -@dynamic proof; -@dynamic hasMetadata, metadata; +@dynamic documentsArray, documentsArray_Count; -typedef struct GetDocumentsCountResponse_GetDocumentsCountResponseV0__storage_ { - uint32_t _has_storage_[2]; - GetDocumentsCountResponse_GetDocumentsCountResponseV0_CountResults *counts; - Proof *proof; - ResponseMetadata *metadata; -} GetDocumentsCountResponse_GetDocumentsCountResponseV0__storage_; +typedef struct GetDocumentsResponse_GetDocumentsResponseV1_Documents__storage_ { + uint32_t _has_storage_[1]; + NSMutableArray *documentsArray; +} GetDocumentsResponse_GetDocumentsResponseV1_Documents__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. @@ -5693,48 +5780,24 @@ + (GPBDescriptor *)descriptor { if (!descriptor) { static GPBMessageFieldDescription fields[] = { { - .name = "counts", - .dataTypeSpecific.clazz = GPBObjCClass(GetDocumentsCountResponse_GetDocumentsCountResponseV0_CountResults), - .number = GetDocumentsCountResponse_GetDocumentsCountResponseV0_FieldNumber_Counts, - .hasIndex = -1, - .offset = (uint32_t)offsetof(GetDocumentsCountResponse_GetDocumentsCountResponseV0__storage_, counts), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - { - .name = "proof", - .dataTypeSpecific.clazz = GPBObjCClass(Proof), - .number = GetDocumentsCountResponse_GetDocumentsCountResponseV0_FieldNumber_Proof, - .hasIndex = -1, - .offset = (uint32_t)offsetof(GetDocumentsCountResponse_GetDocumentsCountResponseV0__storage_, proof), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - { - .name = "metadata", - .dataTypeSpecific.clazz = GPBObjCClass(ResponseMetadata), - .number = GetDocumentsCountResponse_GetDocumentsCountResponseV0_FieldNumber_Metadata, - .hasIndex = 0, - .offset = (uint32_t)offsetof(GetDocumentsCountResponse_GetDocumentsCountResponseV0__storage_, metadata), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, + .name = "documentsArray", + .dataTypeSpecific.clazz = Nil, + .number = GetDocumentsResponse_GetDocumentsResponseV1_Documents_FieldNumber_DocumentsArray, + .hasIndex = GPBNoHasBit, + .offset = (uint32_t)offsetof(GetDocumentsResponse_GetDocumentsResponseV1_Documents__storage_, documentsArray), + .flags = GPBFieldRepeated, + .dataType = GPBDataTypeBytes, }, }; GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GetDocumentsCountResponse_GetDocumentsCountResponseV0 class] + [GPBDescriptor allocDescriptorForClass:[GetDocumentsResponse_GetDocumentsResponseV1_Documents class] rootClass:[PlatformRoot class] file:PlatformRoot_FileDescriptor() fields:fields fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GetDocumentsCountResponse_GetDocumentsCountResponseV0__storage_) + storageSize:sizeof(GetDocumentsResponse_GetDocumentsResponseV1_Documents__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(GetDocumentsCountResponse)]; + [localDescriptor setupContainingMessageClass:GPBObjCClass(GetDocumentsResponse_GetDocumentsResponseV1)]; #if defined(DEBUG) && DEBUG NSAssert(descriptor == nil, @"Startup recursed!"); #endif // DEBUG @@ -5745,25 +5808,20 @@ + (GPBDescriptor *)descriptor { @end -void GetDocumentsCountResponse_GetDocumentsCountResponseV0_ClearResultOneOfCase(GetDocumentsCountResponse_GetDocumentsCountResponseV0 *message) { - GPBDescriptor *descriptor = [GetDocumentsCountResponse_GetDocumentsCountResponseV0 descriptor]; - GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0]; - GPBClearOneof(message, oneof); -} -#pragma mark - GetDocumentsCountResponse_GetDocumentsCountResponseV0_CountEntry +#pragma mark - GetDocumentsResponse_GetDocumentsResponseV1_CountEntry -@implementation GetDocumentsCountResponse_GetDocumentsCountResponseV0_CountEntry +@implementation GetDocumentsResponse_GetDocumentsResponseV1_CountEntry @dynamic hasInKey, inKey; @dynamic key; @dynamic count; -typedef struct GetDocumentsCountResponse_GetDocumentsCountResponseV0_CountEntry__storage_ { +typedef struct GetDocumentsResponse_GetDocumentsResponseV1_CountEntry__storage_ { uint32_t _has_storage_[1]; NSData *inKey; NSData *key; uint64_t count; -} GetDocumentsCountResponse_GetDocumentsCountResponseV0_CountEntry__storage_; +} GetDocumentsResponse_GetDocumentsResponseV1_CountEntry__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. @@ -5774,40 +5832,40 @@ + (GPBDescriptor *)descriptor { { .name = "inKey", .dataTypeSpecific.clazz = Nil, - .number = GetDocumentsCountResponse_GetDocumentsCountResponseV0_CountEntry_FieldNumber_InKey, + .number = GetDocumentsResponse_GetDocumentsResponseV1_CountEntry_FieldNumber_InKey, .hasIndex = 0, - .offset = (uint32_t)offsetof(GetDocumentsCountResponse_GetDocumentsCountResponseV0_CountEntry__storage_, inKey), + .offset = (uint32_t)offsetof(GetDocumentsResponse_GetDocumentsResponseV1_CountEntry__storage_, inKey), .flags = GPBFieldOptional, .dataType = GPBDataTypeBytes, }, { .name = "key", .dataTypeSpecific.clazz = Nil, - .number = GetDocumentsCountResponse_GetDocumentsCountResponseV0_CountEntry_FieldNumber_Key, + .number = GetDocumentsResponse_GetDocumentsResponseV1_CountEntry_FieldNumber_Key, .hasIndex = 1, - .offset = (uint32_t)offsetof(GetDocumentsCountResponse_GetDocumentsCountResponseV0_CountEntry__storage_, key), + .offset = (uint32_t)offsetof(GetDocumentsResponse_GetDocumentsResponseV1_CountEntry__storage_, key), .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeBytes, }, { .name = "count", .dataTypeSpecific.clazz = Nil, - .number = GetDocumentsCountResponse_GetDocumentsCountResponseV0_CountEntry_FieldNumber_Count, + .number = GetDocumentsResponse_GetDocumentsResponseV1_CountEntry_FieldNumber_Count, .hasIndex = 2, - .offset = (uint32_t)offsetof(GetDocumentsCountResponse_GetDocumentsCountResponseV0_CountEntry__storage_, count), + .offset = (uint32_t)offsetof(GetDocumentsResponse_GetDocumentsResponseV1_CountEntry__storage_, count), .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeUInt64, }, }; GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GetDocumentsCountResponse_GetDocumentsCountResponseV0_CountEntry class] + [GPBDescriptor allocDescriptorForClass:[GetDocumentsResponse_GetDocumentsResponseV1_CountEntry class] rootClass:[PlatformRoot class] file:PlatformRoot_FileDescriptor() fields:fields fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GetDocumentsCountResponse_GetDocumentsCountResponseV0_CountEntry__storage_) + storageSize:sizeof(GetDocumentsResponse_GetDocumentsResponseV1_CountEntry__storage_) flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; - [localDescriptor setupContainingMessageClass:GPBObjCClass(GetDocumentsCountResponse_GetDocumentsCountResponseV0)]; + [localDescriptor setupContainingMessageClass:GPBObjCClass(GetDocumentsResponse_GetDocumentsResponseV1)]; #if defined(DEBUG) && DEBUG NSAssert(descriptor == nil, @"Startup recursed!"); #endif // DEBUG @@ -5818,16 +5876,16 @@ + (GPBDescriptor *)descriptor { @end -#pragma mark - GetDocumentsCountResponse_GetDocumentsCountResponseV0_CountEntries +#pragma mark - GetDocumentsResponse_GetDocumentsResponseV1_CountEntries -@implementation GetDocumentsCountResponse_GetDocumentsCountResponseV0_CountEntries +@implementation GetDocumentsResponse_GetDocumentsResponseV1_CountEntries @dynamic entriesArray, entriesArray_Count; -typedef struct GetDocumentsCountResponse_GetDocumentsCountResponseV0_CountEntries__storage_ { +typedef struct GetDocumentsResponse_GetDocumentsResponseV1_CountEntries__storage_ { uint32_t _has_storage_[1]; NSMutableArray *entriesArray; -} GetDocumentsCountResponse_GetDocumentsCountResponseV0_CountEntries__storage_; +} GetDocumentsResponse_GetDocumentsResponseV1_CountEntries__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. @@ -5837,23 +5895,23 @@ + (GPBDescriptor *)descriptor { static GPBMessageFieldDescription fields[] = { { .name = "entriesArray", - .dataTypeSpecific.clazz = GPBObjCClass(GetDocumentsCountResponse_GetDocumentsCountResponseV0_CountEntry), - .number = GetDocumentsCountResponse_GetDocumentsCountResponseV0_CountEntries_FieldNumber_EntriesArray, + .dataTypeSpecific.clazz = GPBObjCClass(GetDocumentsResponse_GetDocumentsResponseV1_CountEntry), + .number = GetDocumentsResponse_GetDocumentsResponseV1_CountEntries_FieldNumber_EntriesArray, .hasIndex = GPBNoHasBit, - .offset = (uint32_t)offsetof(GetDocumentsCountResponse_GetDocumentsCountResponseV0_CountEntries__storage_, entriesArray), + .offset = (uint32_t)offsetof(GetDocumentsResponse_GetDocumentsResponseV1_CountEntries__storage_, entriesArray), .flags = GPBFieldRepeated, .dataType = GPBDataTypeMessage, }, }; GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GetDocumentsCountResponse_GetDocumentsCountResponseV0_CountEntries class] + [GPBDescriptor allocDescriptorForClass:[GetDocumentsResponse_GetDocumentsResponseV1_CountEntries class] rootClass:[PlatformRoot class] file:PlatformRoot_FileDescriptor() fields:fields fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GetDocumentsCountResponse_GetDocumentsCountResponseV0_CountEntries__storage_) + storageSize:sizeof(GetDocumentsResponse_GetDocumentsResponseV1_CountEntries__storage_) flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; - [localDescriptor setupContainingMessageClass:GPBObjCClass(GetDocumentsCountResponse_GetDocumentsCountResponseV0)]; + [localDescriptor setupContainingMessageClass:GPBObjCClass(GetDocumentsResponse_GetDocumentsResponseV1)]; #if defined(DEBUG) && DEBUG NSAssert(descriptor == nil, @"Startup recursed!"); #endif // DEBUG @@ -5864,19 +5922,19 @@ + (GPBDescriptor *)descriptor { @end -#pragma mark - GetDocumentsCountResponse_GetDocumentsCountResponseV0_CountResults +#pragma mark - GetDocumentsResponse_GetDocumentsResponseV1_CountResults -@implementation GetDocumentsCountResponse_GetDocumentsCountResponseV0_CountResults +@implementation GetDocumentsResponse_GetDocumentsResponseV1_CountResults @dynamic variantOneOfCase; @dynamic aggregateCount; @dynamic entries; -typedef struct GetDocumentsCountResponse_GetDocumentsCountResponseV0_CountResults__storage_ { +typedef struct GetDocumentsResponse_GetDocumentsResponseV1_CountResults__storage_ { uint32_t _has_storage_[2]; - GetDocumentsCountResponse_GetDocumentsCountResponseV0_CountEntries *entries; + GetDocumentsResponse_GetDocumentsResponseV1_CountEntries *entries; uint64_t aggregateCount; -} GetDocumentsCountResponse_GetDocumentsCountResponseV0_CountResults__storage_; +} GetDocumentsResponse_GetDocumentsResponseV1_CountResults__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. @@ -5887,29 +5945,98 @@ + (GPBDescriptor *)descriptor { { .name = "aggregateCount", .dataTypeSpecific.clazz = Nil, - .number = GetDocumentsCountResponse_GetDocumentsCountResponseV0_CountResults_FieldNumber_AggregateCount, + .number = GetDocumentsResponse_GetDocumentsResponseV1_CountResults_FieldNumber_AggregateCount, .hasIndex = -1, - .offset = (uint32_t)offsetof(GetDocumentsCountResponse_GetDocumentsCountResponseV0_CountResults__storage_, aggregateCount), + .offset = (uint32_t)offsetof(GetDocumentsResponse_GetDocumentsResponseV1_CountResults__storage_, aggregateCount), .flags = GPBFieldOptional, .dataType = GPBDataTypeUInt64, }, { .name = "entries", - .dataTypeSpecific.clazz = GPBObjCClass(GetDocumentsCountResponse_GetDocumentsCountResponseV0_CountEntries), - .number = GetDocumentsCountResponse_GetDocumentsCountResponseV0_CountResults_FieldNumber_Entries, + .dataTypeSpecific.clazz = GPBObjCClass(GetDocumentsResponse_GetDocumentsResponseV1_CountEntries), + .number = GetDocumentsResponse_GetDocumentsResponseV1_CountResults_FieldNumber_Entries, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GetDocumentsResponse_GetDocumentsResponseV1_CountResults__storage_, entries), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GetDocumentsResponse_GetDocumentsResponseV1_CountResults class] + rootClass:[PlatformRoot class] + file:PlatformRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GetDocumentsResponse_GetDocumentsResponseV1_CountResults__storage_) + flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; + static const char *oneofs[] = { + "variant", + }; + [localDescriptor setupOneofs:oneofs + count:(uint32_t)(sizeof(oneofs) / sizeof(char*)) + firstHasIndex:-1]; + [localDescriptor setupContainingMessageClass:GPBObjCClass(GetDocumentsResponse_GetDocumentsResponseV1)]; + #if defined(DEBUG) && DEBUG + NSAssert(descriptor == nil, @"Startup recursed!"); + #endif // DEBUG + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +void GetDocumentsResponse_GetDocumentsResponseV1_CountResults_ClearVariantOneOfCase(GetDocumentsResponse_GetDocumentsResponseV1_CountResults *message) { + GPBDescriptor *descriptor = [GetDocumentsResponse_GetDocumentsResponseV1_CountResults descriptor]; + GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0]; + GPBClearOneof(message, oneof); +} +#pragma mark - GetDocumentsResponse_GetDocumentsResponseV1_ResultData + +@implementation GetDocumentsResponse_GetDocumentsResponseV1_ResultData + +@dynamic variantOneOfCase; +@dynamic documents; +@dynamic counts; + +typedef struct GetDocumentsResponse_GetDocumentsResponseV1_ResultData__storage_ { + uint32_t _has_storage_[2]; + GetDocumentsResponse_GetDocumentsResponseV1_Documents *documents; + GetDocumentsResponse_GetDocumentsResponseV1_CountResults *counts; +} GetDocumentsResponse_GetDocumentsResponseV1_ResultData__storage_; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = nil; + if (!descriptor) { + static GPBMessageFieldDescription fields[] = { + { + .name = "documents", + .dataTypeSpecific.clazz = GPBObjCClass(GetDocumentsResponse_GetDocumentsResponseV1_Documents), + .number = GetDocumentsResponse_GetDocumentsResponseV1_ResultData_FieldNumber_Documents, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GetDocumentsResponse_GetDocumentsResponseV1_ResultData__storage_, documents), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + { + .name = "counts", + .dataTypeSpecific.clazz = GPBObjCClass(GetDocumentsResponse_GetDocumentsResponseV1_CountResults), + .number = GetDocumentsResponse_GetDocumentsResponseV1_ResultData_FieldNumber_Counts, .hasIndex = -1, - .offset = (uint32_t)offsetof(GetDocumentsCountResponse_GetDocumentsCountResponseV0_CountResults__storage_, entries), + .offset = (uint32_t)offsetof(GetDocumentsResponse_GetDocumentsResponseV1_ResultData__storage_, counts), .flags = GPBFieldOptional, .dataType = GPBDataTypeMessage, }, }; GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GetDocumentsCountResponse_GetDocumentsCountResponseV0_CountResults class] + [GPBDescriptor allocDescriptorForClass:[GetDocumentsResponse_GetDocumentsResponseV1_ResultData class] rootClass:[PlatformRoot class] file:PlatformRoot_FileDescriptor() fields:fields fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GetDocumentsCountResponse_GetDocumentsCountResponseV0_CountResults__storage_) + storageSize:sizeof(GetDocumentsResponse_GetDocumentsResponseV1_ResultData__storage_) flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; static const char *oneofs[] = { "variant", @@ -5917,7 +6044,7 @@ + (GPBDescriptor *)descriptor { [localDescriptor setupOneofs:oneofs count:(uint32_t)(sizeof(oneofs) / sizeof(char*)) firstHasIndex:-1]; - [localDescriptor setupContainingMessageClass:GPBObjCClass(GetDocumentsCountResponse_GetDocumentsCountResponseV0)]; + [localDescriptor setupContainingMessageClass:GPBObjCClass(GetDocumentsResponse_GetDocumentsResponseV1)]; #if defined(DEBUG) && DEBUG NSAssert(descriptor == nil, @"Startup recursed!"); #endif // DEBUG @@ -5928,8 +6055,8 @@ + (GPBDescriptor *)descriptor { @end -void GetDocumentsCountResponse_GetDocumentsCountResponseV0_CountResults_ClearVariantOneOfCase(GetDocumentsCountResponse_GetDocumentsCountResponseV0_CountResults *message) { - GPBDescriptor *descriptor = [GetDocumentsCountResponse_GetDocumentsCountResponseV0_CountResults descriptor]; +void GetDocumentsResponse_GetDocumentsResponseV1_ResultData_ClearVariantOneOfCase(GetDocumentsResponse_GetDocumentsResponseV1_ResultData *message) { + GPBDescriptor *descriptor = [GetDocumentsResponse_GetDocumentsResponseV1_ResultData descriptor]; GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0]; GPBClearOneof(message, oneof); } 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 614772fb595..d1ea38a97c9 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 @@ -42,8 +42,6 @@ @class GetDataContractResponse; @class GetDataContractsRequest; @class GetDataContractsResponse; -@class GetDocumentsCountRequest; -@class GetDocumentsCountResponse; @class GetDocumentsRequest; @class GetDocumentsResponse; @class GetEpochsInfoRequest; @@ -232,12 +230,15 @@ NS_ASSUME_NONNULL_BEGIN - (GRPCUnaryProtoCall *)getDocumentsWithMessage:(GetDocumentsRequest *)message responseHandler:(id)handler callOptions:(GRPCCallOptions *_Nullable)callOptions; -#pragma mark getDocumentsCount(GetDocumentsCountRequest) returns (GetDocumentsCountResponse) - -- (GRPCUnaryProtoCall *)getDocumentsCountWithMessage:(GetDocumentsCountRequest *)message responseHandler:(id)handler callOptions:(GRPCCallOptions *_Nullable)callOptions; - #pragma mark getIdentityByPublicKeyHash(GetIdentityByPublicKeyHashRequest) returns (GetIdentityByPublicKeyHashResponse) +/** + * `getDocumentsCount` removed in v1: callers express counts via + * `getDocuments` with `version.v1.select = COUNT` (optionally + * with `group_by`). See `GetDocumentsRequestV1` for the unified + * SQL-shaped surface. The v0-count endpoint shipped briefly in + * #3623 and never had stable callers; v1 supersedes it entirely. + */ - (GRPCUnaryProtoCall *)getIdentityByPublicKeyHashWithMessage:(GetIdentityByPublicKeyHashRequest *)message responseHandler:(id)handler callOptions:(GRPCCallOptions *_Nullable)callOptions; #pragma mark getIdentityByNonUniquePublicKeyHash(GetIdentityByNonUniquePublicKeyHashRequest) returns (GetIdentityByNonUniquePublicKeyHashResponse) @@ -565,17 +566,28 @@ NS_ASSUME_NONNULL_BEGIN - (GRPCProtoCall *)RPCTogetDocumentsWithRequest:(GetDocumentsRequest *)request handler:(void(^)(GetDocumentsResponse *_Nullable response, NSError *_Nullable error))handler; -#pragma mark getDocumentsCount(GetDocumentsCountRequest) returns (GetDocumentsCountResponse) - -- (void)getDocumentsCountWithRequest:(GetDocumentsCountRequest *)request handler:(void(^)(GetDocumentsCountResponse *_Nullable response, NSError *_Nullable error))handler; - -- (GRPCProtoCall *)RPCTogetDocumentsCountWithRequest:(GetDocumentsCountRequest *)request handler:(void(^)(GetDocumentsCountResponse *_Nullable response, NSError *_Nullable error))handler; - - #pragma mark getIdentityByPublicKeyHash(GetIdentityByPublicKeyHashRequest) returns (GetIdentityByPublicKeyHashResponse) +/** + * `getDocumentsCount` removed in v1: callers express counts via + * `getDocuments` with `version.v1.select = COUNT` (optionally + * with `group_by`). See `GetDocumentsRequestV1` for the unified + * SQL-shaped surface. The v0-count endpoint shipped briefly in + * #3623 and never had stable callers; v1 supersedes it entirely. + * + * This method belongs to a set of APIs that have been deprecated. Using the v2 API is recommended. + */ - (void)getIdentityByPublicKeyHashWithRequest:(GetIdentityByPublicKeyHashRequest *)request handler:(void(^)(GetIdentityByPublicKeyHashResponse *_Nullable response, NSError *_Nullable error))handler; +/** + * `getDocumentsCount` removed in v1: callers express counts via + * `getDocuments` with `version.v1.select = COUNT` (optionally + * with `group_by`). See `GetDocumentsRequestV1` for the unified + * SQL-shaped surface. The v0-count endpoint shipped briefly in + * #3623 and never had stable callers; v1 supersedes it entirely. + * + * This method belongs to a set of APIs that have been deprecated. Using the v2 API is recommended. + */ - (GRPCProtoCall *)RPCTogetIdentityByPublicKeyHashWithRequest:(GetIdentityByPublicKeyHashRequest *)request handler:(void(^)(GetIdentityByPublicKeyHashResponse *_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 95bfaa8245a..9869906e900 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 @@ -383,38 +383,43 @@ - (GRPCUnaryProtoCall *)getDocumentsWithMessage:(GetDocumentsRequest *)message r responseClass:[GetDocumentsResponse class]]; } -#pragma mark getDocumentsCount(GetDocumentsCountRequest) returns (GetDocumentsCountResponse) - -- (void)getDocumentsCountWithRequest:(GetDocumentsCountRequest *)request handler:(void(^)(GetDocumentsCountResponse *_Nullable response, NSError *_Nullable error))handler{ - [[self RPCTogetDocumentsCountWithRequest:request handler:handler] start]; -} -// Returns a not-yet-started RPC object. -- (GRPCProtoCall *)RPCTogetDocumentsCountWithRequest:(GetDocumentsCountRequest *)request handler:(void(^)(GetDocumentsCountResponse *_Nullable response, NSError *_Nullable error))handler{ - return [self RPCToMethod:@"getDocumentsCount" - requestsWriter:[GRXWriter writerWithValue:request] - responseClass:[GetDocumentsCountResponse class] - responsesWriteable:[GRXWriteable writeableWithSingleHandler:handler]]; -} -- (GRPCUnaryProtoCall *)getDocumentsCountWithMessage:(GetDocumentsCountRequest *)message responseHandler:(id)handler callOptions:(GRPCCallOptions *_Nullable)callOptions { - return [self RPCToMethod:@"getDocumentsCount" - message:message - responseHandler:handler - callOptions:callOptions - responseClass:[GetDocumentsCountResponse class]]; -} - #pragma mark getIdentityByPublicKeyHash(GetIdentityByPublicKeyHashRequest) returns (GetIdentityByPublicKeyHashResponse) +/** + * `getDocumentsCount` removed in v1: callers express counts via + * `getDocuments` with `version.v1.select = COUNT` (optionally + * with `group_by`). See `GetDocumentsRequestV1` for the unified + * SQL-shaped surface. The v0-count endpoint shipped briefly in + * #3623 and never had stable callers; v1 supersedes it entirely. + * + * This method belongs to a set of APIs that have been deprecated. Using the v2 API is recommended. + */ - (void)getIdentityByPublicKeyHashWithRequest:(GetIdentityByPublicKeyHashRequest *)request handler:(void(^)(GetIdentityByPublicKeyHashResponse *_Nullable response, NSError *_Nullable error))handler{ [[self RPCTogetIdentityByPublicKeyHashWithRequest:request handler:handler] start]; } // Returns a not-yet-started RPC object. +/** + * `getDocumentsCount` removed in v1: callers express counts via + * `getDocuments` with `version.v1.select = COUNT` (optionally + * with `group_by`). See `GetDocumentsRequestV1` for the unified + * SQL-shaped surface. The v0-count endpoint shipped briefly in + * #3623 and never had stable callers; v1 supersedes it entirely. + * + * This method belongs to a set of APIs that have been deprecated. Using the v2 API is recommended. + */ - (GRPCProtoCall *)RPCTogetIdentityByPublicKeyHashWithRequest:(GetIdentityByPublicKeyHashRequest *)request handler:(void(^)(GetIdentityByPublicKeyHashResponse *_Nullable response, NSError *_Nullable error))handler{ return [self RPCToMethod:@"getIdentityByPublicKeyHash" requestsWriter:[GRXWriter writerWithValue:request] responseClass:[GetIdentityByPublicKeyHashResponse class] responsesWriteable:[GRXWriteable writeableWithSingleHandler:handler]]; } +/** + * `getDocumentsCount` removed in v1: callers express counts via + * `getDocuments` with `version.v1.select = COUNT` (optionally + * with `group_by`). See `GetDocumentsRequestV1` for the unified + * SQL-shaped surface. The v0-count endpoint shipped briefly in + * #3623 and never had stable callers; v1 supersedes it entirely. + */ - (GRPCUnaryProtoCall *)getIdentityByPublicKeyHashWithMessage:(GetIdentityByPublicKeyHashRequest *)message responseHandler:(id)handler callOptions:(GRPCCallOptions *_Nullable)callOptions { return [self RPCToMethod:@"getIdentityByPublicKeyHash" message:message 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 cc449f137d3..2d58d18e9fc 100644 --- a/packages/dapi-grpc/clients/platform/v0/python/platform_pb2.py +++ b/packages/dapi-grpc/clients/platform/v0/python/platform_pb2.py @@ -23,7 +23,7 @@ syntax='proto3', serialized_options=None, create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\x0eplatform.proto\x12\x19org.dash.platform.dapi.v0\x1a\x1egoogle/protobuf/wrappers.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x81\x01\n\x05Proof\x12\x15\n\rgrovedb_proof\x18\x01 \x01(\x0c\x12\x13\n\x0bquorum_hash\x18\x02 \x01(\x0c\x12\x11\n\tsignature\x18\x03 \x01(\x0c\x12\r\n\x05round\x18\x04 \x01(\r\x12\x15\n\rblock_id_hash\x18\x05 \x01(\x0c\x12\x13\n\x0bquorum_type\x18\x06 \x01(\r\"\x98\x01\n\x10ResponseMetadata\x12\x12\n\x06height\x18\x01 \x01(\x04\x42\x02\x30\x01\x12 \n\x18\x63ore_chain_locked_height\x18\x02 \x01(\r\x12\r\n\x05\x65poch\x18\x03 \x01(\r\x12\x13\n\x07time_ms\x18\x04 \x01(\x04\x42\x02\x30\x01\x12\x18\n\x10protocol_version\x18\x05 \x01(\r\x12\x10\n\x08\x63hain_id\x18\x06 \x01(\t\"L\n\x1dStateTransitionBroadcastError\x12\x0c\n\x04\x63ode\x18\x01 \x01(\r\x12\x0f\n\x07message\x18\x02 \x01(\t\x12\x0c\n\x04\x64\x61ta\x18\x03 \x01(\x0c\";\n\x1f\x42roadcastStateTransitionRequest\x12\x18\n\x10state_transition\x18\x01 \x01(\x0c\"\"\n BroadcastStateTransitionResponse\"\xa4\x01\n\x12GetIdentityRequest\x12P\n\x02v0\x18\x01 \x01(\x0b\x32\x42.org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0H\x00\x1a\x31\n\x14GetIdentityRequestV0\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xc1\x01\n\x17GetIdentityNonceRequest\x12Z\n\x02v0\x18\x01 \x01(\x0b\x32L.org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0H\x00\x1a?\n\x19GetIdentityNonceRequestV0\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xf6\x01\n\x1fGetIdentityContractNonceRequest\x12j\n\x02v0\x18\x01 \x01(\x0b\x32\\.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0H\x00\x1a\\\n!GetIdentityContractNonceRequestV0\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12\x13\n\x0b\x63ontract_id\x18\x02 \x01(\x0c\x12\r\n\x05prove\x18\x03 \x01(\x08\x42\t\n\x07version\"\xc0\x01\n\x19GetIdentityBalanceRequest\x12^\n\x02v0\x18\x01 \x01(\x0b\x32P.org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0H\x00\x1a\x38\n\x1bGetIdentityBalanceRequestV0\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xec\x01\n$GetIdentityBalanceAndRevisionRequest\x12t\n\x02v0\x18\x01 \x01(\x0b\x32\x66.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0H\x00\x1a\x43\n&GetIdentityBalanceAndRevisionRequestV0\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\x9e\x02\n\x13GetIdentityResponse\x12R\n\x02v0\x18\x01 \x01(\x0b\x32\x44.org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0H\x00\x1a\xa7\x01\n\x15GetIdentityResponseV0\x12\x12\n\x08identity\x18\x01 \x01(\x0cH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"\xbc\x02\n\x18GetIdentityNonceResponse\x12\\\n\x02v0\x18\x01 \x01(\x0b\x32N.org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0H\x00\x1a\xb6\x01\n\x1aGetIdentityNonceResponseV0\x12\x1c\n\x0eidentity_nonce\x18\x01 \x01(\x04\x42\x02\x30\x01H\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"\xe5\x02\n GetIdentityContractNonceResponse\x12l\n\x02v0\x18\x01 \x01(\x0b\x32^.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0H\x00\x1a\xc7\x01\n\"GetIdentityContractNonceResponseV0\x12%\n\x17identity_contract_nonce\x18\x01 \x01(\x04\x42\x02\x30\x01H\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"\xbd\x02\n\x1aGetIdentityBalanceResponse\x12`\n\x02v0\x18\x01 \x01(\x0b\x32R.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0H\x00\x1a\xb1\x01\n\x1cGetIdentityBalanceResponseV0\x12\x15\n\x07\x62\x61lance\x18\x01 \x01(\x04\x42\x02\x30\x01H\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"\xb1\x04\n%GetIdentityBalanceAndRevisionResponse\x12v\n\x02v0\x18\x01 \x01(\x0b\x32h.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0H\x00\x1a\x84\x03\n\'GetIdentityBalanceAndRevisionResponseV0\x12\x9b\x01\n\x14\x62\x61lance_and_revision\x18\x01 \x01(\x0b\x32{.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevisionH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a?\n\x12\x42\x61lanceAndRevision\x12\x13\n\x07\x62\x61lance\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x14\n\x08revision\x18\x02 \x01(\x04\x42\x02\x30\x01\x42\x08\n\x06resultB\t\n\x07version\"\xd1\x01\n\x0eKeyRequestType\x12\x36\n\x08\x61ll_keys\x18\x01 \x01(\x0b\x32\".org.dash.platform.dapi.v0.AllKeysH\x00\x12@\n\rspecific_keys\x18\x02 \x01(\x0b\x32\'.org.dash.platform.dapi.v0.SpecificKeysH\x00\x12:\n\nsearch_key\x18\x03 \x01(\x0b\x32$.org.dash.platform.dapi.v0.SearchKeyH\x00\x42\t\n\x07request\"\t\n\x07\x41llKeys\"\x1f\n\x0cSpecificKeys\x12\x0f\n\x07key_ids\x18\x01 \x03(\r\"\xb6\x01\n\tSearchKey\x12I\n\x0bpurpose_map\x18\x01 \x03(\x0b\x32\x34.org.dash.platform.dapi.v0.SearchKey.PurposeMapEntry\x1a^\n\x0fPurposeMapEntry\x12\x0b\n\x03key\x18\x01 \x01(\r\x12:\n\x05value\x18\x02 \x01(\x0b\x32+.org.dash.platform.dapi.v0.SecurityLevelMap:\x02\x38\x01\"\xbf\x02\n\x10SecurityLevelMap\x12]\n\x12security_level_map\x18\x01 \x03(\x0b\x32\x41.org.dash.platform.dapi.v0.SecurityLevelMap.SecurityLevelMapEntry\x1aw\n\x15SecurityLevelMapEntry\x12\x0b\n\x03key\x18\x01 \x01(\r\x12M\n\x05value\x18\x02 \x01(\x0e\x32>.org.dash.platform.dapi.v0.SecurityLevelMap.KeyKindRequestType:\x02\x38\x01\"S\n\x12KeyKindRequestType\x12\x1f\n\x1b\x43URRENT_KEY_OF_KIND_REQUEST\x10\x00\x12\x1c\n\x18\x41LL_KEYS_OF_KIND_REQUEST\x10\x01\"\xda\x02\n\x16GetIdentityKeysRequest\x12X\n\x02v0\x18\x01 \x01(\x0b\x32J.org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0H\x00\x1a\xda\x01\n\x18GetIdentityKeysRequestV0\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12?\n\x0crequest_type\x18\x02 \x01(\x0b\x32).org.dash.platform.dapi.v0.KeyRequestType\x12+\n\x05limit\x18\x03 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12,\n\x06offset\x18\x04 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12\r\n\x05prove\x18\x05 \x01(\x08\x42\t\n\x07version\"\x99\x03\n\x17GetIdentityKeysResponse\x12Z\n\x02v0\x18\x01 \x01(\x0b\x32L.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0H\x00\x1a\x96\x02\n\x19GetIdentityKeysResponseV0\x12\x61\n\x04keys\x18\x01 \x01(\x0b\x32Q.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.KeysH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\x1a\n\x04Keys\x12\x12\n\nkeys_bytes\x18\x01 \x03(\x0c\x42\x08\n\x06resultB\t\n\x07version\"\xef\x02\n GetIdentitiesContractKeysRequest\x12l\n\x02v0\x18\x01 \x01(\x0b\x32^.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0H\x00\x1a\xd1\x01\n\"GetIdentitiesContractKeysRequestV0\x12\x16\n\x0eidentities_ids\x18\x01 \x03(\x0c\x12\x13\n\x0b\x63ontract_id\x18\x02 \x01(\x0c\x12\x1f\n\x12\x64ocument_type_name\x18\x03 \x01(\tH\x00\x88\x01\x01\x12\x37\n\x08purposes\x18\x04 \x03(\x0e\x32%.org.dash.platform.dapi.v0.KeyPurpose\x12\r\n\x05prove\x18\x05 \x01(\x08\x42\x15\n\x13_document_type_nameB\t\n\x07version\"\xdf\x06\n!GetIdentitiesContractKeysResponse\x12n\n\x02v0\x18\x01 \x01(\x0b\x32`.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0H\x00\x1a\xbe\x05\n#GetIdentitiesContractKeysResponseV0\x12\x8a\x01\n\x0fidentities_keys\x18\x01 \x01(\x0b\x32o.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeysH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1aY\n\x0bPurposeKeys\x12\x36\n\x07purpose\x18\x01 \x01(\x0e\x32%.org.dash.platform.dapi.v0.KeyPurpose\x12\x12\n\nkeys_bytes\x18\x02 \x03(\x0c\x1a\x9f\x01\n\x0cIdentityKeys\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12z\n\x04keys\x18\x02 \x03(\x0b\x32l.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys\x1a\x90\x01\n\x0eIdentitiesKeys\x12~\n\x07\x65ntries\x18\x01 \x03(\x0b\x32m.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeysB\x08\n\x06resultB\t\n\x07version\"\xa4\x02\n*GetEvonodesProposedEpochBlocksByIdsRequest\x12\x80\x01\n\x02v0\x18\x01 \x01(\x0b\x32r.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0H\x00\x1ah\n,GetEvonodesProposedEpochBlocksByIdsRequestV0\x12\x12\n\x05\x65poch\x18\x01 \x01(\rH\x00\x88\x01\x01\x12\x0b\n\x03ids\x18\x02 \x03(\x0c\x12\r\n\x05prove\x18\x03 \x01(\x08\x42\x08\n\x06_epochB\t\n\x07version\"\x92\x06\n&GetEvonodesProposedEpochBlocksResponse\x12x\n\x02v0\x18\x01 \x01(\x0b\x32j.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0H\x00\x1a\xe2\x04\n(GetEvonodesProposedEpochBlocksResponseV0\x12\xb1\x01\n#evonodes_proposed_block_counts_info\x18\x01 \x01(\x0b\x32\x81\x01.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocksH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a?\n\x15\x45vonodeProposedBlocks\x12\x13\n\x0bpro_tx_hash\x18\x01 \x01(\x0c\x12\x11\n\x05\x63ount\x18\x02 \x01(\x04\x42\x02\x30\x01\x1a\xc4\x01\n\x16\x45vonodesProposedBlocks\x12\xa9\x01\n\x1e\x65vonodes_proposed_block_counts\x18\x01 \x03(\x0b\x32\x80\x01.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocksB\x08\n\x06resultB\t\n\x07version\"\xf2\x02\n,GetEvonodesProposedEpochBlocksByRangeRequest\x12\x84\x01\n\x02v0\x18\x01 \x01(\x0b\x32v.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0H\x00\x1a\xaf\x01\n.GetEvonodesProposedEpochBlocksByRangeRequestV0\x12\x12\n\x05\x65poch\x18\x01 \x01(\rH\x01\x88\x01\x01\x12\x12\n\x05limit\x18\x02 \x01(\rH\x02\x88\x01\x01\x12\x15\n\x0bstart_after\x18\x03 \x01(\x0cH\x00\x12\x12\n\x08start_at\x18\x04 \x01(\x0cH\x00\x12\r\n\x05prove\x18\x05 \x01(\x08\x42\x07\n\x05startB\x08\n\x06_epochB\x08\n\x06_limitB\t\n\x07version\"\xcd\x01\n\x1cGetIdentitiesBalancesRequest\x12\x64\n\x02v0\x18\x01 \x01(\x0b\x32V.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0H\x00\x1a<\n\x1eGetIdentitiesBalancesRequestV0\x12\x0b\n\x03ids\x18\x01 \x03(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\x9f\x05\n\x1dGetIdentitiesBalancesResponse\x12\x66\n\x02v0\x18\x01 \x01(\x0b\x32X.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0H\x00\x1a\x8a\x04\n\x1fGetIdentitiesBalancesResponseV0\x12\x8a\x01\n\x13identities_balances\x18\x01 \x01(\x0b\x32k.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalancesH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1aL\n\x0fIdentityBalance\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12\x18\n\x07\x62\x61lance\x18\x02 \x01(\x04\x42\x02\x30\x01H\x00\x88\x01\x01\x42\n\n\x08_balance\x1a\x8f\x01\n\x12IdentitiesBalances\x12y\n\x07\x65ntries\x18\x01 \x03(\x0b\x32h.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalanceB\x08\n\x06resultB\t\n\x07version\"\xb4\x01\n\x16GetDataContractRequest\x12X\n\x02v0\x18\x01 \x01(\x0b\x32J.org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0H\x00\x1a\x35\n\x18GetDataContractRequestV0\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xb3\x02\n\x17GetDataContractResponse\x12Z\n\x02v0\x18\x01 \x01(\x0b\x32L.org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0H\x00\x1a\xb0\x01\n\x19GetDataContractResponseV0\x12\x17\n\rdata_contract\x18\x01 \x01(\x0cH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"\xb9\x01\n\x17GetDataContractsRequest\x12Z\n\x02v0\x18\x01 \x01(\x0b\x32L.org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0H\x00\x1a\x37\n\x19GetDataContractsRequestV0\x12\x0b\n\x03ids\x18\x01 \x03(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xcf\x04\n\x18GetDataContractsResponse\x12\\\n\x02v0\x18\x01 \x01(\x0b\x32N.org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0H\x00\x1a[\n\x11\x44\x61taContractEntry\x12\x12\n\nidentifier\x18\x01 \x01(\x0c\x12\x32\n\rdata_contract\x18\x02 \x01(\x0b\x32\x1b.google.protobuf.BytesValue\x1au\n\rDataContracts\x12\x64\n\x15\x64\x61ta_contract_entries\x18\x01 \x03(\x0b\x32\x45.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry\x1a\xf5\x01\n\x1aGetDataContractsResponseV0\x12[\n\x0e\x64\x61ta_contracts\x18\x01 \x01(\x0b\x32\x41.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractsH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"\xc5\x02\n\x1dGetDataContractHistoryRequest\x12\x66\n\x02v0\x18\x01 \x01(\x0b\x32X.org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0H\x00\x1a\xb0\x01\n\x1fGetDataContractHistoryRequestV0\x12\n\n\x02id\x18\x01 \x01(\x0c\x12+\n\x05limit\x18\x02 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12,\n\x06offset\x18\x03 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12\x17\n\x0bstart_at_ms\x18\x04 \x01(\x04\x42\x02\x30\x01\x12\r\n\x05prove\x18\x05 \x01(\x08\x42\t\n\x07version\"\xb2\x05\n\x1eGetDataContractHistoryResponse\x12h\n\x02v0\x18\x01 \x01(\x0b\x32Z.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0H\x00\x1a\x9a\x04\n GetDataContractHistoryResponseV0\x12\x8f\x01\n\x15\x64\x61ta_contract_history\x18\x01 \x01(\x0b\x32n.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a;\n\x18\x44\x61taContractHistoryEntry\x12\x10\n\x04\x64\x61te\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\r\n\x05value\x18\x02 \x01(\x0c\x1a\xaa\x01\n\x13\x44\x61taContractHistory\x12\x92\x01\n\x15\x64\x61ta_contract_entries\x18\x01 \x03(\x0b\x32s.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntryB\x08\n\x06resultB\t\n\x07version\"\xb2\x02\n\x13GetDocumentsRequest\x12R\n\x02v0\x18\x01 \x01(\x0b\x32\x44.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0H\x00\x1a\xbb\x01\n\x15GetDocumentsRequestV0\x12\x18\n\x10\x64\x61ta_contract_id\x18\x01 \x01(\x0c\x12\x15\n\rdocument_type\x18\x02 \x01(\t\x12\r\n\x05where\x18\x03 \x01(\x0c\x12\x10\n\x08order_by\x18\x04 \x01(\x0c\x12\r\n\x05limit\x18\x05 \x01(\r\x12\x15\n\x0bstart_after\x18\x06 \x01(\x0cH\x00\x12\x12\n\x08start_at\x18\x07 \x01(\x0cH\x00\x12\r\n\x05prove\x18\x08 \x01(\x08\x42\x07\n\x05startB\t\n\x07version\"\x95\x03\n\x14GetDocumentsResponse\x12T\n\x02v0\x18\x01 \x01(\x0b\x32\x46.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0H\x00\x1a\x9b\x02\n\x16GetDocumentsResponseV0\x12\x65\n\tdocuments\x18\x01 \x01(\x0b\x32P.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.DocumentsH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\x1e\n\tDocuments\x12\x11\n\tdocuments\x18\x01 \x03(\x0c\x42\x08\n\x06resultB\t\n\x07version\"\xca\x02\n\x18GetDocumentsCountRequest\x12\\\n\x02v0\x18\x01 \x01(\x0b\x32N.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0H\x00\x1a\xc4\x01\n\x1aGetDocumentsCountRequestV0\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\'\n\x1freturn_distinct_counts_in_range\x18\x04 \x01(\x08\x12\x10\n\x08order_by\x18\x05 \x01(\x0c\x12\x12\n\x05limit\x18\x06 \x01(\rH\x00\x88\x01\x01\x12\r\n\x05prove\x18\x07 \x01(\x08\x42\x08\n\x06_limitB\t\n\x07version\"\x8c\x06\n\x19GetDocumentsCountResponse\x12^\n\x02v0\x18\x01 \x01(\x0b\x32P.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0H\x00\x1a\x83\x05\n\x1bGetDocumentsCountResponseV0\x12o\n\x06\x63ounts\x18\x01 \x01(\x0b\x32].org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResultsH\x00\x12\x31\n\x05proof\x18\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\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\x1a|\n\x0c\x43ountEntries\x12l\n\x07\x65ntries\x18\x01 \x03(\x0b\x32[.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry\x1a\xaa\x01\n\x0c\x43ountResults\x12\x1d\n\x0f\x61ggregate_count\x18\x01 \x01(\x04\x42\x02\x30\x01H\x00\x12p\n\x07\x65ntries\x18\x02 \x01(\x0b\x32].org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntriesH\x00\x42\t\n\x07variantB\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\"\xac\x05\n!GetShieldedEncryptedNotesResponse\x12n\n\x02v0\x18\x01 \x01(\x0b\x32`.org.dash.platform.dapi.v0.GetShieldedEncryptedNotesResponse.GetShieldedEncryptedNotesResponseV0H\x00\x1a\x8b\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\x1aG\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\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\"\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\"\xe5\x01\n\x1eGetNullifiersTrunkStateRequest\x12h\n\x02v0\x18\x01 \x01(\x0b\x32Z.org.dash.platform.dapi.v0.GetNullifiersTrunkStateRequest.GetNullifiersTrunkStateRequestV0H\x00\x1aN\n GetNullifiersTrunkStateRequestV0\x12\x11\n\tpool_type\x18\x01 \x01(\r\x12\x17\n\x0fpool_identifier\x18\x02 \x01(\x0c\x42\t\n\x07version\"\xae\x02\n\x1fGetNullifiersTrunkStateResponse\x12j\n\x02v0\x18\x01 \x01(\x0b\x32\\.org.dash.platform.dapi.v0.GetNullifiersTrunkStateResponse.GetNullifiersTrunkStateResponseV0H\x00\x1a\x93\x01\n!GetNullifiersTrunkStateResponseV0\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\"\xa1\x02\n\x1fGetNullifiersBranchStateRequest\x12j\n\x02v0\x18\x01 \x01(\x0b\x32\\.org.dash.platform.dapi.v0.GetNullifiersBranchStateRequest.GetNullifiersBranchStateRequestV0H\x00\x1a\x86\x01\n!GetNullifiersBranchStateRequestV0\x12\x11\n\tpool_type\x18\x01 \x01(\r\x12\x17\n\x0fpool_identifier\x18\x02 \x01(\x0c\x12\x0b\n\x03key\x18\x03 \x01(\x0c\x12\r\n\x05\x64\x65pth\x18\x04 \x01(\r\x12\x19\n\x11\x63heckpoint_height\x18\x05 \x01(\x04\x42\t\n\x07version\"\xd5\x01\n GetNullifiersBranchStateResponse\x12l\n\x02v0\x18\x01 \x01(\x0b\x32^.org.dash.platform.dapi.v0.GetNullifiersBranchStateResponse.GetNullifiersBranchStateResponseV0H\x00\x1a\x38\n\"GetNullifiersBranchStateResponseV0\x12\x12\n\nmerk_proof\x18\x02 \x01(\x0c\x42\t\n\x07version\"E\n\x15\x42lockNullifierChanges\x12\x18\n\x0c\x62lock_height\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x12\n\nnullifiers\x18\x02 \x03(\x0c\"a\n\x16NullifierUpdateEntries\x12G\n\rblock_changes\x18\x01 \x03(\x0b\x32\x30.org.dash.platform.dapi.v0.BlockNullifierChanges\"\xea\x01\n GetRecentNullifierChangesRequest\x12l\n\x02v0\x18\x01 \x01(\x0b\x32^.org.dash.platform.dapi.v0.GetRecentNullifierChangesRequest.GetRecentNullifierChangesRequestV0H\x00\x1aM\n\"GetRecentNullifierChangesRequestV0\x12\x18\n\x0cstart_height\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\x99\x03\n!GetRecentNullifierChangesResponse\x12n\n\x02v0\x18\x01 \x01(\x0b\x32`.org.dash.platform.dapi.v0.GetRecentNullifierChangesResponse.GetRecentNullifierChangesResponseV0H\x00\x1a\xf8\x01\n#GetRecentNullifierChangesResponseV0\x12U\n\x18nullifier_update_entries\x18\x01 \x01(\x0b\x32\x31.org.dash.platform.dapi.v0.NullifierUpdateEntriesH\x00\x12\x31\n\x05proof\x18\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\x1e\x43ompactedBlockNullifierChanges\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\x12\x12\n\nnullifiers\x18\x03 \x03(\x0c\"}\n\x1f\x43ompactedNullifierUpdateEntries\x12Z\n\x17\x63ompacted_block_changes\x18\x01 \x03(\x0b\x32\x39.org.dash.platform.dapi.v0.CompactedBlockNullifierChanges\"\x94\x02\n)GetRecentCompactedNullifierChangesRequest\x12~\n\x02v0\x18\x01 \x01(\x0b\x32p.org.dash.platform.dapi.v0.GetRecentCompactedNullifierChangesRequest.GetRecentCompactedNullifierChangesRequestV0H\x00\x1a\\\n+GetRecentCompactedNullifierChangesRequestV0\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\"\xd1\x03\n*GetRecentCompactedNullifierChangesResponse\x12\x80\x01\n\x02v0\x18\x01 \x01(\x0b\x32r.org.dash.platform.dapi.v0.GetRecentCompactedNullifierChangesResponse.GetRecentCompactedNullifierChangesResponseV0H\x00\x1a\x94\x02\n,GetRecentCompactedNullifierChangesResponseV0\x12h\n\"compacted_nullifier_update_entries\x18\x01 \x01(\x0b\x32:.org.dash.platform.dapi.v0.CompactedNullifierUpdateEntriesH\x00\x12\x31\n\x05proof\x18\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*Z\n\nKeyPurpose\x12\x12\n\x0e\x41UTHENTICATION\x10\x00\x12\x0e\n\nENCRYPTION\x10\x01\x12\x0e\n\nDECRYPTION\x10\x02\x12\x0c\n\x08TRANSFER\x10\x03\x12\n\n\x06VOTING\x10\x05\x32\xb3H\n\x08Platform\x12\x93\x01\n\x18\x62roadcastStateTransition\x12:.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest\x1a;.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse\x12l\n\x0bgetIdentity\x12-.org.dash.platform.dapi.v0.GetIdentityRequest\x1a..org.dash.platform.dapi.v0.GetIdentityResponse\x12x\n\x0fgetIdentityKeys\x12\x31.org.dash.platform.dapi.v0.GetIdentityKeysRequest\x1a\x32.org.dash.platform.dapi.v0.GetIdentityKeysResponse\x12\x96\x01\n\x19getIdentitiesContractKeys\x12;.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest\x1a<.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse\x12{\n\x10getIdentityNonce\x12\x32.org.dash.platform.dapi.v0.GetIdentityNonceRequest\x1a\x33.org.dash.platform.dapi.v0.GetIdentityNonceResponse\x12\x93\x01\n\x18getIdentityContractNonce\x12:.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest\x1a;.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse\x12\x81\x01\n\x12getIdentityBalance\x12\x34.org.dash.platform.dapi.v0.GetIdentityBalanceRequest\x1a\x35.org.dash.platform.dapi.v0.GetIdentityBalanceResponse\x12\x8a\x01\n\x15getIdentitiesBalances\x12\x37.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest\x1a\x38.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse\x12\xa2\x01\n\x1dgetIdentityBalanceAndRevision\x12?.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest\x1a@.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse\x12\xaf\x01\n#getEvonodesProposedEpochBlocksByIds\x12\x45.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest\x1a\x41.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse\x12\xb3\x01\n%getEvonodesProposedEpochBlocksByRange\x12G.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest\x1a\x41.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse\x12x\n\x0fgetDataContract\x12\x31.org.dash.platform.dapi.v0.GetDataContractRequest\x1a\x32.org.dash.platform.dapi.v0.GetDataContractResponse\x12\x8d\x01\n\x16getDataContractHistory\x12\x38.org.dash.platform.dapi.v0.GetDataContractHistoryRequest\x1a\x39.org.dash.platform.dapi.v0.GetDataContractHistoryResponse\x12{\n\x10getDataContracts\x12\x32.org.dash.platform.dapi.v0.GetDataContractsRequest\x1a\x33.org.dash.platform.dapi.v0.GetDataContractsResponse\x12o\n\x0cgetDocuments\x12..org.dash.platform.dapi.v0.GetDocumentsRequest\x1a/.org.dash.platform.dapi.v0.GetDocumentsResponse\x12~\n\x11getDocumentsCount\x12\x33.org.dash.platform.dapi.v0.GetDocumentsCountRequest\x1a\x34.org.dash.platform.dapi.v0.GetDocumentsCountResponse\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\x15getShieldedNullifiers\x12\x37.org.dash.platform.dapi.v0.GetShieldedNullifiersRequest\x1a\x38.org.dash.platform.dapi.v0.GetShieldedNullifiersResponse\x12\x90\x01\n\x17getNullifiersTrunkState\x12\x39.org.dash.platform.dapi.v0.GetNullifiersTrunkStateRequest\x1a:.org.dash.platform.dapi.v0.GetNullifiersTrunkStateResponse\x12\x93\x01\n\x18getNullifiersBranchState\x12:.org.dash.platform.dapi.v0.GetNullifiersBranchStateRequest\x1a;.org.dash.platform.dapi.v0.GetNullifiersBranchStateResponse\x12\x96\x01\n\x19getRecentNullifierChanges\x12;.org.dash.platform.dapi.v0.GetRecentNullifierChangesRequest\x1a<.org.dash.platform.dapi.v0.GetRecentNullifierChangesResponse\x12\xb1\x01\n\"getRecentCompactedNullifierChanges\x12\x44.org.dash.platform.dapi.v0.GetRecentCompactedNullifierChangesRequest\x1a\x45.org.dash.platform.dapi.v0.GetRecentCompactedNullifierChangesResponseb\x06proto3' + serialized_pb=b'\n\x0eplatform.proto\x12\x19org.dash.platform.dapi.v0\x1a\x1egoogle/protobuf/wrappers.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x81\x01\n\x05Proof\x12\x15\n\rgrovedb_proof\x18\x01 \x01(\x0c\x12\x13\n\x0bquorum_hash\x18\x02 \x01(\x0c\x12\x11\n\tsignature\x18\x03 \x01(\x0c\x12\r\n\x05round\x18\x04 \x01(\r\x12\x15\n\rblock_id_hash\x18\x05 \x01(\x0c\x12\x13\n\x0bquorum_type\x18\x06 \x01(\r\"\x98\x01\n\x10ResponseMetadata\x12\x12\n\x06height\x18\x01 \x01(\x04\x42\x02\x30\x01\x12 \n\x18\x63ore_chain_locked_height\x18\x02 \x01(\r\x12\r\n\x05\x65poch\x18\x03 \x01(\r\x12\x13\n\x07time_ms\x18\x04 \x01(\x04\x42\x02\x30\x01\x12\x18\n\x10protocol_version\x18\x05 \x01(\r\x12\x10\n\x08\x63hain_id\x18\x06 \x01(\t\"L\n\x1dStateTransitionBroadcastError\x12\x0c\n\x04\x63ode\x18\x01 \x01(\r\x12\x0f\n\x07message\x18\x02 \x01(\t\x12\x0c\n\x04\x64\x61ta\x18\x03 \x01(\x0c\";\n\x1f\x42roadcastStateTransitionRequest\x12\x18\n\x10state_transition\x18\x01 \x01(\x0c\"\"\n BroadcastStateTransitionResponse\"\xa4\x01\n\x12GetIdentityRequest\x12P\n\x02v0\x18\x01 \x01(\x0b\x32\x42.org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0H\x00\x1a\x31\n\x14GetIdentityRequestV0\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xc1\x01\n\x17GetIdentityNonceRequest\x12Z\n\x02v0\x18\x01 \x01(\x0b\x32L.org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0H\x00\x1a?\n\x19GetIdentityNonceRequestV0\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xf6\x01\n\x1fGetIdentityContractNonceRequest\x12j\n\x02v0\x18\x01 \x01(\x0b\x32\\.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0H\x00\x1a\\\n!GetIdentityContractNonceRequestV0\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12\x13\n\x0b\x63ontract_id\x18\x02 \x01(\x0c\x12\r\n\x05prove\x18\x03 \x01(\x08\x42\t\n\x07version\"\xc0\x01\n\x19GetIdentityBalanceRequest\x12^\n\x02v0\x18\x01 \x01(\x0b\x32P.org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0H\x00\x1a\x38\n\x1bGetIdentityBalanceRequestV0\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xec\x01\n$GetIdentityBalanceAndRevisionRequest\x12t\n\x02v0\x18\x01 \x01(\x0b\x32\x66.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0H\x00\x1a\x43\n&GetIdentityBalanceAndRevisionRequestV0\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\x9e\x02\n\x13GetIdentityResponse\x12R\n\x02v0\x18\x01 \x01(\x0b\x32\x44.org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0H\x00\x1a\xa7\x01\n\x15GetIdentityResponseV0\x12\x12\n\x08identity\x18\x01 \x01(\x0cH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"\xbc\x02\n\x18GetIdentityNonceResponse\x12\\\n\x02v0\x18\x01 \x01(\x0b\x32N.org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0H\x00\x1a\xb6\x01\n\x1aGetIdentityNonceResponseV0\x12\x1c\n\x0eidentity_nonce\x18\x01 \x01(\x04\x42\x02\x30\x01H\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"\xe5\x02\n GetIdentityContractNonceResponse\x12l\n\x02v0\x18\x01 \x01(\x0b\x32^.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0H\x00\x1a\xc7\x01\n\"GetIdentityContractNonceResponseV0\x12%\n\x17identity_contract_nonce\x18\x01 \x01(\x04\x42\x02\x30\x01H\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"\xbd\x02\n\x1aGetIdentityBalanceResponse\x12`\n\x02v0\x18\x01 \x01(\x0b\x32R.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0H\x00\x1a\xb1\x01\n\x1cGetIdentityBalanceResponseV0\x12\x15\n\x07\x62\x61lance\x18\x01 \x01(\x04\x42\x02\x30\x01H\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"\xb1\x04\n%GetIdentityBalanceAndRevisionResponse\x12v\n\x02v0\x18\x01 \x01(\x0b\x32h.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0H\x00\x1a\x84\x03\n\'GetIdentityBalanceAndRevisionResponseV0\x12\x9b\x01\n\x14\x62\x61lance_and_revision\x18\x01 \x01(\x0b\x32{.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevisionH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a?\n\x12\x42\x61lanceAndRevision\x12\x13\n\x07\x62\x61lance\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x14\n\x08revision\x18\x02 \x01(\x04\x42\x02\x30\x01\x42\x08\n\x06resultB\t\n\x07version\"\xd1\x01\n\x0eKeyRequestType\x12\x36\n\x08\x61ll_keys\x18\x01 \x01(\x0b\x32\".org.dash.platform.dapi.v0.AllKeysH\x00\x12@\n\rspecific_keys\x18\x02 \x01(\x0b\x32\'.org.dash.platform.dapi.v0.SpecificKeysH\x00\x12:\n\nsearch_key\x18\x03 \x01(\x0b\x32$.org.dash.platform.dapi.v0.SearchKeyH\x00\x42\t\n\x07request\"\t\n\x07\x41llKeys\"\x1f\n\x0cSpecificKeys\x12\x0f\n\x07key_ids\x18\x01 \x03(\r\"\xb6\x01\n\tSearchKey\x12I\n\x0bpurpose_map\x18\x01 \x03(\x0b\x32\x34.org.dash.platform.dapi.v0.SearchKey.PurposeMapEntry\x1a^\n\x0fPurposeMapEntry\x12\x0b\n\x03key\x18\x01 \x01(\r\x12:\n\x05value\x18\x02 \x01(\x0b\x32+.org.dash.platform.dapi.v0.SecurityLevelMap:\x02\x38\x01\"\xbf\x02\n\x10SecurityLevelMap\x12]\n\x12security_level_map\x18\x01 \x03(\x0b\x32\x41.org.dash.platform.dapi.v0.SecurityLevelMap.SecurityLevelMapEntry\x1aw\n\x15SecurityLevelMapEntry\x12\x0b\n\x03key\x18\x01 \x01(\r\x12M\n\x05value\x18\x02 \x01(\x0e\x32>.org.dash.platform.dapi.v0.SecurityLevelMap.KeyKindRequestType:\x02\x38\x01\"S\n\x12KeyKindRequestType\x12\x1f\n\x1b\x43URRENT_KEY_OF_KIND_REQUEST\x10\x00\x12\x1c\n\x18\x41LL_KEYS_OF_KIND_REQUEST\x10\x01\"\xda\x02\n\x16GetIdentityKeysRequest\x12X\n\x02v0\x18\x01 \x01(\x0b\x32J.org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0H\x00\x1a\xda\x01\n\x18GetIdentityKeysRequestV0\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12?\n\x0crequest_type\x18\x02 \x01(\x0b\x32).org.dash.platform.dapi.v0.KeyRequestType\x12+\n\x05limit\x18\x03 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12,\n\x06offset\x18\x04 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12\r\n\x05prove\x18\x05 \x01(\x08\x42\t\n\x07version\"\x99\x03\n\x17GetIdentityKeysResponse\x12Z\n\x02v0\x18\x01 \x01(\x0b\x32L.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0H\x00\x1a\x96\x02\n\x19GetIdentityKeysResponseV0\x12\x61\n\x04keys\x18\x01 \x01(\x0b\x32Q.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.KeysH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\x1a\n\x04Keys\x12\x12\n\nkeys_bytes\x18\x01 \x03(\x0c\x42\x08\n\x06resultB\t\n\x07version\"\xef\x02\n GetIdentitiesContractKeysRequest\x12l\n\x02v0\x18\x01 \x01(\x0b\x32^.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0H\x00\x1a\xd1\x01\n\"GetIdentitiesContractKeysRequestV0\x12\x16\n\x0eidentities_ids\x18\x01 \x03(\x0c\x12\x13\n\x0b\x63ontract_id\x18\x02 \x01(\x0c\x12\x1f\n\x12\x64ocument_type_name\x18\x03 \x01(\tH\x00\x88\x01\x01\x12\x37\n\x08purposes\x18\x04 \x03(\x0e\x32%.org.dash.platform.dapi.v0.KeyPurpose\x12\r\n\x05prove\x18\x05 \x01(\x08\x42\x15\n\x13_document_type_nameB\t\n\x07version\"\xdf\x06\n!GetIdentitiesContractKeysResponse\x12n\n\x02v0\x18\x01 \x01(\x0b\x32`.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0H\x00\x1a\xbe\x05\n#GetIdentitiesContractKeysResponseV0\x12\x8a\x01\n\x0fidentities_keys\x18\x01 \x01(\x0b\x32o.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeysH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1aY\n\x0bPurposeKeys\x12\x36\n\x07purpose\x18\x01 \x01(\x0e\x32%.org.dash.platform.dapi.v0.KeyPurpose\x12\x12\n\nkeys_bytes\x18\x02 \x03(\x0c\x1a\x9f\x01\n\x0cIdentityKeys\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12z\n\x04keys\x18\x02 \x03(\x0b\x32l.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys\x1a\x90\x01\n\x0eIdentitiesKeys\x12~\n\x07\x65ntries\x18\x01 \x03(\x0b\x32m.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeysB\x08\n\x06resultB\t\n\x07version\"\xa4\x02\n*GetEvonodesProposedEpochBlocksByIdsRequest\x12\x80\x01\n\x02v0\x18\x01 \x01(\x0b\x32r.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0H\x00\x1ah\n,GetEvonodesProposedEpochBlocksByIdsRequestV0\x12\x12\n\x05\x65poch\x18\x01 \x01(\rH\x00\x88\x01\x01\x12\x0b\n\x03ids\x18\x02 \x03(\x0c\x12\r\n\x05prove\x18\x03 \x01(\x08\x42\x08\n\x06_epochB\t\n\x07version\"\x92\x06\n&GetEvonodesProposedEpochBlocksResponse\x12x\n\x02v0\x18\x01 \x01(\x0b\x32j.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0H\x00\x1a\xe2\x04\n(GetEvonodesProposedEpochBlocksResponseV0\x12\xb1\x01\n#evonodes_proposed_block_counts_info\x18\x01 \x01(\x0b\x32\x81\x01.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocksH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a?\n\x15\x45vonodeProposedBlocks\x12\x13\n\x0bpro_tx_hash\x18\x01 \x01(\x0c\x12\x11\n\x05\x63ount\x18\x02 \x01(\x04\x42\x02\x30\x01\x1a\xc4\x01\n\x16\x45vonodesProposedBlocks\x12\xa9\x01\n\x1e\x65vonodes_proposed_block_counts\x18\x01 \x03(\x0b\x32\x80\x01.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocksB\x08\n\x06resultB\t\n\x07version\"\xf2\x02\n,GetEvonodesProposedEpochBlocksByRangeRequest\x12\x84\x01\n\x02v0\x18\x01 \x01(\x0b\x32v.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0H\x00\x1a\xaf\x01\n.GetEvonodesProposedEpochBlocksByRangeRequestV0\x12\x12\n\x05\x65poch\x18\x01 \x01(\rH\x01\x88\x01\x01\x12\x12\n\x05limit\x18\x02 \x01(\rH\x02\x88\x01\x01\x12\x15\n\x0bstart_after\x18\x03 \x01(\x0cH\x00\x12\x12\n\x08start_at\x18\x04 \x01(\x0cH\x00\x12\r\n\x05prove\x18\x05 \x01(\x08\x42\x07\n\x05startB\x08\n\x06_epochB\x08\n\x06_limitB\t\n\x07version\"\xcd\x01\n\x1cGetIdentitiesBalancesRequest\x12\x64\n\x02v0\x18\x01 \x01(\x0b\x32V.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0H\x00\x1a<\n\x1eGetIdentitiesBalancesRequestV0\x12\x0b\n\x03ids\x18\x01 \x03(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\x9f\x05\n\x1dGetIdentitiesBalancesResponse\x12\x66\n\x02v0\x18\x01 \x01(\x0b\x32X.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0H\x00\x1a\x8a\x04\n\x1fGetIdentitiesBalancesResponseV0\x12\x8a\x01\n\x13identities_balances\x18\x01 \x01(\x0b\x32k.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalancesH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1aL\n\x0fIdentityBalance\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12\x18\n\x07\x62\x61lance\x18\x02 \x01(\x04\x42\x02\x30\x01H\x00\x88\x01\x01\x42\n\n\x08_balance\x1a\x8f\x01\n\x12IdentitiesBalances\x12y\n\x07\x65ntries\x18\x01 \x03(\x0b\x32h.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalanceB\x08\n\x06resultB\t\n\x07version\"\xb4\x01\n\x16GetDataContractRequest\x12X\n\x02v0\x18\x01 \x01(\x0b\x32J.org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0H\x00\x1a\x35\n\x18GetDataContractRequestV0\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xb3\x02\n\x17GetDataContractResponse\x12Z\n\x02v0\x18\x01 \x01(\x0b\x32L.org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0H\x00\x1a\xb0\x01\n\x19GetDataContractResponseV0\x12\x17\n\rdata_contract\x18\x01 \x01(\x0cH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"\xb9\x01\n\x17GetDataContractsRequest\x12Z\n\x02v0\x18\x01 \x01(\x0b\x32L.org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0H\x00\x1a\x37\n\x19GetDataContractsRequestV0\x12\x0b\n\x03ids\x18\x01 \x03(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xcf\x04\n\x18GetDataContractsResponse\x12\\\n\x02v0\x18\x01 \x01(\x0b\x32N.org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0H\x00\x1a[\n\x11\x44\x61taContractEntry\x12\x12\n\nidentifier\x18\x01 \x01(\x0c\x12\x32\n\rdata_contract\x18\x02 \x01(\x0b\x32\x1b.google.protobuf.BytesValue\x1au\n\rDataContracts\x12\x64\n\x15\x64\x61ta_contract_entries\x18\x01 \x03(\x0b\x32\x45.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry\x1a\xf5\x01\n\x1aGetDataContractsResponseV0\x12[\n\x0e\x64\x61ta_contracts\x18\x01 \x01(\x0b\x32\x41.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractsH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"\xc5\x02\n\x1dGetDataContractHistoryRequest\x12\x66\n\x02v0\x18\x01 \x01(\x0b\x32X.org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0H\x00\x1a\xb0\x01\n\x1fGetDataContractHistoryRequestV0\x12\n\n\x02id\x18\x01 \x01(\x0c\x12+\n\x05limit\x18\x02 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12,\n\x06offset\x18\x03 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12\x17\n\x0bstart_at_ms\x18\x04 \x01(\x04\x42\x02\x30\x01\x12\r\n\x05prove\x18\x05 \x01(\x08\x42\t\n\x07version\"\xb2\x05\n\x1eGetDataContractHistoryResponse\x12h\n\x02v0\x18\x01 \x01(\x0b\x32Z.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0H\x00\x1a\x9a\x04\n GetDataContractHistoryResponseV0\x12\x8f\x01\n\x15\x64\x61ta_contract_history\x18\x01 \x01(\x0b\x32n.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a;\n\x18\x44\x61taContractHistoryEntry\x12\x10\n\x04\x64\x61te\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\r\n\x05value\x18\x02 \x01(\x0c\x1a\xaa\x01\n\x13\x44\x61taContractHistory\x12\x92\x01\n\x15\x64\x61ta_contract_entries\x18\x01 \x03(\x0b\x32s.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntryB\x08\n\x06resultB\t\n\x07version\"\xf6\x05\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\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\xed\x02\n\x15GetDocumentsRequestV1\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\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\x06select\x18\t \x01(\x0e\x32K.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.Select\x12\x10\n\x08group_by\x18\n \x03(\t\x12\x0e\n\x06having\x18\x0b \x01(\x0c\"\"\n\x06Select\x12\r\n\tDOCUMENTS\x10\x00\x12\t\n\x05\x43OUNT\x10\x01\x42\x07\n\x05startB\x08\n\x06_limitB\t\n\x07version\"\xd2\n\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\xe4\x06\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\x1a\xe5\x01\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\x42\t\n\x07variantB\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\"\xac\x05\n!GetShieldedEncryptedNotesResponse\x12n\n\x02v0\x18\x01 \x01(\x0b\x32`.org.dash.platform.dapi.v0.GetShieldedEncryptedNotesResponse.GetShieldedEncryptedNotesResponseV0H\x00\x1a\x8b\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\x1aG\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\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\"\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\"\xe5\x01\n\x1eGetNullifiersTrunkStateRequest\x12h\n\x02v0\x18\x01 \x01(\x0b\x32Z.org.dash.platform.dapi.v0.GetNullifiersTrunkStateRequest.GetNullifiersTrunkStateRequestV0H\x00\x1aN\n GetNullifiersTrunkStateRequestV0\x12\x11\n\tpool_type\x18\x01 \x01(\r\x12\x17\n\x0fpool_identifier\x18\x02 \x01(\x0c\x42\t\n\x07version\"\xae\x02\n\x1fGetNullifiersTrunkStateResponse\x12j\n\x02v0\x18\x01 \x01(\x0b\x32\\.org.dash.platform.dapi.v0.GetNullifiersTrunkStateResponse.GetNullifiersTrunkStateResponseV0H\x00\x1a\x93\x01\n!GetNullifiersTrunkStateResponseV0\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\"\xa1\x02\n\x1fGetNullifiersBranchStateRequest\x12j\n\x02v0\x18\x01 \x01(\x0b\x32\\.org.dash.platform.dapi.v0.GetNullifiersBranchStateRequest.GetNullifiersBranchStateRequestV0H\x00\x1a\x86\x01\n!GetNullifiersBranchStateRequestV0\x12\x11\n\tpool_type\x18\x01 \x01(\r\x12\x17\n\x0fpool_identifier\x18\x02 \x01(\x0c\x12\x0b\n\x03key\x18\x03 \x01(\x0c\x12\r\n\x05\x64\x65pth\x18\x04 \x01(\r\x12\x19\n\x11\x63heckpoint_height\x18\x05 \x01(\x04\x42\t\n\x07version\"\xd5\x01\n GetNullifiersBranchStateResponse\x12l\n\x02v0\x18\x01 \x01(\x0b\x32^.org.dash.platform.dapi.v0.GetNullifiersBranchStateResponse.GetNullifiersBranchStateResponseV0H\x00\x1a\x38\n\"GetNullifiersBranchStateResponseV0\x12\x12\n\nmerk_proof\x18\x02 \x01(\x0c\x42\t\n\x07version\"E\n\x15\x42lockNullifierChanges\x12\x18\n\x0c\x62lock_height\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x12\n\nnullifiers\x18\x02 \x03(\x0c\"a\n\x16NullifierUpdateEntries\x12G\n\rblock_changes\x18\x01 \x03(\x0b\x32\x30.org.dash.platform.dapi.v0.BlockNullifierChanges\"\xea\x01\n GetRecentNullifierChangesRequest\x12l\n\x02v0\x18\x01 \x01(\x0b\x32^.org.dash.platform.dapi.v0.GetRecentNullifierChangesRequest.GetRecentNullifierChangesRequestV0H\x00\x1aM\n\"GetRecentNullifierChangesRequestV0\x12\x18\n\x0cstart_height\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\x99\x03\n!GetRecentNullifierChangesResponse\x12n\n\x02v0\x18\x01 \x01(\x0b\x32`.org.dash.platform.dapi.v0.GetRecentNullifierChangesResponse.GetRecentNullifierChangesResponseV0H\x00\x1a\xf8\x01\n#GetRecentNullifierChangesResponseV0\x12U\n\x18nullifier_update_entries\x18\x01 \x01(\x0b\x32\x31.org.dash.platform.dapi.v0.NullifierUpdateEntriesH\x00\x12\x31\n\x05proof\x18\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\x1e\x43ompactedBlockNullifierChanges\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\x12\x12\n\nnullifiers\x18\x03 \x03(\x0c\"}\n\x1f\x43ompactedNullifierUpdateEntries\x12Z\n\x17\x63ompacted_block_changes\x18\x01 \x03(\x0b\x32\x39.org.dash.platform.dapi.v0.CompactedBlockNullifierChanges\"\x94\x02\n)GetRecentCompactedNullifierChangesRequest\x12~\n\x02v0\x18\x01 \x01(\x0b\x32p.org.dash.platform.dapi.v0.GetRecentCompactedNullifierChangesRequest.GetRecentCompactedNullifierChangesRequestV0H\x00\x1a\\\n+GetRecentCompactedNullifierChangesRequestV0\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\"\xd1\x03\n*GetRecentCompactedNullifierChangesResponse\x12\x80\x01\n\x02v0\x18\x01 \x01(\x0b\x32r.org.dash.platform.dapi.v0.GetRecentCompactedNullifierChangesResponse.GetRecentCompactedNullifierChangesResponseV0H\x00\x1a\x94\x02\n,GetRecentCompactedNullifierChangesResponseV0\x12h\n\"compacted_nullifier_update_entries\x18\x01 \x01(\x0b\x32:.org.dash.platform.dapi.v0.CompactedNullifierUpdateEntriesH\x00\x12\x31\n\x05proof\x18\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*Z\n\nKeyPurpose\x12\x12\n\x0e\x41UTHENTICATION\x10\x00\x12\x0e\n\nENCRYPTION\x10\x01\x12\x0e\n\nDECRYPTION\x10\x02\x12\x0c\n\x08TRANSFER\x10\x03\x12\n\n\x06VOTING\x10\x05\x32\xb3G\n\x08Platform\x12\x93\x01\n\x18\x62roadcastStateTransition\x12:.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest\x1a;.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse\x12l\n\x0bgetIdentity\x12-.org.dash.platform.dapi.v0.GetIdentityRequest\x1a..org.dash.platform.dapi.v0.GetIdentityResponse\x12x\n\x0fgetIdentityKeys\x12\x31.org.dash.platform.dapi.v0.GetIdentityKeysRequest\x1a\x32.org.dash.platform.dapi.v0.GetIdentityKeysResponse\x12\x96\x01\n\x19getIdentitiesContractKeys\x12;.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest\x1a<.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse\x12{\n\x10getIdentityNonce\x12\x32.org.dash.platform.dapi.v0.GetIdentityNonceRequest\x1a\x33.org.dash.platform.dapi.v0.GetIdentityNonceResponse\x12\x93\x01\n\x18getIdentityContractNonce\x12:.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest\x1a;.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse\x12\x81\x01\n\x12getIdentityBalance\x12\x34.org.dash.platform.dapi.v0.GetIdentityBalanceRequest\x1a\x35.org.dash.platform.dapi.v0.GetIdentityBalanceResponse\x12\x8a\x01\n\x15getIdentitiesBalances\x12\x37.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest\x1a\x38.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse\x12\xa2\x01\n\x1dgetIdentityBalanceAndRevision\x12?.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest\x1a@.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse\x12\xaf\x01\n#getEvonodesProposedEpochBlocksByIds\x12\x45.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest\x1a\x41.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse\x12\xb3\x01\n%getEvonodesProposedEpochBlocksByRange\x12G.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest\x1a\x41.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse\x12x\n\x0fgetDataContract\x12\x31.org.dash.platform.dapi.v0.GetDataContractRequest\x1a\x32.org.dash.platform.dapi.v0.GetDataContractResponse\x12\x8d\x01\n\x16getDataContractHistory\x12\x38.org.dash.platform.dapi.v0.GetDataContractHistoryRequest\x1a\x39.org.dash.platform.dapi.v0.GetDataContractHistoryResponse\x12{\n\x10getDataContracts\x12\x32.org.dash.platform.dapi.v0.GetDataContractsRequest\x1a\x33.org.dash.platform.dapi.v0.GetDataContractsResponse\x12o\n\x0cgetDocuments\x12..org.dash.platform.dapi.v0.GetDocumentsRequest\x1a/.org.dash.platform.dapi.v0.GetDocumentsResponse\x12\x99\x01\n\x1agetIdentityByPublicKeyHash\x12<.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest\x1a=.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse\x12\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\x15getShieldedNullifiers\x12\x37.org.dash.platform.dapi.v0.GetShieldedNullifiersRequest\x1a\x38.org.dash.platform.dapi.v0.GetShieldedNullifiersResponse\x12\x90\x01\n\x17getNullifiersTrunkState\x12\x39.org.dash.platform.dapi.v0.GetNullifiersTrunkStateRequest\x1a:.org.dash.platform.dapi.v0.GetNullifiersTrunkStateResponse\x12\x93\x01\n\x18getNullifiersBranchState\x12:.org.dash.platform.dapi.v0.GetNullifiersBranchStateRequest\x1a;.org.dash.platform.dapi.v0.GetNullifiersBranchStateResponse\x12\x96\x01\n\x19getRecentNullifierChanges\x12;.org.dash.platform.dapi.v0.GetRecentNullifierChangesRequest\x1a<.org.dash.platform.dapi.v0.GetRecentNullifierChangesResponse\x12\xb1\x01\n\"getRecentCompactedNullifierChanges\x12\x44.org.dash.platform.dapi.v0.GetRecentCompactedNullifierChangesRequest\x1a\x45.org.dash.platform.dapi.v0.GetRecentCompactedNullifierChangesResponseb\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=63326, - serialized_end=63416, + serialized_start=63619, + serialized_end=63709, ) _sym_db.RegisterEnumDescriptor(_KEYPURPOSE) @@ -100,6 +100,31 @@ ) _sym_db.RegisterEnumDescriptor(_SECURITYLEVELMAP_KEYKINDREQUESTTYPE) +_GETDOCUMENTSREQUEST_GETDOCUMENTSREQUESTV1_SELECT = _descriptor.EnumDescriptor( + name='Select', + full_name='org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.Select', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='DOCUMENTS', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='COUNT', index=1, number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=11590, + serialized_end=11624, +) +_sym_db.RegisterEnumDescriptor(_GETDOCUMENTSREQUEST_GETDOCUMENTSREQUESTV1_SELECT) + _GETCONTESTEDRESOURCEVOTESTATEREQUEST_GETCONTESTEDRESOURCEVOTESTATEREQUESTV0_RESULTTYPE = _descriptor.EnumDescriptor( name='ResultType', full_name='org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.ResultType', @@ -125,8 +150,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=23735, - serialized_end=23808, + serialized_start=24028, + serialized_end=24101, ) _sym_db.RegisterEnumDescriptor(_GETCONTESTEDRESOURCEVOTESTATEREQUEST_GETCONTESTEDRESOURCEVOTESTATEREQUESTV0_RESULTTYPE) @@ -155,8 +180,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=24730, - serialized_end=24809, + serialized_start=25023, + serialized_end=25102, ) _sym_db.RegisterEnumDescriptor(_GETCONTESTEDRESOURCEVOTESTATERESPONSE_GETCONTESTEDRESOURCEVOTESTATERESPONSEV0_FINISHEDVOTEINFO_FINISHEDVOTEOUTCOME) @@ -185,8 +210,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=28438, - serialized_end=28499, + serialized_start=28731, + serialized_end=28792, ) _sym_db.RegisterEnumDescriptor(_GETCONTESTEDRESOURCEIDENTITYVOTESRESPONSE_GETCONTESTEDRESOURCEIDENTITYVOTESRESPONSEV0_RESOURCEVOTECHOICE_VOTECHOICETYPE) @@ -210,8 +235,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=47063, - serialized_end=47101, + serialized_start=47356, + serialized_end=47394, ) _sym_db.RegisterEnumDescriptor(_GETGROUPACTIONSREQUEST_ACTIONSTATUS) @@ -235,8 +260,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=48348, - serialized_end=48383, + serialized_start=48641, + serialized_end=48676, ) _sym_db.RegisterEnumDescriptor(_GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_EMERGENCYACTIONEVENT_ACTIONTYPE) @@ -260,8 +285,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=47063, - serialized_end=47101, + serialized_start=47356, + serialized_end=47394, ) _sym_db.RegisterEnumDescriptor(_GETGROUPACTIONSIGNERSREQUEST_ACTIONSTATUS) @@ -3432,8 +3457,120 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=11004, - serialized_end=11191, + serialized_start=11088, + serialized_end=11275, +) + +_GETDOCUMENTSREQUEST_GETDOCUMENTSREQUESTV1 = _descriptor.Descriptor( + name='GetDocumentsRequestV1', + full_name='org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='data_contract_id', full_name='org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.data_contract_id', index=0, + number=1, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=b"", + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='document_type', full_name='org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.document_type', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='where', full_name='org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.where', 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='order_by', full_name='org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.order_by', index=3, + number=4, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=b"", + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='limit', full_name='org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.limit', index=4, + number=5, type=13, cpp_type=3, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='start_after', full_name='org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.start_after', index=5, + number=6, 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='start_at', full_name='org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.start_at', index=6, + number=7, 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='prove', full_name='org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prove', index=7, + number=8, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='select', full_name='org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.select', index=8, + number=9, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='group_by', full_name='org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.group_by', index=9, + number=10, type=9, cpp_type=9, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='having', full_name='org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.having', index=10, + number=11, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=b"", + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + _GETDOCUMENTSREQUEST_GETDOCUMENTSREQUESTV1_SELECT, + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name='start', full_name='org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.start', + index=0, containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[]), + _descriptor.OneofDescriptor( + name='_limit', full_name='org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1._limit', + index=1, containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[]), + ], + serialized_start=11278, + serialized_end=11643, ) _GETDOCUMENTSREQUEST = _descriptor.Descriptor( @@ -3451,10 +3588,17 @@ 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='v1', full_name='org.dash.platform.dapi.v0.GetDocumentsRequest.v1', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], - nested_types=[_GETDOCUMENTSREQUEST_GETDOCUMENTSREQUESTV0, ], + nested_types=[_GETDOCUMENTSREQUEST_GETDOCUMENTSREQUESTV0, _GETDOCUMENTSREQUEST_GETDOCUMENTSREQUESTV1, ], enum_types=[ ], serialized_options=None, @@ -3469,7 +3613,7 @@ fields=[]), ], serialized_start=10896, - serialized_end=11202, + serialized_end=11654, ) @@ -3500,8 +3644,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=11559, - serialized_end=11589, + serialized_start=12097, + serialized_end=12127, ) _GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV0 = _descriptor.Descriptor( @@ -3550,29 +3694,29 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=11316, - serialized_end=11599, + serialized_start=11854, + serialized_end=12137, ) -_GETDOCUMENTSRESPONSE = _descriptor.Descriptor( - name='GetDocumentsResponse', - full_name='org.dash.platform.dapi.v0.GetDocumentsResponse', +_GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1_DOCUMENTS = _descriptor.Descriptor( + name='Documents', + full_name='org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents', 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.GetDocumentsResponse.v0', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, + name='documents', full_name='org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents.documents', 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=[_GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV0, ], + nested_types=[], enum_types=[ ], serialized_options=None, @@ -3580,74 +3724,40 @@ syntax='proto3', extension_ranges=[], oneofs=[ - _descriptor.OneofDescriptor( - name='version', full_name='org.dash.platform.dapi.v0.GetDocumentsResponse.version', - index=0, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), ], - serialized_start=11205, - serialized_end=11610, + serialized_start=12097, + serialized_end=12127, ) - -_GETDOCUMENTSCOUNTREQUEST_GETDOCUMENTSCOUNTREQUESTV0 = _descriptor.Descriptor( - name='GetDocumentsCountRequestV0', - full_name='org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0', +_GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1_COUNTENTRY = _descriptor.Descriptor( + name='CountEntry', + full_name='org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( - name='data_contract_id', full_name='org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.data_contract_id', index=0, + name='in_key', full_name='org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry.in_key', index=0, number=1, type=12, cpp_type=9, label=1, has_default_value=False, default_value=b"", message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='document_type', full_name='org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.document_type', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='where', full_name='org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.where', 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='return_distinct_counts_in_range', full_name='org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.return_distinct_counts_in_range', index=3, - number=4, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='order_by', full_name='org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.order_by', index=4, - number=5, type=12, cpp_type=9, label=1, + name='key', full_name='org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry.key', 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='limit', full_name='org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.limit', index=5, - number=6, type=13, cpp_type=3, label=1, + name='count', full_name='org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry.count', index=2, + number=3, 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='prove', full_name='org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.prove', index=6, - number=7, 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), + serialized_options=b'0\001', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -3660,34 +3770,34 @@ extension_ranges=[], oneofs=[ _descriptor.OneofDescriptor( - name='_limit', full_name='org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0._limit', + name='_in_key', full_name='org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry._in_key', index=0, containing_type=None, create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=11736, - serialized_end=11932, + serialized_start=12411, + serialized_end=12487, ) -_GETDOCUMENTSCOUNTREQUEST = _descriptor.Descriptor( - name='GetDocumentsCountRequest', - full_name='org.dash.platform.dapi.v0.GetDocumentsCountRequest', +_GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1_COUNTENTRIES = _descriptor.Descriptor( + name='CountEntries', + full_name='org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries', 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.GetDocumentsCountRequest.v0', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, + name='entries', full_name='org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries.entries', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], - nested_types=[_GETDOCUMENTSCOUNTREQUEST_GETDOCUMENTSCOUNTREQUESTV0, ], + nested_types=[], enum_types=[ ], serialized_options=None, @@ -3695,46 +3805,33 @@ syntax='proto3', extension_ranges=[], oneofs=[ - _descriptor.OneofDescriptor( - name='version', full_name='org.dash.platform.dapi.v0.GetDocumentsCountRequest.version', - index=0, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), ], - serialized_start=11613, - serialized_end=11943, + serialized_start=12489, + serialized_end=12603, ) - -_GETDOCUMENTSCOUNTRESPONSE_GETDOCUMENTSCOUNTRESPONSEV0_COUNTENTRY = _descriptor.Descriptor( - name='CountEntry', - full_name='org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry', +_GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1_COUNTRESULTS = _descriptor.Descriptor( + name='CountResults', + full_name='org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( - name='in_key', full_name='org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry.in_key', index=0, - number=1, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=b"", + name='aggregate_count', full_name='org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.aggregate_count', index=0, + number=1, type=4, cpp_type=4, label=1, + has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=b'0\001', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='key', full_name='org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry.key', index=1, - number=2, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=b"", + name='entries', full_name='org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.entries', 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='count', full_name='org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry.count', index=2, - number=3, type=4, cpp_type=4, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=b'0\001', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -3747,63 +3844,32 @@ extension_ranges=[], oneofs=[ _descriptor.OneofDescriptor( - name='_in_key', full_name='org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry._in_key', + name='variant', full_name='org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.variant', index=0, containing_type=None, create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=12330, - serialized_end=12406, + serialized_start=12606, + serialized_end=12766, ) -_GETDOCUMENTSCOUNTRESPONSE_GETDOCUMENTSCOUNTRESPONSEV0_COUNTENTRIES = _descriptor.Descriptor( - name='CountEntries', - full_name='org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries', +_GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1_RESULTDATA = _descriptor.Descriptor( + name='ResultData', + full_name='org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( - name='entries', full_name='org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries.entries', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], + name='documents', full_name='org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.documents', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=12408, - serialized_end=12532, -) - -_GETDOCUMENTSCOUNTRESPONSE_GETDOCUMENTSCOUNTRESPONSEV0_COUNTRESULTS = _descriptor.Descriptor( - name='CountResults', - full_name='org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ _descriptor.FieldDescriptor( - name='aggregate_count', full_name='org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.aggregate_count', index=0, - number=1, type=4, cpp_type=4, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=b'0\001', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='entries', full_name='org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.entries', index=1, + name='counts', full_name='org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.counts', 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, @@ -3821,39 +3887,39 @@ extension_ranges=[], oneofs=[ _descriptor.OneofDescriptor( - name='variant', full_name='org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.variant', + name='variant', full_name='org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.variant', index=0, containing_type=None, create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=12535, - serialized_end=12705, + serialized_start=12769, + serialized_end=12998, ) -_GETDOCUMENTSCOUNTRESPONSE_GETDOCUMENTSCOUNTRESPONSEV0 = _descriptor.Descriptor( - name='GetDocumentsCountResponseV0', - full_name='org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0', +_GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1 = _descriptor.Descriptor( + name='GetDocumentsResponseV1', + full_name='org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( - name='counts', full_name='org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.counts', index=0, + name='data', full_name='org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.data', 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.GetDocumentsCountResponse.GetDocumentsCountResponseV0.proof', index=1, + name='proof', full_name='org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.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.GetDocumentsCountResponse.GetDocumentsCountResponseV0.metadata', index=2, + name='metadata', full_name='org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.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, @@ -3862,7 +3928,7 @@ ], extensions=[ ], - nested_types=[_GETDOCUMENTSCOUNTRESPONSE_GETDOCUMENTSCOUNTRESPONSEV0_COUNTENTRY, _GETDOCUMENTSCOUNTRESPONSE_GETDOCUMENTSCOUNTRESPONSEV0_COUNTENTRIES, _GETDOCUMENTSCOUNTRESPONSE_GETDOCUMENTSCOUNTRESPONSEV0_COUNTRESULTS, ], + nested_types=[_GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1_DOCUMENTS, _GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1_COUNTENTRY, _GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1_COUNTENTRIES, _GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1_COUNTRESULTS, _GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1_RESULTDATA, ], enum_types=[ ], serialized_options=None, @@ -3871,34 +3937,41 @@ extension_ranges=[], oneofs=[ _descriptor.OneofDescriptor( - name='result', full_name='org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.result', + name='result', full_name='org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.result', index=0, containing_type=None, create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=12072, - serialized_end=12715, + serialized_start=12140, + serialized_end=13008, ) -_GETDOCUMENTSCOUNTRESPONSE = _descriptor.Descriptor( - name='GetDocumentsCountResponse', - full_name='org.dash.platform.dapi.v0.GetDocumentsCountResponse', +_GETDOCUMENTSRESPONSE = _descriptor.Descriptor( + name='GetDocumentsResponse', + full_name='org.dash.platform.dapi.v0.GetDocumentsResponse', 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.GetDocumentsCountResponse.v0', index=0, + name='v0', full_name='org.dash.platform.dapi.v0.GetDocumentsResponse.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), + _descriptor.FieldDescriptor( + name='v1', full_name='org.dash.platform.dapi.v0.GetDocumentsResponse.v1', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], - nested_types=[_GETDOCUMENTSCOUNTRESPONSE_GETDOCUMENTSCOUNTRESPONSEV0, ], + nested_types=[_GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV0, _GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1, ], enum_types=[ ], serialized_options=None, @@ -3907,13 +3980,13 @@ extension_ranges=[], oneofs=[ _descriptor.OneofDescriptor( - name='version', full_name='org.dash.platform.dapi.v0.GetDocumentsCountResponse.version', + name='version', full_name='org.dash.platform.dapi.v0.GetDocumentsResponse.version', index=0, containing_type=None, create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=11946, - serialized_end=12726, + serialized_start=11657, + serialized_end=13019, ) @@ -3951,8 +4024,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=12878, - serialized_end=12955, + serialized_start=13171, + serialized_end=13248, ) _GETIDENTITYBYPUBLICKEYHASHREQUEST = _descriptor.Descriptor( @@ -3987,8 +4060,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=12729, - serialized_end=12966, + serialized_start=13022, + serialized_end=13259, ) @@ -4038,8 +4111,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=13122, - serialized_end=13304, + serialized_start=13415, + serialized_end=13597, ) _GETIDENTITYBYPUBLICKEYHASHRESPONSE = _descriptor.Descriptor( @@ -4074,8 +4147,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=12969, - serialized_end=13315, + serialized_start=13262, + serialized_end=13608, ) @@ -4125,8 +4198,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=13496, - serialized_end=13624, + serialized_start=13789, + serialized_end=13917, ) _GETIDENTITYBYNONUNIQUEPUBLICKEYHASHREQUEST = _descriptor.Descriptor( @@ -4161,8 +4234,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=13318, - serialized_end=13635, + serialized_start=13611, + serialized_end=13928, ) @@ -4198,8 +4271,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=14248, - serialized_end=14302, + serialized_start=14541, + serialized_end=14595, ) _GETIDENTITYBYNONUNIQUEPUBLICKEYHASHRESPONSE_GETIDENTITYBYNONUNIQUEPUBLICKEYHASHRESPONSEV0_IDENTITYPROVEDRESPONSE = _descriptor.Descriptor( @@ -4241,8 +4314,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=14305, - serialized_end=14471, + serialized_start=14598, + serialized_end=14764, ) _GETIDENTITYBYNONUNIQUEPUBLICKEYHASHRESPONSE_GETIDENTITYBYNONUNIQUEPUBLICKEYHASHRESPONSEV0 = _descriptor.Descriptor( @@ -4291,8 +4364,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=13819, - serialized_end=14481, + serialized_start=14112, + serialized_end=14774, ) _GETIDENTITYBYNONUNIQUEPUBLICKEYHASHRESPONSE = _descriptor.Descriptor( @@ -4327,8 +4400,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=13638, - serialized_end=14492, + serialized_start=13931, + serialized_end=14785, ) @@ -4366,8 +4439,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=14650, - serialized_end=14735, + serialized_start=14943, + serialized_end=15028, ) _WAITFORSTATETRANSITIONRESULTREQUEST = _descriptor.Descriptor( @@ -4402,8 +4475,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=14495, - serialized_end=14746, + serialized_start=14788, + serialized_end=15039, ) @@ -4453,8 +4526,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=14908, - serialized_end=15147, + serialized_start=15201, + serialized_end=15440, ) _WAITFORSTATETRANSITIONRESULTRESPONSE = _descriptor.Descriptor( @@ -4489,8 +4562,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=14749, - serialized_end=15158, + serialized_start=15042, + serialized_end=15451, ) @@ -4528,8 +4601,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=15286, - serialized_end=15346, + serialized_start=15579, + serialized_end=15639, ) _GETCONSENSUSPARAMSREQUEST = _descriptor.Descriptor( @@ -4564,8 +4637,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=15161, - serialized_end=15357, + serialized_start=15454, + serialized_end=15650, ) @@ -4610,8 +4683,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=15488, - serialized_end=15568, + serialized_start=15781, + serialized_end=15861, ) _GETCONSENSUSPARAMSRESPONSE_CONSENSUSPARAMSEVIDENCE = _descriptor.Descriptor( @@ -4655,8 +4728,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=15570, - serialized_end=15668, + serialized_start=15863, + serialized_end=15961, ) _GETCONSENSUSPARAMSRESPONSE_GETCONSENSUSPARAMSRESPONSEV0 = _descriptor.Descriptor( @@ -4693,8 +4766,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=15671, - serialized_end=15889, + serialized_start=15964, + serialized_end=16182, ) _GETCONSENSUSPARAMSRESPONSE = _descriptor.Descriptor( @@ -4729,8 +4802,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=15360, - serialized_end=15900, + serialized_start=15653, + serialized_end=16193, ) @@ -4761,8 +4834,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=16064, - serialized_end=16120, + serialized_start=16357, + serialized_end=16413, ) _GETPROTOCOLVERSIONUPGRADESTATEREQUEST = _descriptor.Descriptor( @@ -4797,8 +4870,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=15903, - serialized_end=16131, + serialized_start=16196, + serialized_end=16424, ) @@ -4829,8 +4902,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=16596, - serialized_end=16746, + serialized_start=16889, + serialized_end=17039, ) _GETPROTOCOLVERSIONUPGRADESTATERESPONSE_GETPROTOCOLVERSIONUPGRADESTATERESPONSEV0_VERSIONENTRY = _descriptor.Descriptor( @@ -4867,8 +4940,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=16748, - serialized_end=16806, + serialized_start=17041, + serialized_end=17099, ) _GETPROTOCOLVERSIONUPGRADESTATERESPONSE_GETPROTOCOLVERSIONUPGRADESTATERESPONSEV0 = _descriptor.Descriptor( @@ -4917,8 +4990,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=16299, - serialized_end=16816, + serialized_start=16592, + serialized_end=17109, ) _GETPROTOCOLVERSIONUPGRADESTATERESPONSE = _descriptor.Descriptor( @@ -4953,8 +5026,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=16134, - serialized_end=16827, + serialized_start=16427, + serialized_end=17120, ) @@ -4999,8 +5072,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=17007, - serialized_end=17110, + serialized_start=17300, + serialized_end=17403, ) _GETPROTOCOLVERSIONUPGRADEVOTESTATUSREQUEST = _descriptor.Descriptor( @@ -5035,8 +5108,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=16830, - serialized_end=17121, + serialized_start=17123, + serialized_end=17414, ) @@ -5067,8 +5140,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=17624, - serialized_end=17799, + serialized_start=17917, + serialized_end=18092, ) _GETPROTOCOLVERSIONUPGRADEVOTESTATUSRESPONSE_GETPROTOCOLVERSIONUPGRADEVOTESTATUSRESPONSEV0_VERSIONSIGNAL = _descriptor.Descriptor( @@ -5105,8 +5178,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=17801, - serialized_end=17854, + serialized_start=18094, + serialized_end=18147, ) _GETPROTOCOLVERSIONUPGRADEVOTESTATUSRESPONSE_GETPROTOCOLVERSIONUPGRADEVOTESTATUSRESPONSEV0 = _descriptor.Descriptor( @@ -5155,8 +5228,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=17305, - serialized_end=17864, + serialized_start=17598, + serialized_end=18157, ) _GETPROTOCOLVERSIONUPGRADEVOTESTATUSRESPONSE = _descriptor.Descriptor( @@ -5191,8 +5264,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=17124, - serialized_end=17875, + serialized_start=17417, + serialized_end=18168, ) @@ -5244,8 +5317,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=17988, - serialized_end=18112, + serialized_start=18281, + serialized_end=18405, ) _GETEPOCHSINFOREQUEST = _descriptor.Descriptor( @@ -5280,8 +5353,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=17878, - serialized_end=18123, + serialized_start=18171, + serialized_end=18416, ) @@ -5312,8 +5385,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=18484, - serialized_end=18601, + serialized_start=18777, + serialized_end=18894, ) _GETEPOCHSINFORESPONSE_GETEPOCHSINFORESPONSEV0_EPOCHINFO = _descriptor.Descriptor( @@ -5378,8 +5451,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=18604, - serialized_end=18770, + serialized_start=18897, + serialized_end=19063, ) _GETEPOCHSINFORESPONSE_GETEPOCHSINFORESPONSEV0 = _descriptor.Descriptor( @@ -5428,8 +5501,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=18240, - serialized_end=18780, + serialized_start=18533, + serialized_end=19073, ) _GETEPOCHSINFORESPONSE = _descriptor.Descriptor( @@ -5464,8 +5537,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=18126, - serialized_end=18791, + serialized_start=18419, + serialized_end=19084, ) @@ -5524,8 +5597,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=18932, - serialized_end=19102, + serialized_start=19225, + serialized_end=19395, ) _GETFINALIZEDEPOCHINFOSREQUEST = _descriptor.Descriptor( @@ -5560,8 +5633,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=18794, - serialized_end=19113, + serialized_start=19087, + serialized_end=19406, ) @@ -5592,8 +5665,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=19539, - serialized_end=19703, + serialized_start=19832, + serialized_end=19996, ) _GETFINALIZEDEPOCHINFOSRESPONSE_GETFINALIZEDEPOCHINFOSRESPONSEV0_FINALIZEDEPOCHINFO = _descriptor.Descriptor( @@ -5707,8 +5780,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=19706, - serialized_end=20249, + serialized_start=19999, + serialized_end=20542, ) _GETFINALIZEDEPOCHINFOSRESPONSE_GETFINALIZEDEPOCHINFOSRESPONSEV0_BLOCKPROPOSER = _descriptor.Descriptor( @@ -5745,8 +5818,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=20251, - serialized_end=20308, + serialized_start=20544, + serialized_end=20601, ) _GETFINALIZEDEPOCHINFOSRESPONSE_GETFINALIZEDEPOCHINFOSRESPONSEV0 = _descriptor.Descriptor( @@ -5795,8 +5868,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=19257, - serialized_end=20318, + serialized_start=19550, + serialized_end=20611, ) _GETFINALIZEDEPOCHINFOSRESPONSE = _descriptor.Descriptor( @@ -5831,8 +5904,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=19116, - serialized_end=20329, + serialized_start=19409, + serialized_end=20622, ) @@ -5870,8 +5943,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=20824, - serialized_end=20893, + serialized_start=21117, + serialized_end=21186, ) _GETCONTESTEDRESOURCESREQUEST_GETCONTESTEDRESOURCESREQUESTV0 = _descriptor.Descriptor( @@ -5967,8 +6040,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=20467, - serialized_end=20927, + serialized_start=20760, + serialized_end=21220, ) _GETCONTESTEDRESOURCESREQUEST = _descriptor.Descriptor( @@ -6003,8 +6076,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=20332, - serialized_end=20938, + serialized_start=20625, + serialized_end=21231, ) @@ -6035,8 +6108,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=21380, - serialized_end=21440, + serialized_start=21673, + serialized_end=21733, ) _GETCONTESTEDRESOURCESRESPONSE_GETCONTESTEDRESOURCESRESPONSEV0 = _descriptor.Descriptor( @@ -6085,8 +6158,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=21079, - serialized_end=21450, + serialized_start=21372, + serialized_end=21743, ) _GETCONTESTEDRESOURCESRESPONSE = _descriptor.Descriptor( @@ -6121,8 +6194,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=20941, - serialized_end=21461, + serialized_start=21234, + serialized_end=21754, ) @@ -6160,8 +6233,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=21974, - serialized_end=22047, + serialized_start=22267, + serialized_end=22340, ) _GETVOTEPOLLSBYENDDATEREQUEST_GETVOTEPOLLSBYENDDATEREQUESTV0_ENDATTIMEINFO = _descriptor.Descriptor( @@ -6198,8 +6271,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=22049, - serialized_end=22116, + serialized_start=22342, + serialized_end=22409, ) _GETVOTEPOLLSBYENDDATEREQUEST_GETVOTEPOLLSBYENDDATEREQUESTV0 = _descriptor.Descriptor( @@ -6284,8 +6357,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=21599, - serialized_end=22175, + serialized_start=21892, + serialized_end=22468, ) _GETVOTEPOLLSBYENDDATEREQUEST = _descriptor.Descriptor( @@ -6320,8 +6393,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=21464, - serialized_end=22186, + serialized_start=21757, + serialized_end=22479, ) @@ -6359,8 +6432,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=22635, - serialized_end=22721, + serialized_start=22928, + serialized_end=23014, ) _GETVOTEPOLLSBYENDDATERESPONSE_GETVOTEPOLLSBYENDDATERESPONSEV0_SERIALIZEDVOTEPOLLSBYTIMESTAMPS = _descriptor.Descriptor( @@ -6397,8 +6470,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=22724, - serialized_end=22939, + serialized_start=23017, + serialized_end=23232, ) _GETVOTEPOLLSBYENDDATERESPONSE_GETVOTEPOLLSBYENDDATERESPONSEV0 = _descriptor.Descriptor( @@ -6447,8 +6520,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=22327, - serialized_end=22949, + serialized_start=22620, + serialized_end=23242, ) _GETVOTEPOLLSBYENDDATERESPONSE = _descriptor.Descriptor( @@ -6483,8 +6556,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=22189, - serialized_end=22960, + serialized_start=22482, + serialized_end=23253, ) @@ -6522,8 +6595,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=23649, - serialized_end=23733, + serialized_start=23942, + serialized_end=24026, ) _GETCONTESTEDRESOURCEVOTESTATEREQUEST_GETCONTESTEDRESOURCEVOTESTATEREQUESTV0 = _descriptor.Descriptor( @@ -6620,8 +6693,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=23122, - serialized_end=23847, + serialized_start=23415, + serialized_end=24140, ) _GETCONTESTEDRESOURCEVOTESTATEREQUEST = _descriptor.Descriptor( @@ -6656,8 +6729,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=22963, - serialized_end=23858, + serialized_start=23256, + serialized_end=24151, ) @@ -6729,8 +6802,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=24358, - serialized_end=24832, + serialized_start=24651, + serialized_end=25125, ) _GETCONTESTEDRESOURCEVOTESTATERESPONSE_GETCONTESTEDRESOURCEVOTESTATERESPONSEV0_CONTESTEDRESOURCECONTENDERS = _descriptor.Descriptor( @@ -6796,8 +6869,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=24835, - serialized_end=25287, + serialized_start=25128, + serialized_end=25580, ) _GETCONTESTEDRESOURCEVOTESTATERESPONSE_GETCONTESTEDRESOURCEVOTESTATERESPONSEV0_CONTENDER = _descriptor.Descriptor( @@ -6851,8 +6924,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=25289, - serialized_end=25396, + serialized_start=25582, + serialized_end=25689, ) _GETCONTESTEDRESOURCEVOTESTATERESPONSE_GETCONTESTEDRESOURCEVOTESTATERESPONSEV0 = _descriptor.Descriptor( @@ -6901,8 +6974,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=24023, - serialized_end=25406, + serialized_start=24316, + serialized_end=25699, ) _GETCONTESTEDRESOURCEVOTESTATERESPONSE = _descriptor.Descriptor( @@ -6937,8 +7010,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=23861, - serialized_end=25417, + serialized_start=24154, + serialized_end=25710, ) @@ -6976,8 +7049,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=23649, - serialized_end=23733, + serialized_start=23942, + serialized_end=24026, ) _GETCONTESTEDRESOURCEVOTERSFORIDENTITYREQUEST_GETCONTESTEDRESOURCEVOTERSFORIDENTITYREQUESTV0 = _descriptor.Descriptor( @@ -7073,8 +7146,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=25604, - serialized_end=26134, + serialized_start=25897, + serialized_end=26427, ) _GETCONTESTEDRESOURCEVOTERSFORIDENTITYREQUEST = _descriptor.Descriptor( @@ -7109,8 +7182,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=25420, - serialized_end=26145, + serialized_start=25713, + serialized_end=26438, ) @@ -7148,8 +7221,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=26685, - serialized_end=26752, + serialized_start=26978, + serialized_end=27045, ) _GETCONTESTEDRESOURCEVOTERSFORIDENTITYRESPONSE_GETCONTESTEDRESOURCEVOTERSFORIDENTITYRESPONSEV0 = _descriptor.Descriptor( @@ -7198,8 +7271,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=26335, - serialized_end=26762, + serialized_start=26628, + serialized_end=27055, ) _GETCONTESTEDRESOURCEVOTERSFORIDENTITYRESPONSE = _descriptor.Descriptor( @@ -7234,8 +7307,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=26148, - serialized_end=26773, + serialized_start=26441, + serialized_end=27066, ) @@ -7273,8 +7346,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=27322, - serialized_end=27419, + serialized_start=27615, + serialized_end=27712, ) _GETCONTESTEDRESOURCEIDENTITYVOTESREQUEST_GETCONTESTEDRESOURCEIDENTITYVOTESREQUESTV0 = _descriptor.Descriptor( @@ -7344,8 +7417,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=26947, - serialized_end=27450, + serialized_start=27240, + serialized_end=27743, ) _GETCONTESTEDRESOURCEIDENTITYVOTESREQUEST = _descriptor.Descriptor( @@ -7380,8 +7453,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=26776, - serialized_end=27461, + serialized_start=27069, + serialized_end=27754, ) @@ -7419,8 +7492,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=27964, - serialized_end=28211, + serialized_start=28257, + serialized_end=28504, ) _GETCONTESTEDRESOURCEIDENTITYVOTESRESPONSE_GETCONTESTEDRESOURCEIDENTITYVOTESRESPONSEV0_RESOURCEVOTECHOICE = _descriptor.Descriptor( @@ -7463,8 +7536,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=28214, - serialized_end=28515, + serialized_start=28507, + serialized_end=28808, ) _GETCONTESTEDRESOURCEIDENTITYVOTESRESPONSE_GETCONTESTEDRESOURCEIDENTITYVOTESRESPONSEV0_CONTESTEDRESOURCEIDENTITYVOTE = _descriptor.Descriptor( @@ -7515,8 +7588,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=28518, - serialized_end=28795, + serialized_start=28811, + serialized_end=29088, ) _GETCONTESTEDRESOURCEIDENTITYVOTESRESPONSE_GETCONTESTEDRESOURCEIDENTITYVOTESRESPONSEV0 = _descriptor.Descriptor( @@ -7565,8 +7638,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=27638, - serialized_end=28805, + serialized_start=27931, + serialized_end=29098, ) _GETCONTESTEDRESOURCEIDENTITYVOTESRESPONSE = _descriptor.Descriptor( @@ -7601,8 +7674,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=27464, - serialized_end=28816, + serialized_start=27757, + serialized_end=29109, ) @@ -7640,8 +7713,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=28980, - serialized_end=29048, + serialized_start=29273, + serialized_end=29341, ) _GETPREFUNDEDSPECIALIZEDBALANCEREQUEST = _descriptor.Descriptor( @@ -7676,8 +7749,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=28819, - serialized_end=29059, + serialized_start=29112, + serialized_end=29352, ) @@ -7727,8 +7800,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=29227, - serialized_end=29416, + serialized_start=29520, + serialized_end=29709, ) _GETPREFUNDEDSPECIALIZEDBALANCERESPONSE = _descriptor.Descriptor( @@ -7763,8 +7836,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=29062, - serialized_end=29427, + serialized_start=29355, + serialized_end=29720, ) @@ -7795,8 +7868,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=29576, - serialized_end=29627, + serialized_start=29869, + serialized_end=29920, ) _GETTOTALCREDITSINPLATFORMREQUEST = _descriptor.Descriptor( @@ -7831,8 +7904,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=29430, - serialized_end=29638, + serialized_start=29723, + serialized_end=29931, ) @@ -7882,8 +7955,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=29791, - serialized_end=29975, + serialized_start=30084, + serialized_end=30268, ) _GETTOTALCREDITSINPLATFORMRESPONSE = _descriptor.Descriptor( @@ -7918,8 +7991,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=29641, - serialized_end=29986, + serialized_start=29934, + serialized_end=30279, ) @@ -7964,8 +8037,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=30105, - serialized_end=30174, + serialized_start=30398, + serialized_end=30467, ) _GETPATHELEMENTSREQUEST = _descriptor.Descriptor( @@ -8000,8 +8073,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=29989, - serialized_end=30185, + serialized_start=30282, + serialized_end=30478, ) @@ -8032,8 +8105,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=30558, - serialized_end=30586, + serialized_start=30851, + serialized_end=30879, ) _GETPATHELEMENTSRESPONSE_GETPATHELEMENTSRESPONSEV0 = _descriptor.Descriptor( @@ -8082,8 +8155,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=30308, - serialized_end=30596, + serialized_start=30601, + serialized_end=30889, ) _GETPATHELEMENTSRESPONSE = _descriptor.Descriptor( @@ -8118,8 +8191,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=30188, - serialized_end=30607, + serialized_start=30481, + serialized_end=30900, ) @@ -8143,8 +8216,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=30708, - serialized_end=30728, + serialized_start=31001, + serialized_end=31021, ) _GETSTATUSREQUEST = _descriptor.Descriptor( @@ -8179,8 +8252,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=30610, - serialized_end=30739, + serialized_start=30903, + serialized_end=31032, ) @@ -8235,8 +8308,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=31616, - serialized_end=31710, + serialized_start=31909, + serialized_end=32003, ) _GETSTATUSRESPONSE_GETSTATUSRESPONSEV0_VERSION_PROTOCOL_TENDERDASH = _descriptor.Descriptor( @@ -8273,8 +8346,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=31943, - serialized_end=31983, + serialized_start=32236, + serialized_end=32276, ) _GETSTATUSRESPONSE_GETSTATUSRESPONSEV0_VERSION_PROTOCOL_DRIVE = _descriptor.Descriptor( @@ -8318,8 +8391,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=31985, - serialized_end=32045, + serialized_start=32278, + serialized_end=32338, ) _GETSTATUSRESPONSE_GETSTATUSRESPONSEV0_VERSION_PROTOCOL = _descriptor.Descriptor( @@ -8356,8 +8429,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=31713, - serialized_end=32045, + serialized_start=32006, + serialized_end=32338, ) _GETSTATUSRESPONSE_GETSTATUSRESPONSEV0_VERSION = _descriptor.Descriptor( @@ -8394,8 +8467,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=31403, - serialized_end=32045, + serialized_start=31696, + serialized_end=32338, ) _GETSTATUSRESPONSE_GETSTATUSRESPONSEV0_TIME = _descriptor.Descriptor( @@ -8461,8 +8534,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=32047, - serialized_end=32174, + serialized_start=32340, + serialized_end=32467, ) _GETSTATUSRESPONSE_GETSTATUSRESPONSEV0_NODE = _descriptor.Descriptor( @@ -8504,8 +8577,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=32176, - serialized_end=32236, + serialized_start=32469, + serialized_end=32529, ) _GETSTATUSRESPONSE_GETSTATUSRESPONSEV0_CHAIN = _descriptor.Descriptor( @@ -8596,8 +8669,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=32239, - serialized_end=32546, + serialized_start=32532, + serialized_end=32839, ) _GETSTATUSRESPONSE_GETSTATUSRESPONSEV0_NETWORK = _descriptor.Descriptor( @@ -8641,8 +8714,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=32548, - serialized_end=32615, + serialized_start=32841, + serialized_end=32908, ) _GETSTATUSRESPONSE_GETSTATUSRESPONSEV0_STATESYNC = _descriptor.Descriptor( @@ -8721,8 +8794,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=32618, - serialized_end=32879, + serialized_start=32911, + serialized_end=33172, ) _GETSTATUSRESPONSE_GETSTATUSRESPONSEV0 = _descriptor.Descriptor( @@ -8787,8 +8860,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=30844, - serialized_end=32879, + serialized_start=31137, + serialized_end=33172, ) _GETSTATUSRESPONSE = _descriptor.Descriptor( @@ -8823,8 +8896,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=30742, - serialized_end=32890, + serialized_start=31035, + serialized_end=33183, ) @@ -8848,8 +8921,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=33027, - serialized_end=33059, + serialized_start=33320, + serialized_end=33352, ) _GETCURRENTQUORUMSINFOREQUEST = _descriptor.Descriptor( @@ -8884,8 +8957,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=32893, - serialized_end=33070, + serialized_start=33186, + serialized_end=33363, ) @@ -8930,8 +9003,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=33210, - serialized_end=33280, + serialized_start=33503, + serialized_end=33573, ) _GETCURRENTQUORUMSINFORESPONSE_VALIDATORSETV0 = _descriptor.Descriptor( @@ -8982,8 +9055,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=33283, - serialized_end=33458, + serialized_start=33576, + serialized_end=33751, ) _GETCURRENTQUORUMSINFORESPONSE_GETCURRENTQUORUMSINFORESPONSEV0 = _descriptor.Descriptor( @@ -9041,8 +9114,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=33461, - serialized_end=33735, + serialized_start=33754, + serialized_end=34028, ) _GETCURRENTQUORUMSINFORESPONSE = _descriptor.Descriptor( @@ -9077,8 +9150,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=33073, - serialized_end=33746, + serialized_start=33366, + serialized_end=34039, ) @@ -9123,8 +9196,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=33892, - serialized_end=33982, + serialized_start=34185, + serialized_end=34275, ) _GETIDENTITYTOKENBALANCESREQUEST = _descriptor.Descriptor( @@ -9159,8 +9232,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=33749, - serialized_end=33993, + serialized_start=34042, + serialized_end=34286, ) @@ -9203,8 +9276,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=34432, - serialized_end=34503, + serialized_start=34725, + serialized_end=34796, ) _GETIDENTITYTOKENBALANCESRESPONSE_GETIDENTITYTOKENBALANCESRESPONSEV0_TOKENBALANCES = _descriptor.Descriptor( @@ -9234,8 +9307,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=34506, - serialized_end=34660, + serialized_start=34799, + serialized_end=34953, ) _GETIDENTITYTOKENBALANCESRESPONSE_GETIDENTITYTOKENBALANCESRESPONSEV0 = _descriptor.Descriptor( @@ -9284,8 +9357,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=34143, - serialized_end=34670, + serialized_start=34436, + serialized_end=34963, ) _GETIDENTITYTOKENBALANCESRESPONSE = _descriptor.Descriptor( @@ -9320,8 +9393,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=33996, - serialized_end=34681, + serialized_start=34289, + serialized_end=34974, ) @@ -9366,8 +9439,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=34833, - serialized_end=34925, + serialized_start=35126, + serialized_end=35218, ) _GETIDENTITIESTOKENBALANCESREQUEST = _descriptor.Descriptor( @@ -9402,8 +9475,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=34684, - serialized_end=34936, + serialized_start=34977, + serialized_end=35229, ) @@ -9446,8 +9519,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=35404, - serialized_end=35486, + serialized_start=35697, + serialized_end=35779, ) _GETIDENTITIESTOKENBALANCESRESPONSE_GETIDENTITIESTOKENBALANCESRESPONSEV0_IDENTITYTOKENBALANCES = _descriptor.Descriptor( @@ -9477,8 +9550,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=35489, - serialized_end=35672, + serialized_start=35782, + serialized_end=35965, ) _GETIDENTITIESTOKENBALANCESRESPONSE_GETIDENTITIESTOKENBALANCESRESPONSEV0 = _descriptor.Descriptor( @@ -9527,8 +9600,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=35092, - serialized_end=35682, + serialized_start=35385, + serialized_end=35975, ) _GETIDENTITIESTOKENBALANCESRESPONSE = _descriptor.Descriptor( @@ -9563,8 +9636,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=34939, - serialized_end=35693, + serialized_start=35232, + serialized_end=35986, ) @@ -9609,8 +9682,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=35830, - serialized_end=35917, + serialized_start=36123, + serialized_end=36210, ) _GETIDENTITYTOKENINFOSREQUEST = _descriptor.Descriptor( @@ -9645,8 +9718,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=35696, - serialized_end=35928, + serialized_start=35989, + serialized_end=36221, ) @@ -9677,8 +9750,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=36342, - serialized_end=36382, + serialized_start=36635, + serialized_end=36675, ) _GETIDENTITYTOKENINFOSRESPONSE_GETIDENTITYTOKENINFOSRESPONSEV0_TOKENINFOENTRY = _descriptor.Descriptor( @@ -9720,8 +9793,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=36385, - serialized_end=36561, + serialized_start=36678, + serialized_end=36854, ) _GETIDENTITYTOKENINFOSRESPONSE_GETIDENTITYTOKENINFOSRESPONSEV0_TOKENINFOS = _descriptor.Descriptor( @@ -9751,8 +9824,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=36564, - serialized_end=36702, + serialized_start=36857, + serialized_end=36995, ) _GETIDENTITYTOKENINFOSRESPONSE_GETIDENTITYTOKENINFOSRESPONSEV0 = _descriptor.Descriptor( @@ -9801,8 +9874,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=36069, - serialized_end=36712, + serialized_start=36362, + serialized_end=37005, ) _GETIDENTITYTOKENINFOSRESPONSE = _descriptor.Descriptor( @@ -9837,8 +9910,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=35931, - serialized_end=36723, + serialized_start=36224, + serialized_end=37016, ) @@ -9883,8 +9956,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=36866, - serialized_end=36955, + serialized_start=37159, + serialized_end=37248, ) _GETIDENTITIESTOKENINFOSREQUEST = _descriptor.Descriptor( @@ -9919,8 +9992,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=36726, - serialized_end=36966, + serialized_start=37019, + serialized_end=37259, ) @@ -9951,8 +10024,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=36342, - serialized_end=36382, + serialized_start=36635, + serialized_end=36675, ) _GETIDENTITIESTOKENINFOSRESPONSE_GETIDENTITIESTOKENINFOSRESPONSEV0_TOKENINFOENTRY = _descriptor.Descriptor( @@ -9994,8 +10067,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=37453, - serialized_end=37636, + serialized_start=37746, + serialized_end=37929, ) _GETIDENTITIESTOKENINFOSRESPONSE_GETIDENTITIESTOKENINFOSRESPONSEV0_IDENTITYTOKENINFOS = _descriptor.Descriptor( @@ -10025,8 +10098,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=37639, - serialized_end=37790, + serialized_start=37932, + serialized_end=38083, ) _GETIDENTITIESTOKENINFOSRESPONSE_GETIDENTITIESTOKENINFOSRESPONSEV0 = _descriptor.Descriptor( @@ -10075,8 +10148,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=37113, - serialized_end=37800, + serialized_start=37406, + serialized_end=38093, ) _GETIDENTITIESTOKENINFOSRESPONSE = _descriptor.Descriptor( @@ -10111,8 +10184,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=36969, - serialized_end=37811, + serialized_start=37262, + serialized_end=38104, ) @@ -10150,8 +10223,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=37933, - serialized_end=37994, + serialized_start=38226, + serialized_end=38287, ) _GETTOKENSTATUSESREQUEST = _descriptor.Descriptor( @@ -10186,8 +10259,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=37814, - serialized_end=38005, + serialized_start=38107, + serialized_end=38298, ) @@ -10230,8 +10303,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=38395, - serialized_end=38463, + serialized_start=38688, + serialized_end=38756, ) _GETTOKENSTATUSESRESPONSE_GETTOKENSTATUSESRESPONSEV0_TOKENSTATUSES = _descriptor.Descriptor( @@ -10261,8 +10334,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=38466, - serialized_end=38602, + serialized_start=38759, + serialized_end=38895, ) _GETTOKENSTATUSESRESPONSE_GETTOKENSTATUSESRESPONSEV0 = _descriptor.Descriptor( @@ -10311,8 +10384,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=38131, - serialized_end=38612, + serialized_start=38424, + serialized_end=38905, ) _GETTOKENSTATUSESRESPONSE = _descriptor.Descriptor( @@ -10347,8 +10420,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=38008, - serialized_end=38623, + serialized_start=38301, + serialized_end=38916, ) @@ -10386,8 +10459,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=38781, - serialized_end=38854, + serialized_start=39074, + serialized_end=39147, ) _GETTOKENDIRECTPURCHASEPRICESREQUEST = _descriptor.Descriptor( @@ -10422,8 +10495,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=38626, - serialized_end=38865, + serialized_start=38919, + serialized_end=39158, ) @@ -10461,8 +10534,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=39355, - serialized_end=39406, + serialized_start=39648, + serialized_end=39699, ) _GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_PRICINGSCHEDULE = _descriptor.Descriptor( @@ -10492,8 +10565,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=39409, - serialized_end=39576, + serialized_start=39702, + serialized_end=39869, ) _GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_TOKENDIRECTPURCHASEPRICEENTRY = _descriptor.Descriptor( @@ -10542,8 +10615,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=39579, - serialized_end=39807, + serialized_start=39872, + serialized_end=40100, ) _GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_TOKENDIRECTPURCHASEPRICES = _descriptor.Descriptor( @@ -10573,8 +10646,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=39810, - serialized_end=40010, + serialized_start=40103, + serialized_end=40303, ) _GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0 = _descriptor.Descriptor( @@ -10623,8 +10696,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=39027, - serialized_end=40020, + serialized_start=39320, + serialized_end=40313, ) _GETTOKENDIRECTPURCHASEPRICESRESPONSE = _descriptor.Descriptor( @@ -10659,8 +10732,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=38868, - serialized_end=40031, + serialized_start=39161, + serialized_end=40324, ) @@ -10698,8 +10771,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=40165, - serialized_end=40229, + serialized_start=40458, + serialized_end=40522, ) _GETTOKENCONTRACTINFOREQUEST = _descriptor.Descriptor( @@ -10734,8 +10807,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=40034, - serialized_end=40240, + serialized_start=40327, + serialized_end=40533, ) @@ -10773,8 +10846,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=40652, - serialized_end=40729, + serialized_start=40945, + serialized_end=41022, ) _GETTOKENCONTRACTINFORESPONSE_GETTOKENCONTRACTINFORESPONSEV0 = _descriptor.Descriptor( @@ -10823,8 +10896,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=40378, - serialized_end=40739, + serialized_start=40671, + serialized_end=41032, ) _GETTOKENCONTRACTINFORESPONSE = _descriptor.Descriptor( @@ -10859,8 +10932,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=40243, - serialized_end=40750, + serialized_start=40536, + serialized_end=41043, ) @@ -10915,8 +10988,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=41183, - serialized_end=41337, + serialized_start=41476, + serialized_end=41630, ) _GETTOKENPREPROGRAMMEDDISTRIBUTIONSREQUEST_GETTOKENPREPROGRAMMEDDISTRIBUTIONSREQUESTV0 = _descriptor.Descriptor( @@ -10977,8 +11050,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=40927, - serialized_end=41365, + serialized_start=41220, + serialized_end=41658, ) _GETTOKENPREPROGRAMMEDDISTRIBUTIONSREQUEST = _descriptor.Descriptor( @@ -11013,8 +11086,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=40753, - serialized_end=41376, + serialized_start=41046, + serialized_end=41669, ) @@ -11052,8 +11125,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=41887, - serialized_end=41949, + serialized_start=42180, + serialized_end=42242, ) _GETTOKENPREPROGRAMMEDDISTRIBUTIONSRESPONSE_GETTOKENPREPROGRAMMEDDISTRIBUTIONSRESPONSEV0_TOKENTIMEDDISTRIBUTIONENTRY = _descriptor.Descriptor( @@ -11090,8 +11163,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=41952, - serialized_end=42164, + serialized_start=42245, + serialized_end=42457, ) _GETTOKENPREPROGRAMMEDDISTRIBUTIONSRESPONSE_GETTOKENPREPROGRAMMEDDISTRIBUTIONSRESPONSEV0_TOKENDISTRIBUTIONS = _descriptor.Descriptor( @@ -11121,8 +11194,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=42167, - serialized_end=42362, + serialized_start=42460, + serialized_end=42655, ) _GETTOKENPREPROGRAMMEDDISTRIBUTIONSRESPONSE_GETTOKENPREPROGRAMMEDDISTRIBUTIONSRESPONSEV0 = _descriptor.Descriptor( @@ -11171,8 +11244,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=41557, - serialized_end=42372, + serialized_start=41850, + serialized_end=42665, ) _GETTOKENPREPROGRAMMEDDISTRIBUTIONSRESPONSE = _descriptor.Descriptor( @@ -11207,8 +11280,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=41379, - serialized_end=42383, + serialized_start=41672, + serialized_end=42676, ) @@ -11246,8 +11319,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=42572, - serialized_end=42645, + serialized_start=42865, + serialized_end=42938, ) _GETTOKENPERPETUALDISTRIBUTIONLASTCLAIMREQUEST_GETTOKENPERPETUALDISTRIBUTIONLASTCLAIMREQUESTV0 = _descriptor.Descriptor( @@ -11303,8 +11376,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=42648, - serialized_end=42889, + serialized_start=42941, + serialized_end=43182, ) _GETTOKENPERPETUALDISTRIBUTIONLASTCLAIMREQUEST = _descriptor.Descriptor( @@ -11339,8 +11412,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=42386, - serialized_end=42900, + serialized_start=42679, + serialized_end=43193, ) @@ -11397,8 +11470,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=43421, - serialized_end=43541, + serialized_start=43714, + serialized_end=43834, ) _GETTOKENPERPETUALDISTRIBUTIONLASTCLAIMRESPONSE_GETTOKENPERPETUALDISTRIBUTIONLASTCLAIMRESPONSEV0 = _descriptor.Descriptor( @@ -11447,8 +11520,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=43093, - serialized_end=43551, + serialized_start=43386, + serialized_end=43844, ) _GETTOKENPERPETUALDISTRIBUTIONLASTCLAIMRESPONSE = _descriptor.Descriptor( @@ -11483,8 +11556,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=42903, - serialized_end=43562, + serialized_start=43196, + serialized_end=43855, ) @@ -11522,8 +11595,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=43693, - serialized_end=43756, + serialized_start=43986, + serialized_end=44049, ) _GETTOKENTOTALSUPPLYREQUEST = _descriptor.Descriptor( @@ -11558,8 +11631,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=43565, - serialized_end=43767, + serialized_start=43858, + serialized_end=44060, ) @@ -11604,8 +11677,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=44188, - serialized_end=44308, + serialized_start=44481, + serialized_end=44601, ) _GETTOKENTOTALSUPPLYRESPONSE_GETTOKENTOTALSUPPLYRESPONSEV0 = _descriptor.Descriptor( @@ -11654,8 +11727,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=43902, - serialized_end=44318, + serialized_start=44195, + serialized_end=44611, ) _GETTOKENTOTALSUPPLYRESPONSE = _descriptor.Descriptor( @@ -11690,8 +11763,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=43770, - serialized_end=44329, + serialized_start=44063, + serialized_end=44622, ) @@ -11736,8 +11809,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=44439, - serialized_end=44531, + serialized_start=44732, + serialized_end=44824, ) _GETGROUPINFOREQUEST = _descriptor.Descriptor( @@ -11772,8 +11845,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=44332, - serialized_end=44542, + serialized_start=44625, + serialized_end=44835, ) @@ -11811,8 +11884,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=44900, - serialized_end=44952, + serialized_start=45193, + serialized_end=45245, ) _GETGROUPINFORESPONSE_GETGROUPINFORESPONSEV0_GROUPINFOENTRY = _descriptor.Descriptor( @@ -11849,8 +11922,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=44955, - serialized_end=45107, + serialized_start=45248, + serialized_end=45400, ) _GETGROUPINFORESPONSE_GETGROUPINFORESPONSEV0_GROUPINFO = _descriptor.Descriptor( @@ -11885,8 +11958,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=45110, - serialized_end=45248, + serialized_start=45403, + serialized_end=45541, ) _GETGROUPINFORESPONSE_GETGROUPINFORESPONSEV0 = _descriptor.Descriptor( @@ -11935,8 +12008,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=44656, - serialized_end=45258, + serialized_start=44949, + serialized_end=45551, ) _GETGROUPINFORESPONSE = _descriptor.Descriptor( @@ -11971,8 +12044,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=44545, - serialized_end=45269, + serialized_start=44838, + serialized_end=45562, ) @@ -12010,8 +12083,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=45382, - serialized_end=45499, + serialized_start=45675, + serialized_end=45792, ) _GETGROUPINFOSREQUEST_GETGROUPINFOSREQUESTV0 = _descriptor.Descriptor( @@ -12072,8 +12145,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=45502, - serialized_end=45754, + serialized_start=45795, + serialized_end=46047, ) _GETGROUPINFOSREQUEST = _descriptor.Descriptor( @@ -12108,8 +12181,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=45272, - serialized_end=45765, + serialized_start=45565, + serialized_end=46058, ) @@ -12147,8 +12220,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=44900, - serialized_end=44952, + serialized_start=45193, + serialized_end=45245, ) _GETGROUPINFOSRESPONSE_GETGROUPINFOSRESPONSEV0_GROUPPOSITIONINFOENTRY = _descriptor.Descriptor( @@ -12192,8 +12265,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=46186, - serialized_end=46381, + serialized_start=46479, + serialized_end=46674, ) _GETGROUPINFOSRESPONSE_GETGROUPINFOSRESPONSEV0_GROUPINFOS = _descriptor.Descriptor( @@ -12223,8 +12296,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=46384, - serialized_end=46514, + serialized_start=46677, + serialized_end=46807, ) _GETGROUPINFOSRESPONSE_GETGROUPINFOSRESPONSEV0 = _descriptor.Descriptor( @@ -12273,8 +12346,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=45882, - serialized_end=46524, + serialized_start=46175, + serialized_end=46817, ) _GETGROUPINFOSRESPONSE = _descriptor.Descriptor( @@ -12309,8 +12382,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=45768, - serialized_end=46535, + serialized_start=46061, + serialized_end=46828, ) @@ -12348,8 +12421,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=46654, - serialized_end=46730, + serialized_start=46947, + serialized_end=47023, ) _GETGROUPACTIONSREQUEST_GETGROUPACTIONSREQUESTV0 = _descriptor.Descriptor( @@ -12424,8 +12497,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=46733, - serialized_end=47061, + serialized_start=47026, + serialized_end=47354, ) _GETGROUPACTIONSREQUEST = _descriptor.Descriptor( @@ -12461,8 +12534,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=46538, - serialized_end=47112, + serialized_start=46831, + serialized_end=47405, ) @@ -12512,8 +12585,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=47494, - serialized_end=47585, + serialized_start=47787, + serialized_end=47878, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_BURNEVENT = _descriptor.Descriptor( @@ -12562,8 +12635,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=47587, - serialized_end=47678, + serialized_start=47880, + serialized_end=47971, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_FREEZEEVENT = _descriptor.Descriptor( @@ -12605,8 +12678,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=47680, - serialized_end=47754, + serialized_start=47973, + serialized_end=48047, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_UNFREEZEEVENT = _descriptor.Descriptor( @@ -12648,8 +12721,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=47756, - serialized_end=47832, + serialized_start=48049, + serialized_end=48125, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_DESTROYFROZENFUNDSEVENT = _descriptor.Descriptor( @@ -12698,8 +12771,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=47834, - serialized_end=47936, + serialized_start=48127, + serialized_end=48229, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_SHAREDENCRYPTEDNOTE = _descriptor.Descriptor( @@ -12743,8 +12816,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=47938, - serialized_end=48038, + serialized_start=48231, + serialized_end=48331, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_PERSONALENCRYPTEDNOTE = _descriptor.Descriptor( @@ -12788,8 +12861,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=48040, - serialized_end=48163, + serialized_start=48333, + serialized_end=48456, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_EMERGENCYACTIONEVENT = _descriptor.Descriptor( @@ -12832,8 +12905,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=48166, - serialized_end=48399, + serialized_start=48459, + serialized_end=48692, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_TOKENCONFIGUPDATEEVENT = _descriptor.Descriptor( @@ -12875,8 +12948,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=48401, - serialized_end=48501, + serialized_start=48694, + serialized_end=48794, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_UPDATEDIRECTPURCHASEPRICEEVENT_PRICEFORQUANTITY = _descriptor.Descriptor( @@ -12913,8 +12986,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=39355, - serialized_end=39406, + serialized_start=39648, + serialized_end=39699, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_UPDATEDIRECTPURCHASEPRICEEVENT_PRICINGSCHEDULE = _descriptor.Descriptor( @@ -12944,8 +13017,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=48793, - serialized_end=48965, + serialized_start=49086, + serialized_end=49258, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_UPDATEDIRECTPURCHASEPRICEEVENT = _descriptor.Descriptor( @@ -12999,8 +13072,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=48504, - serialized_end=48990, + serialized_start=48797, + serialized_end=49283, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_GROUPACTIONEVENT = _descriptor.Descriptor( @@ -13049,8 +13122,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=48993, - serialized_end=49373, + serialized_start=49286, + serialized_end=49666, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_DOCUMENTEVENT = _descriptor.Descriptor( @@ -13085,8 +13158,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=49376, - serialized_end=49515, + serialized_start=49669, + serialized_end=49808, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_DOCUMENTCREATEEVENT = _descriptor.Descriptor( @@ -13116,8 +13189,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=49517, - serialized_end=49564, + serialized_start=49810, + serialized_end=49857, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_CONTRACTUPDATEEVENT = _descriptor.Descriptor( @@ -13147,8 +13220,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=49566, - serialized_end=49613, + serialized_start=49859, + serialized_end=49906, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_CONTRACTEVENT = _descriptor.Descriptor( @@ -13183,8 +13256,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=49616, - serialized_end=49755, + serialized_start=49909, + serialized_end=50048, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_TOKENEVENT = _descriptor.Descriptor( @@ -13268,8 +13341,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=49758, - serialized_end=50735, + serialized_start=50051, + serialized_end=51028, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_GROUPACTIONENTRY = _descriptor.Descriptor( @@ -13306,8 +13379,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=50738, - serialized_end=50885, + serialized_start=51031, + serialized_end=51178, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_GROUPACTIONS = _descriptor.Descriptor( @@ -13337,8 +13410,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=50888, - serialized_end=51020, + serialized_start=51181, + serialized_end=51313, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0 = _descriptor.Descriptor( @@ -13387,8 +13460,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=47235, - serialized_end=51030, + serialized_start=47528, + serialized_end=51323, ) _GETGROUPACTIONSRESPONSE = _descriptor.Descriptor( @@ -13423,8 +13496,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=47115, - serialized_end=51041, + serialized_start=47408, + serialized_end=51334, ) @@ -13483,8 +13556,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=51179, - serialized_end=51385, + serialized_start=51472, + serialized_end=51678, ) _GETGROUPACTIONSIGNERSREQUEST = _descriptor.Descriptor( @@ -13520,8 +13593,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=51044, - serialized_end=51436, + serialized_start=51337, + serialized_end=51729, ) @@ -13559,8 +13632,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=51868, - serialized_end=51921, + serialized_start=52161, + serialized_end=52214, ) _GETGROUPACTIONSIGNERSRESPONSE_GETGROUPACTIONSIGNERSRESPONSEV0_GROUPACTIONSIGNERS = _descriptor.Descriptor( @@ -13590,8 +13663,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=51924, - serialized_end=52069, + serialized_start=52217, + serialized_end=52362, ) _GETGROUPACTIONSIGNERSRESPONSE_GETGROUPACTIONSIGNERSRESPONSEV0 = _descriptor.Descriptor( @@ -13640,8 +13713,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=51577, - serialized_end=52079, + serialized_start=51870, + serialized_end=52372, ) _GETGROUPACTIONSIGNERSRESPONSE = _descriptor.Descriptor( @@ -13676,8 +13749,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=51439, - serialized_end=52090, + serialized_start=51732, + serialized_end=52383, ) @@ -13715,8 +13788,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=52206, - serialized_end=52263, + serialized_start=52499, + serialized_end=52556, ) _GETADDRESSINFOREQUEST = _descriptor.Descriptor( @@ -13751,8 +13824,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=52093, - serialized_end=52274, + serialized_start=52386, + serialized_end=52567, ) @@ -13795,8 +13868,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=52277, - serialized_end=52410, + serialized_start=52570, + serialized_end=52703, ) @@ -13834,8 +13907,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=52412, - serialized_end=52461, + serialized_start=52705, + serialized_end=52754, ) @@ -13866,8 +13939,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=52463, - serialized_end=52558, + serialized_start=52756, + serialized_end=52851, ) @@ -13917,8 +13990,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=52560, - serialized_end=52669, + serialized_start=52853, + serialized_end=52962, ) @@ -13956,8 +14029,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=52671, - serialized_end=52791, + serialized_start=52964, + serialized_end=53084, ) @@ -13988,8 +14061,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=52793, - serialized_end=52900, + serialized_start=53086, + serialized_end=53193, ) @@ -14039,8 +14112,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=53020, - serialized_end=53245, + serialized_start=53313, + serialized_end=53538, ) _GETADDRESSINFORESPONSE = _descriptor.Descriptor( @@ -14075,8 +14148,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=52903, - serialized_end=53256, + serialized_start=53196, + serialized_end=53549, ) @@ -14114,8 +14187,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=53381, - serialized_end=53443, + serialized_start=53674, + serialized_end=53736, ) _GETADDRESSESINFOSREQUEST = _descriptor.Descriptor( @@ -14150,8 +14223,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=53259, - serialized_end=53454, + serialized_start=53552, + serialized_end=53747, ) @@ -14201,8 +14274,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=53583, - serialized_end=53815, + serialized_start=53876, + serialized_end=54108, ) _GETADDRESSESINFOSRESPONSE = _descriptor.Descriptor( @@ -14237,8 +14310,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=53457, - serialized_end=53826, + serialized_start=53750, + serialized_end=54119, ) @@ -14262,8 +14335,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=53966, - serialized_end=53999, + serialized_start=54259, + serialized_end=54292, ) _GETADDRESSESTRUNKSTATEREQUEST = _descriptor.Descriptor( @@ -14298,8 +14371,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=53829, - serialized_end=54010, + serialized_start=54122, + serialized_end=54303, ) @@ -14337,8 +14410,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=54154, - serialized_end=54300, + serialized_start=54447, + serialized_end=54593, ) _GETADDRESSESTRUNKSTATERESPONSE = _descriptor.Descriptor( @@ -14373,8 +14446,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=54013, - serialized_end=54311, + serialized_start=54306, + serialized_end=54604, ) @@ -14419,8 +14492,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=54454, - serialized_end=54543, + serialized_start=54747, + serialized_end=54836, ) _GETADDRESSESBRANCHSTATEREQUEST = _descriptor.Descriptor( @@ -14455,8 +14528,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=54314, - serialized_end=54554, + serialized_start=54607, + serialized_end=54847, ) @@ -14487,8 +14560,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=54700, - serialized_end=54755, + serialized_start=54993, + serialized_end=55048, ) _GETADDRESSESBRANCHSTATERESPONSE = _descriptor.Descriptor( @@ -14523,8 +14596,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=54557, - serialized_end=54766, + serialized_start=54850, + serialized_end=55059, ) @@ -14569,8 +14642,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=54930, - serialized_end=55044, + serialized_start=55223, + serialized_end=55337, ) _GETRECENTADDRESSBALANCECHANGESREQUEST = _descriptor.Descriptor( @@ -14605,8 +14678,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=54769, - serialized_end=55055, + serialized_start=55062, + serialized_end=55348, ) @@ -14656,8 +14729,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=55223, - serialized_end=55487, + serialized_start=55516, + serialized_end=55780, ) _GETRECENTADDRESSBALANCECHANGESRESPONSE = _descriptor.Descriptor( @@ -14692,8 +14765,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=55058, - serialized_end=55498, + serialized_start=55351, + serialized_end=55791, ) @@ -14731,8 +14804,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=55500, - serialized_end=55571, + serialized_start=55793, + serialized_end=55864, ) @@ -14782,8 +14855,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=55574, - serialized_end=55750, + serialized_start=55867, + serialized_end=56043, ) @@ -14814,8 +14887,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=55752, - serialized_end=55844, + serialized_start=56045, + serialized_end=56137, ) @@ -14860,8 +14933,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=55847, - serialized_end=56021, + serialized_start=56140, + serialized_end=56314, ) @@ -14892,8 +14965,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=56024, - serialized_end=56159, + serialized_start=56317, + serialized_end=56452, ) @@ -14931,8 +15004,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=56351, - serialized_end=56448, + serialized_start=56644, + serialized_end=56741, ) _GETRECENTCOMPACTEDADDRESSBALANCECHANGESREQUEST = _descriptor.Descriptor( @@ -14967,8 +15040,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=56162, - serialized_end=56459, + serialized_start=56455, + serialized_end=56752, ) @@ -15018,8 +15091,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=56655, - serialized_end=56947, + serialized_start=56948, + serialized_end=57240, ) _GETRECENTCOMPACTEDADDRESSBALANCECHANGESRESPONSE = _descriptor.Descriptor( @@ -15054,8 +15127,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=56462, - serialized_end=56958, + serialized_start=56755, + serialized_end=57251, ) @@ -15100,8 +15173,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=57107, - serialized_end=57194, + serialized_start=57400, + serialized_end=57487, ) _GETSHIELDEDENCRYPTEDNOTESREQUEST = _descriptor.Descriptor( @@ -15136,8 +15209,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=56961, - serialized_end=57205, + serialized_start=57254, + serialized_end=57498, ) @@ -15182,8 +15255,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=57652, - serialized_end=57723, + serialized_start=57945, + serialized_end=58016, ) _GETSHIELDEDENCRYPTEDNOTESRESPONSE_GETSHIELDEDENCRYPTEDNOTESRESPONSEV0_ENCRYPTEDNOTES = _descriptor.Descriptor( @@ -15213,8 +15286,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=57726, - serialized_end=57871, + serialized_start=58019, + serialized_end=58164, ) _GETSHIELDEDENCRYPTEDNOTESRESPONSE_GETSHIELDEDENCRYPTEDNOTESRESPONSEV0 = _descriptor.Descriptor( @@ -15263,8 +15336,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=57358, - serialized_end=57881, + serialized_start=57651, + serialized_end=58174, ) _GETSHIELDEDENCRYPTEDNOTESRESPONSE = _descriptor.Descriptor( @@ -15299,8 +15372,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=57208, - serialized_end=57892, + serialized_start=57501, + serialized_end=58185, ) @@ -15331,8 +15404,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=58020, - serialized_end=58064, + serialized_start=58313, + serialized_end=58357, ) _GETSHIELDEDANCHORSREQUEST = _descriptor.Descriptor( @@ -15367,8 +15440,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=57895, - serialized_end=58075, + serialized_start=58188, + serialized_end=58368, ) @@ -15399,8 +15472,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=58464, - serialized_end=58490, + serialized_start=58757, + serialized_end=58783, ) _GETSHIELDEDANCHORSRESPONSE_GETSHIELDEDANCHORSRESPONSEV0 = _descriptor.Descriptor( @@ -15449,8 +15522,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=58207, - serialized_end=58500, + serialized_start=58500, + serialized_end=58793, ) _GETSHIELDEDANCHORSRESPONSE = _descriptor.Descriptor( @@ -15485,8 +15558,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=58078, - serialized_end=58511, + serialized_start=58371, + serialized_end=58804, ) @@ -15517,8 +15590,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=58666, - serialized_end=58719, + serialized_start=58959, + serialized_end=59012, ) _GETMOSTRECENTSHIELDEDANCHORREQUEST = _descriptor.Descriptor( @@ -15553,8 +15626,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=58514, - serialized_end=58730, + serialized_start=58807, + serialized_end=59023, ) @@ -15604,8 +15677,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=58889, - serialized_end=59070, + serialized_start=59182, + serialized_end=59363, ) _GETMOSTRECENTSHIELDEDANCHORRESPONSE = _descriptor.Descriptor( @@ -15640,8 +15713,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=58733, - serialized_end=59081, + serialized_start=59026, + serialized_end=59374, ) @@ -15672,8 +15745,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=59215, - serialized_end=59261, + serialized_start=59508, + serialized_end=59554, ) _GETSHIELDEDPOOLSTATEREQUEST = _descriptor.Descriptor( @@ -15708,8 +15781,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=59084, - serialized_end=59272, + serialized_start=59377, + serialized_end=59565, ) @@ -15759,8 +15832,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=59410, - serialized_end=59595, + serialized_start=59703, + serialized_end=59888, ) _GETSHIELDEDPOOLSTATERESPONSE = _descriptor.Descriptor( @@ -15795,8 +15868,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=59275, - serialized_end=59606, + serialized_start=59568, + serialized_end=59899, ) @@ -15834,8 +15907,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=59743, - serialized_end=59810, + serialized_start=60036, + serialized_end=60103, ) _GETSHIELDEDNULLIFIERSREQUEST = _descriptor.Descriptor( @@ -15870,8 +15943,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=59609, - serialized_end=59821, + serialized_start=59902, + serialized_end=60114, ) @@ -15909,8 +15982,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=60250, - serialized_end=60304, + serialized_start=60543, + serialized_end=60597, ) _GETSHIELDEDNULLIFIERSRESPONSE_GETSHIELDEDNULLIFIERSRESPONSEV0_NULLIFIERSTATUSES = _descriptor.Descriptor( @@ -15940,8 +16013,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=60307, - serialized_end=60449, + serialized_start=60600, + serialized_end=60742, ) _GETSHIELDEDNULLIFIERSRESPONSE_GETSHIELDEDNULLIFIERSRESPONSEV0 = _descriptor.Descriptor( @@ -15990,8 +16063,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=59962, - serialized_end=60459, + serialized_start=60255, + serialized_end=60752, ) _GETSHIELDEDNULLIFIERSRESPONSE = _descriptor.Descriptor( @@ -16026,8 +16099,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=59824, - serialized_end=60470, + serialized_start=60117, + serialized_end=60763, ) @@ -16065,8 +16138,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=60613, - serialized_end=60691, + serialized_start=60906, + serialized_end=60984, ) _GETNULLIFIERSTRUNKSTATEREQUEST = _descriptor.Descriptor( @@ -16101,8 +16174,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=60473, - serialized_end=60702, + serialized_start=60766, + serialized_end=60995, ) @@ -16140,8 +16213,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=60849, - serialized_end=60996, + serialized_start=61142, + serialized_end=61289, ) _GETNULLIFIERSTRUNKSTATERESPONSE = _descriptor.Descriptor( @@ -16176,8 +16249,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=60705, - serialized_end=61007, + serialized_start=60998, + serialized_end=61300, ) @@ -16236,8 +16309,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=61154, - serialized_end=61288, + serialized_start=61447, + serialized_end=61581, ) _GETNULLIFIERSBRANCHSTATEREQUEST = _descriptor.Descriptor( @@ -16272,8 +16345,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=61010, - serialized_end=61299, + serialized_start=61303, + serialized_end=61592, ) @@ -16304,8 +16377,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=61448, - serialized_end=61504, + serialized_start=61741, + serialized_end=61797, ) _GETNULLIFIERSBRANCHSTATERESPONSE = _descriptor.Descriptor( @@ -16340,8 +16413,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=61302, - serialized_end=61515, + serialized_start=61595, + serialized_end=61808, ) @@ -16379,8 +16452,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=61517, - serialized_end=61586, + serialized_start=61810, + serialized_end=61879, ) @@ -16411,8 +16484,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=61588, - serialized_end=61685, + serialized_start=61881, + serialized_end=61978, ) @@ -16450,8 +16523,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=61834, - serialized_end=61911, + serialized_start=62127, + serialized_end=62204, ) _GETRECENTNULLIFIERCHANGESREQUEST = _descriptor.Descriptor( @@ -16486,8 +16559,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=61688, - serialized_end=61922, + serialized_start=61981, + serialized_end=62215, ) @@ -16537,8 +16610,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=62075, - serialized_end=62323, + serialized_start=62368, + serialized_end=62616, ) _GETRECENTNULLIFIERCHANGESRESPONSE = _descriptor.Descriptor( @@ -16573,8 +16646,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=61925, - serialized_end=62334, + serialized_start=62218, + serialized_end=62627, ) @@ -16619,8 +16692,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=62336, - serialized_end=62450, + serialized_start=62629, + serialized_end=62743, ) @@ -16651,8 +16724,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=62452, - serialized_end=62577, + serialized_start=62745, + serialized_end=62870, ) @@ -16690,8 +16763,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=62753, - serialized_end=62845, + serialized_start=63046, + serialized_end=63138, ) _GETRECENTCOMPACTEDNULLIFIERCHANGESREQUEST = _descriptor.Descriptor( @@ -16726,8 +16799,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=62580, - serialized_end=62856, + serialized_start=62873, + serialized_end=63149, ) @@ -16777,8 +16850,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=63037, - serialized_end=63313, + serialized_start=63330, + serialized_end=63606, ) _GETRECENTCOMPACTEDNULLIFIERCHANGESRESPONSE = _descriptor.Descriptor( @@ -16813,8 +16886,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=62859, - serialized_end=63324, + serialized_start=63152, + serialized_end=63617, ) _GETIDENTITYREQUEST_GETIDENTITYREQUESTV0.containing_type = _GETIDENTITYREQUEST @@ -17119,10 +17192,26 @@ _GETDOCUMENTSREQUEST_GETDOCUMENTSREQUESTV0.oneofs_by_name['start'].fields.append( _GETDOCUMENTSREQUEST_GETDOCUMENTSREQUESTV0.fields_by_name['start_at']) _GETDOCUMENTSREQUEST_GETDOCUMENTSREQUESTV0.fields_by_name['start_at'].containing_oneof = _GETDOCUMENTSREQUEST_GETDOCUMENTSREQUESTV0.oneofs_by_name['start'] +_GETDOCUMENTSREQUEST_GETDOCUMENTSREQUESTV1.fields_by_name['select'].enum_type = _GETDOCUMENTSREQUEST_GETDOCUMENTSREQUESTV1_SELECT +_GETDOCUMENTSREQUEST_GETDOCUMENTSREQUESTV1.containing_type = _GETDOCUMENTSREQUEST +_GETDOCUMENTSREQUEST_GETDOCUMENTSREQUESTV1_SELECT.containing_type = _GETDOCUMENTSREQUEST_GETDOCUMENTSREQUESTV1 +_GETDOCUMENTSREQUEST_GETDOCUMENTSREQUESTV1.oneofs_by_name['start'].fields.append( + _GETDOCUMENTSREQUEST_GETDOCUMENTSREQUESTV1.fields_by_name['start_after']) +_GETDOCUMENTSREQUEST_GETDOCUMENTSREQUESTV1.fields_by_name['start_after'].containing_oneof = _GETDOCUMENTSREQUEST_GETDOCUMENTSREQUESTV1.oneofs_by_name['start'] +_GETDOCUMENTSREQUEST_GETDOCUMENTSREQUESTV1.oneofs_by_name['start'].fields.append( + _GETDOCUMENTSREQUEST_GETDOCUMENTSREQUESTV1.fields_by_name['start_at']) +_GETDOCUMENTSREQUEST_GETDOCUMENTSREQUESTV1.fields_by_name['start_at'].containing_oneof = _GETDOCUMENTSREQUEST_GETDOCUMENTSREQUESTV1.oneofs_by_name['start'] +_GETDOCUMENTSREQUEST_GETDOCUMENTSREQUESTV1.oneofs_by_name['_limit'].fields.append( + _GETDOCUMENTSREQUEST_GETDOCUMENTSREQUESTV1.fields_by_name['limit']) +_GETDOCUMENTSREQUEST_GETDOCUMENTSREQUESTV1.fields_by_name['limit'].containing_oneof = _GETDOCUMENTSREQUEST_GETDOCUMENTSREQUESTV1.oneofs_by_name['_limit'] _GETDOCUMENTSREQUEST.fields_by_name['v0'].message_type = _GETDOCUMENTSREQUEST_GETDOCUMENTSREQUESTV0 +_GETDOCUMENTSREQUEST.fields_by_name['v1'].message_type = _GETDOCUMENTSREQUEST_GETDOCUMENTSREQUESTV1 _GETDOCUMENTSREQUEST.oneofs_by_name['version'].fields.append( _GETDOCUMENTSREQUEST.fields_by_name['v0']) _GETDOCUMENTSREQUEST.fields_by_name['v0'].containing_oneof = _GETDOCUMENTSREQUEST.oneofs_by_name['version'] +_GETDOCUMENTSREQUEST.oneofs_by_name['version'].fields.append( + _GETDOCUMENTSREQUEST.fields_by_name['v1']) +_GETDOCUMENTSREQUEST.fields_by_name['v1'].containing_oneof = _GETDOCUMENTSREQUEST.oneofs_by_name['version'] _GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV0_DOCUMENTS.containing_type = _GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV0 _GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV0.fields_by_name['documents'].message_type = _GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV0_DOCUMENTS _GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV0.fields_by_name['proof'].message_type = _PROOF @@ -17134,46 +17223,48 @@ _GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV0.oneofs_by_name['result'].fields.append( _GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV0.fields_by_name['proof']) _GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV0.fields_by_name['proof'].containing_oneof = _GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV0.oneofs_by_name['result'] +_GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1_DOCUMENTS.containing_type = _GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1 +_GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1_COUNTENTRY.containing_type = _GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1 +_GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1_COUNTENTRY.oneofs_by_name['_in_key'].fields.append( + _GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1_COUNTENTRY.fields_by_name['in_key']) +_GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1_COUNTENTRY.fields_by_name['in_key'].containing_oneof = _GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1_COUNTENTRY.oneofs_by_name['_in_key'] +_GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1_COUNTENTRIES.fields_by_name['entries'].message_type = _GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1_COUNTENTRY +_GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1_COUNTENTRIES.containing_type = _GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1 +_GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1_COUNTRESULTS.fields_by_name['entries'].message_type = _GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1_COUNTENTRIES +_GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1_COUNTRESULTS.containing_type = _GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1 +_GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1_COUNTRESULTS.oneofs_by_name['variant'].fields.append( + _GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1_COUNTRESULTS.fields_by_name['aggregate_count']) +_GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1_COUNTRESULTS.fields_by_name['aggregate_count'].containing_oneof = _GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1_COUNTRESULTS.oneofs_by_name['variant'] +_GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1_COUNTRESULTS.oneofs_by_name['variant'].fields.append( + _GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1_COUNTRESULTS.fields_by_name['entries']) +_GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1_COUNTRESULTS.fields_by_name['entries'].containing_oneof = _GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1_COUNTRESULTS.oneofs_by_name['variant'] +_GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1_RESULTDATA.fields_by_name['documents'].message_type = _GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1_DOCUMENTS +_GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1_RESULTDATA.fields_by_name['counts'].message_type = _GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1_COUNTRESULTS +_GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1_RESULTDATA.containing_type = _GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1 +_GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1_RESULTDATA.oneofs_by_name['variant'].fields.append( + _GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1_RESULTDATA.fields_by_name['documents']) +_GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1_RESULTDATA.fields_by_name['documents'].containing_oneof = _GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1_RESULTDATA.oneofs_by_name['variant'] +_GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1_RESULTDATA.oneofs_by_name['variant'].fields.append( + _GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1_RESULTDATA.fields_by_name['counts']) +_GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1_RESULTDATA.fields_by_name['counts'].containing_oneof = _GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1_RESULTDATA.oneofs_by_name['variant'] +_GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1.fields_by_name['data'].message_type = _GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1_RESULTDATA +_GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1.fields_by_name['proof'].message_type = _PROOF +_GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1.fields_by_name['metadata'].message_type = _RESPONSEMETADATA +_GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1.containing_type = _GETDOCUMENTSRESPONSE +_GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1.oneofs_by_name['result'].fields.append( + _GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1.fields_by_name['data']) +_GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1.fields_by_name['data'].containing_oneof = _GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1.oneofs_by_name['result'] +_GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1.oneofs_by_name['result'].fields.append( + _GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1.fields_by_name['proof']) +_GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1.fields_by_name['proof'].containing_oneof = _GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1.oneofs_by_name['result'] _GETDOCUMENTSRESPONSE.fields_by_name['v0'].message_type = _GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV0 +_GETDOCUMENTSRESPONSE.fields_by_name['v1'].message_type = _GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1 _GETDOCUMENTSRESPONSE.oneofs_by_name['version'].fields.append( _GETDOCUMENTSRESPONSE.fields_by_name['v0']) _GETDOCUMENTSRESPONSE.fields_by_name['v0'].containing_oneof = _GETDOCUMENTSRESPONSE.oneofs_by_name['version'] -_GETDOCUMENTSCOUNTREQUEST_GETDOCUMENTSCOUNTREQUESTV0.containing_type = _GETDOCUMENTSCOUNTREQUEST -_GETDOCUMENTSCOUNTREQUEST_GETDOCUMENTSCOUNTREQUESTV0.oneofs_by_name['_limit'].fields.append( - _GETDOCUMENTSCOUNTREQUEST_GETDOCUMENTSCOUNTREQUESTV0.fields_by_name['limit']) -_GETDOCUMENTSCOUNTREQUEST_GETDOCUMENTSCOUNTREQUESTV0.fields_by_name['limit'].containing_oneof = _GETDOCUMENTSCOUNTREQUEST_GETDOCUMENTSCOUNTREQUESTV0.oneofs_by_name['_limit'] -_GETDOCUMENTSCOUNTREQUEST.fields_by_name['v0'].message_type = _GETDOCUMENTSCOUNTREQUEST_GETDOCUMENTSCOUNTREQUESTV0 -_GETDOCUMENTSCOUNTREQUEST.oneofs_by_name['version'].fields.append( - _GETDOCUMENTSCOUNTREQUEST.fields_by_name['v0']) -_GETDOCUMENTSCOUNTREQUEST.fields_by_name['v0'].containing_oneof = _GETDOCUMENTSCOUNTREQUEST.oneofs_by_name['version'] -_GETDOCUMENTSCOUNTRESPONSE_GETDOCUMENTSCOUNTRESPONSEV0_COUNTENTRY.containing_type = _GETDOCUMENTSCOUNTRESPONSE_GETDOCUMENTSCOUNTRESPONSEV0 -_GETDOCUMENTSCOUNTRESPONSE_GETDOCUMENTSCOUNTRESPONSEV0_COUNTENTRY.oneofs_by_name['_in_key'].fields.append( - _GETDOCUMENTSCOUNTRESPONSE_GETDOCUMENTSCOUNTRESPONSEV0_COUNTENTRY.fields_by_name['in_key']) -_GETDOCUMENTSCOUNTRESPONSE_GETDOCUMENTSCOUNTRESPONSEV0_COUNTENTRY.fields_by_name['in_key'].containing_oneof = _GETDOCUMENTSCOUNTRESPONSE_GETDOCUMENTSCOUNTRESPONSEV0_COUNTENTRY.oneofs_by_name['_in_key'] -_GETDOCUMENTSCOUNTRESPONSE_GETDOCUMENTSCOUNTRESPONSEV0_COUNTENTRIES.fields_by_name['entries'].message_type = _GETDOCUMENTSCOUNTRESPONSE_GETDOCUMENTSCOUNTRESPONSEV0_COUNTENTRY -_GETDOCUMENTSCOUNTRESPONSE_GETDOCUMENTSCOUNTRESPONSEV0_COUNTENTRIES.containing_type = _GETDOCUMENTSCOUNTRESPONSE_GETDOCUMENTSCOUNTRESPONSEV0 -_GETDOCUMENTSCOUNTRESPONSE_GETDOCUMENTSCOUNTRESPONSEV0_COUNTRESULTS.fields_by_name['entries'].message_type = _GETDOCUMENTSCOUNTRESPONSE_GETDOCUMENTSCOUNTRESPONSEV0_COUNTENTRIES -_GETDOCUMENTSCOUNTRESPONSE_GETDOCUMENTSCOUNTRESPONSEV0_COUNTRESULTS.containing_type = _GETDOCUMENTSCOUNTRESPONSE_GETDOCUMENTSCOUNTRESPONSEV0 -_GETDOCUMENTSCOUNTRESPONSE_GETDOCUMENTSCOUNTRESPONSEV0_COUNTRESULTS.oneofs_by_name['variant'].fields.append( - _GETDOCUMENTSCOUNTRESPONSE_GETDOCUMENTSCOUNTRESPONSEV0_COUNTRESULTS.fields_by_name['aggregate_count']) -_GETDOCUMENTSCOUNTRESPONSE_GETDOCUMENTSCOUNTRESPONSEV0_COUNTRESULTS.fields_by_name['aggregate_count'].containing_oneof = _GETDOCUMENTSCOUNTRESPONSE_GETDOCUMENTSCOUNTRESPONSEV0_COUNTRESULTS.oneofs_by_name['variant'] -_GETDOCUMENTSCOUNTRESPONSE_GETDOCUMENTSCOUNTRESPONSEV0_COUNTRESULTS.oneofs_by_name['variant'].fields.append( - _GETDOCUMENTSCOUNTRESPONSE_GETDOCUMENTSCOUNTRESPONSEV0_COUNTRESULTS.fields_by_name['entries']) -_GETDOCUMENTSCOUNTRESPONSE_GETDOCUMENTSCOUNTRESPONSEV0_COUNTRESULTS.fields_by_name['entries'].containing_oneof = _GETDOCUMENTSCOUNTRESPONSE_GETDOCUMENTSCOUNTRESPONSEV0_COUNTRESULTS.oneofs_by_name['variant'] -_GETDOCUMENTSCOUNTRESPONSE_GETDOCUMENTSCOUNTRESPONSEV0.fields_by_name['counts'].message_type = _GETDOCUMENTSCOUNTRESPONSE_GETDOCUMENTSCOUNTRESPONSEV0_COUNTRESULTS -_GETDOCUMENTSCOUNTRESPONSE_GETDOCUMENTSCOUNTRESPONSEV0.fields_by_name['proof'].message_type = _PROOF -_GETDOCUMENTSCOUNTRESPONSE_GETDOCUMENTSCOUNTRESPONSEV0.fields_by_name['metadata'].message_type = _RESPONSEMETADATA -_GETDOCUMENTSCOUNTRESPONSE_GETDOCUMENTSCOUNTRESPONSEV0.containing_type = _GETDOCUMENTSCOUNTRESPONSE -_GETDOCUMENTSCOUNTRESPONSE_GETDOCUMENTSCOUNTRESPONSEV0.oneofs_by_name['result'].fields.append( - _GETDOCUMENTSCOUNTRESPONSE_GETDOCUMENTSCOUNTRESPONSEV0.fields_by_name['counts']) -_GETDOCUMENTSCOUNTRESPONSE_GETDOCUMENTSCOUNTRESPONSEV0.fields_by_name['counts'].containing_oneof = _GETDOCUMENTSCOUNTRESPONSE_GETDOCUMENTSCOUNTRESPONSEV0.oneofs_by_name['result'] -_GETDOCUMENTSCOUNTRESPONSE_GETDOCUMENTSCOUNTRESPONSEV0.oneofs_by_name['result'].fields.append( - _GETDOCUMENTSCOUNTRESPONSE_GETDOCUMENTSCOUNTRESPONSEV0.fields_by_name['proof']) -_GETDOCUMENTSCOUNTRESPONSE_GETDOCUMENTSCOUNTRESPONSEV0.fields_by_name['proof'].containing_oneof = _GETDOCUMENTSCOUNTRESPONSE_GETDOCUMENTSCOUNTRESPONSEV0.oneofs_by_name['result'] -_GETDOCUMENTSCOUNTRESPONSE.fields_by_name['v0'].message_type = _GETDOCUMENTSCOUNTRESPONSE_GETDOCUMENTSCOUNTRESPONSEV0 -_GETDOCUMENTSCOUNTRESPONSE.oneofs_by_name['version'].fields.append( - _GETDOCUMENTSCOUNTRESPONSE.fields_by_name['v0']) -_GETDOCUMENTSCOUNTRESPONSE.fields_by_name['v0'].containing_oneof = _GETDOCUMENTSCOUNTRESPONSE.oneofs_by_name['version'] +_GETDOCUMENTSRESPONSE.oneofs_by_name['version'].fields.append( + _GETDOCUMENTSRESPONSE.fields_by_name['v1']) +_GETDOCUMENTSRESPONSE.fields_by_name['v1'].containing_oneof = _GETDOCUMENTSRESPONSE.oneofs_by_name['version'] _GETIDENTITYBYPUBLICKEYHASHREQUEST_GETIDENTITYBYPUBLICKEYHASHREQUESTV0.containing_type = _GETIDENTITYBYPUBLICKEYHASHREQUEST _GETIDENTITYBYPUBLICKEYHASHREQUEST.fields_by_name['v0'].message_type = _GETIDENTITYBYPUBLICKEYHASHREQUEST_GETIDENTITYBYPUBLICKEYHASHREQUESTV0 _GETIDENTITYBYPUBLICKEYHASHREQUEST.oneofs_by_name['version'].fields.append( @@ -18469,8 +18560,6 @@ DESCRIPTOR.message_types_by_name['GetDataContractHistoryResponse'] = _GETDATACONTRACTHISTORYRESPONSE DESCRIPTOR.message_types_by_name['GetDocumentsRequest'] = _GETDOCUMENTSREQUEST DESCRIPTOR.message_types_by_name['GetDocumentsResponse'] = _GETDOCUMENTSRESPONSE -DESCRIPTOR.message_types_by_name['GetDocumentsCountRequest'] = _GETDOCUMENTSCOUNTREQUEST -DESCRIPTOR.message_types_by_name['GetDocumentsCountResponse'] = _GETDOCUMENTSCOUNTRESPONSE DESCRIPTOR.message_types_by_name['GetIdentityByPublicKeyHashRequest'] = _GETIDENTITYBYPUBLICKEYHASHREQUEST DESCRIPTOR.message_types_by_name['GetIdentityByPublicKeyHashResponse'] = _GETIDENTITYBYPUBLICKEYHASHRESPONSE DESCRIPTOR.message_types_by_name['GetIdentityByNonUniquePublicKeyHashRequest'] = _GETIDENTITYBYNONUNIQUEPUBLICKEYHASHREQUEST @@ -19156,12 +19245,20 @@ # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0) }) , + + 'GetDocumentsRequestV1' : _reflection.GeneratedProtocolMessageType('GetDocumentsRequestV1', (_message.Message,), { + 'DESCRIPTOR' : _GETDOCUMENTSREQUEST_GETDOCUMENTSREQUESTV1, + '__module__' : 'platform_pb2' + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1) + }) + , 'DESCRIPTOR' : _GETDOCUMENTSREQUEST, '__module__' : 'platform_pb2' # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetDocumentsRequest) }) _sym_db.RegisterMessage(GetDocumentsRequest) _sym_db.RegisterMessage(GetDocumentsRequest.GetDocumentsRequestV0) +_sym_db.RegisterMessage(GetDocumentsRequest.GetDocumentsRequestV1) GetDocumentsResponse = _reflection.GeneratedProtocolMessageType('GetDocumentsResponse', (_message.Message,), { @@ -19178,67 +19275,61 @@ # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0) }) , - 'DESCRIPTOR' : _GETDOCUMENTSRESPONSE, - '__module__' : 'platform_pb2' - # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetDocumentsResponse) - }) -_sym_db.RegisterMessage(GetDocumentsResponse) -_sym_db.RegisterMessage(GetDocumentsResponse.GetDocumentsResponseV0) -_sym_db.RegisterMessage(GetDocumentsResponse.GetDocumentsResponseV0.Documents) - -GetDocumentsCountRequest = _reflection.GeneratedProtocolMessageType('GetDocumentsCountRequest', (_message.Message,), { - 'GetDocumentsCountRequestV0' : _reflection.GeneratedProtocolMessageType('GetDocumentsCountRequestV0', (_message.Message,), { - 'DESCRIPTOR' : _GETDOCUMENTSCOUNTREQUEST_GETDOCUMENTSCOUNTREQUESTV0, - '__module__' : 'platform_pb2' - # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0) - }) - , - 'DESCRIPTOR' : _GETDOCUMENTSCOUNTREQUEST, - '__module__' : 'platform_pb2' - # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetDocumentsCountRequest) - }) -_sym_db.RegisterMessage(GetDocumentsCountRequest) -_sym_db.RegisterMessage(GetDocumentsCountRequest.GetDocumentsCountRequestV0) + 'GetDocumentsResponseV1' : _reflection.GeneratedProtocolMessageType('GetDocumentsResponseV1', (_message.Message,), { -GetDocumentsCountResponse = _reflection.GeneratedProtocolMessageType('GetDocumentsCountResponse', (_message.Message,), { - - 'GetDocumentsCountResponseV0' : _reflection.GeneratedProtocolMessageType('GetDocumentsCountResponseV0', (_message.Message,), { + 'Documents' : _reflection.GeneratedProtocolMessageType('Documents', (_message.Message,), { + 'DESCRIPTOR' : _GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1_DOCUMENTS, + '__module__' : 'platform_pb2' + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents) + }) + , 'CountEntry' : _reflection.GeneratedProtocolMessageType('CountEntry', (_message.Message,), { - 'DESCRIPTOR' : _GETDOCUMENTSCOUNTRESPONSE_GETDOCUMENTSCOUNTRESPONSEV0_COUNTENTRY, + 'DESCRIPTOR' : _GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1_COUNTENTRY, '__module__' : 'platform_pb2' - # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry) + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry) }) , 'CountEntries' : _reflection.GeneratedProtocolMessageType('CountEntries', (_message.Message,), { - 'DESCRIPTOR' : _GETDOCUMENTSCOUNTRESPONSE_GETDOCUMENTSCOUNTRESPONSEV0_COUNTENTRIES, + 'DESCRIPTOR' : _GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1_COUNTENTRIES, '__module__' : 'platform_pb2' - # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries) + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries) }) , 'CountResults' : _reflection.GeneratedProtocolMessageType('CountResults', (_message.Message,), { - 'DESCRIPTOR' : _GETDOCUMENTSCOUNTRESPONSE_GETDOCUMENTSCOUNTRESPONSEV0_COUNTRESULTS, + 'DESCRIPTOR' : _GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1_COUNTRESULTS, '__module__' : 'platform_pb2' - # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults) + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults) }) , - 'DESCRIPTOR' : _GETDOCUMENTSCOUNTRESPONSE_GETDOCUMENTSCOUNTRESPONSEV0, + + 'ResultData' : _reflection.GeneratedProtocolMessageType('ResultData', (_message.Message,), { + 'DESCRIPTOR' : _GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1_RESULTDATA, + '__module__' : 'platform_pb2' + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData) + }) + , + 'DESCRIPTOR' : _GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1, '__module__' : 'platform_pb2' - # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0) + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1) }) , - 'DESCRIPTOR' : _GETDOCUMENTSCOUNTRESPONSE, + 'DESCRIPTOR' : _GETDOCUMENTSRESPONSE, '__module__' : 'platform_pb2' - # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetDocumentsCountResponse) + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetDocumentsResponse) }) -_sym_db.RegisterMessage(GetDocumentsCountResponse) -_sym_db.RegisterMessage(GetDocumentsCountResponse.GetDocumentsCountResponseV0) -_sym_db.RegisterMessage(GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry) -_sym_db.RegisterMessage(GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries) -_sym_db.RegisterMessage(GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults) +_sym_db.RegisterMessage(GetDocumentsResponse) +_sym_db.RegisterMessage(GetDocumentsResponse.GetDocumentsResponseV0) +_sym_db.RegisterMessage(GetDocumentsResponse.GetDocumentsResponseV0.Documents) +_sym_db.RegisterMessage(GetDocumentsResponse.GetDocumentsResponseV1) +_sym_db.RegisterMessage(GetDocumentsResponse.GetDocumentsResponseV1.Documents) +_sym_db.RegisterMessage(GetDocumentsResponse.GetDocumentsResponseV1.CountEntry) +_sym_db.RegisterMessage(GetDocumentsResponse.GetDocumentsResponseV1.CountEntries) +_sym_db.RegisterMessage(GetDocumentsResponse.GetDocumentsResponseV1.CountResults) +_sym_db.RegisterMessage(GetDocumentsResponse.GetDocumentsResponseV1.ResultData) GetIdentityByPublicKeyHashRequest = _reflection.GeneratedProtocolMessageType('GetIdentityByPublicKeyHashRequest', (_message.Message,), { @@ -21577,8 +21668,8 @@ _GETIDENTITIESBALANCESRESPONSE_GETIDENTITIESBALANCESRESPONSEV0_IDENTITYBALANCE.fields_by_name['balance']._options = None _GETDATACONTRACTHISTORYREQUEST_GETDATACONTRACTHISTORYREQUESTV0.fields_by_name['start_at_ms']._options = None _GETDATACONTRACTHISTORYRESPONSE_GETDATACONTRACTHISTORYRESPONSEV0_DATACONTRACTHISTORYENTRY.fields_by_name['date']._options = None -_GETDOCUMENTSCOUNTRESPONSE_GETDOCUMENTSCOUNTRESPONSEV0_COUNTENTRY.fields_by_name['count']._options = None -_GETDOCUMENTSCOUNTRESPONSE_GETDOCUMENTSCOUNTRESPONSEV0_COUNTRESULTS.fields_by_name['aggregate_count']._options = None +_GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1_COUNTENTRY.fields_by_name['count']._options = None +_GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1_COUNTRESULTS.fields_by_name['aggregate_count']._options = None _GETEPOCHSINFORESPONSE_GETEPOCHSINFORESPONSEV0_EPOCHINFO.fields_by_name['first_block_height']._options = None _GETEPOCHSINFORESPONSE_GETEPOCHSINFORESPONSEV0_EPOCHINFO.fields_by_name['start_time']._options = None _GETFINALIZEDEPOCHINFOSRESPONSE_GETFINALIZEDEPOCHINFOSRESPONSEV0_FINALIZEDEPOCHINFO.fields_by_name['first_block_height']._options = None @@ -21634,8 +21725,8 @@ index=0, serialized_options=None, create_key=_descriptor._internal_create_key, - serialized_start=63419, - serialized_end=72686, + serialized_start=63712, + serialized_end=72851, methods=[ _descriptor.MethodDescriptor( name='broadcastStateTransition', @@ -21787,20 +21878,10 @@ serialized_options=None, create_key=_descriptor._internal_create_key, ), - _descriptor.MethodDescriptor( - name='getDocumentsCount', - full_name='org.dash.platform.dapi.v0.Platform.getDocumentsCount', - index=15, - containing_service=None, - input_type=_GETDOCUMENTSCOUNTREQUEST, - output_type=_GETDOCUMENTSCOUNTRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), _descriptor.MethodDescriptor( name='getIdentityByPublicKeyHash', full_name='org.dash.platform.dapi.v0.Platform.getIdentityByPublicKeyHash', - index=16, + index=15, containing_service=None, input_type=_GETIDENTITYBYPUBLICKEYHASHREQUEST, output_type=_GETIDENTITYBYPUBLICKEYHASHRESPONSE, @@ -21810,7 +21891,7 @@ _descriptor.MethodDescriptor( name='getIdentityByNonUniquePublicKeyHash', full_name='org.dash.platform.dapi.v0.Platform.getIdentityByNonUniquePublicKeyHash', - index=17, + index=16, containing_service=None, input_type=_GETIDENTITYBYNONUNIQUEPUBLICKEYHASHREQUEST, output_type=_GETIDENTITYBYNONUNIQUEPUBLICKEYHASHRESPONSE, @@ -21820,7 +21901,7 @@ _descriptor.MethodDescriptor( name='waitForStateTransitionResult', full_name='org.dash.platform.dapi.v0.Platform.waitForStateTransitionResult', - index=18, + index=17, containing_service=None, input_type=_WAITFORSTATETRANSITIONRESULTREQUEST, output_type=_WAITFORSTATETRANSITIONRESULTRESPONSE, @@ -21830,7 +21911,7 @@ _descriptor.MethodDescriptor( name='getConsensusParams', full_name='org.dash.platform.dapi.v0.Platform.getConsensusParams', - index=19, + index=18, containing_service=None, input_type=_GETCONSENSUSPARAMSREQUEST, output_type=_GETCONSENSUSPARAMSRESPONSE, @@ -21840,7 +21921,7 @@ _descriptor.MethodDescriptor( name='getProtocolVersionUpgradeState', full_name='org.dash.platform.dapi.v0.Platform.getProtocolVersionUpgradeState', - index=20, + index=19, containing_service=None, input_type=_GETPROTOCOLVERSIONUPGRADESTATEREQUEST, output_type=_GETPROTOCOLVERSIONUPGRADESTATERESPONSE, @@ -21850,7 +21931,7 @@ _descriptor.MethodDescriptor( name='getProtocolVersionUpgradeVoteStatus', full_name='org.dash.platform.dapi.v0.Platform.getProtocolVersionUpgradeVoteStatus', - index=21, + index=20, containing_service=None, input_type=_GETPROTOCOLVERSIONUPGRADEVOTESTATUSREQUEST, output_type=_GETPROTOCOLVERSIONUPGRADEVOTESTATUSRESPONSE, @@ -21860,7 +21941,7 @@ _descriptor.MethodDescriptor( name='getEpochsInfo', full_name='org.dash.platform.dapi.v0.Platform.getEpochsInfo', - index=22, + index=21, containing_service=None, input_type=_GETEPOCHSINFOREQUEST, output_type=_GETEPOCHSINFORESPONSE, @@ -21870,7 +21951,7 @@ _descriptor.MethodDescriptor( name='getFinalizedEpochInfos', full_name='org.dash.platform.dapi.v0.Platform.getFinalizedEpochInfos', - index=23, + index=22, containing_service=None, input_type=_GETFINALIZEDEPOCHINFOSREQUEST, output_type=_GETFINALIZEDEPOCHINFOSRESPONSE, @@ -21880,7 +21961,7 @@ _descriptor.MethodDescriptor( name='getContestedResources', full_name='org.dash.platform.dapi.v0.Platform.getContestedResources', - index=24, + index=23, containing_service=None, input_type=_GETCONTESTEDRESOURCESREQUEST, output_type=_GETCONTESTEDRESOURCESRESPONSE, @@ -21890,7 +21971,7 @@ _descriptor.MethodDescriptor( name='getContestedResourceVoteState', full_name='org.dash.platform.dapi.v0.Platform.getContestedResourceVoteState', - index=25, + index=24, containing_service=None, input_type=_GETCONTESTEDRESOURCEVOTESTATEREQUEST, output_type=_GETCONTESTEDRESOURCEVOTESTATERESPONSE, @@ -21900,7 +21981,7 @@ _descriptor.MethodDescriptor( name='getContestedResourceVotersForIdentity', full_name='org.dash.platform.dapi.v0.Platform.getContestedResourceVotersForIdentity', - index=26, + index=25, containing_service=None, input_type=_GETCONTESTEDRESOURCEVOTERSFORIDENTITYREQUEST, output_type=_GETCONTESTEDRESOURCEVOTERSFORIDENTITYRESPONSE, @@ -21910,7 +21991,7 @@ _descriptor.MethodDescriptor( name='getContestedResourceIdentityVotes', full_name='org.dash.platform.dapi.v0.Platform.getContestedResourceIdentityVotes', - index=27, + index=26, containing_service=None, input_type=_GETCONTESTEDRESOURCEIDENTITYVOTESREQUEST, output_type=_GETCONTESTEDRESOURCEIDENTITYVOTESRESPONSE, @@ -21920,7 +22001,7 @@ _descriptor.MethodDescriptor( name='getVotePollsByEndDate', full_name='org.dash.platform.dapi.v0.Platform.getVotePollsByEndDate', - index=28, + index=27, containing_service=None, input_type=_GETVOTEPOLLSBYENDDATEREQUEST, output_type=_GETVOTEPOLLSBYENDDATERESPONSE, @@ -21930,7 +22011,7 @@ _descriptor.MethodDescriptor( name='getPrefundedSpecializedBalance', full_name='org.dash.platform.dapi.v0.Platform.getPrefundedSpecializedBalance', - index=29, + index=28, containing_service=None, input_type=_GETPREFUNDEDSPECIALIZEDBALANCEREQUEST, output_type=_GETPREFUNDEDSPECIALIZEDBALANCERESPONSE, @@ -21940,7 +22021,7 @@ _descriptor.MethodDescriptor( name='getTotalCreditsInPlatform', full_name='org.dash.platform.dapi.v0.Platform.getTotalCreditsInPlatform', - index=30, + index=29, containing_service=None, input_type=_GETTOTALCREDITSINPLATFORMREQUEST, output_type=_GETTOTALCREDITSINPLATFORMRESPONSE, @@ -21950,7 +22031,7 @@ _descriptor.MethodDescriptor( name='getPathElements', full_name='org.dash.platform.dapi.v0.Platform.getPathElements', - index=31, + index=30, containing_service=None, input_type=_GETPATHELEMENTSREQUEST, output_type=_GETPATHELEMENTSRESPONSE, @@ -21960,7 +22041,7 @@ _descriptor.MethodDescriptor( name='getStatus', full_name='org.dash.platform.dapi.v0.Platform.getStatus', - index=32, + index=31, containing_service=None, input_type=_GETSTATUSREQUEST, output_type=_GETSTATUSRESPONSE, @@ -21970,7 +22051,7 @@ _descriptor.MethodDescriptor( name='getCurrentQuorumsInfo', full_name='org.dash.platform.dapi.v0.Platform.getCurrentQuorumsInfo', - index=33, + index=32, containing_service=None, input_type=_GETCURRENTQUORUMSINFOREQUEST, output_type=_GETCURRENTQUORUMSINFORESPONSE, @@ -21980,7 +22061,7 @@ _descriptor.MethodDescriptor( name='getIdentityTokenBalances', full_name='org.dash.platform.dapi.v0.Platform.getIdentityTokenBalances', - index=34, + index=33, containing_service=None, input_type=_GETIDENTITYTOKENBALANCESREQUEST, output_type=_GETIDENTITYTOKENBALANCESRESPONSE, @@ -21990,7 +22071,7 @@ _descriptor.MethodDescriptor( name='getIdentitiesTokenBalances', full_name='org.dash.platform.dapi.v0.Platform.getIdentitiesTokenBalances', - index=35, + index=34, containing_service=None, input_type=_GETIDENTITIESTOKENBALANCESREQUEST, output_type=_GETIDENTITIESTOKENBALANCESRESPONSE, @@ -22000,7 +22081,7 @@ _descriptor.MethodDescriptor( name='getIdentityTokenInfos', full_name='org.dash.platform.dapi.v0.Platform.getIdentityTokenInfos', - index=36, + index=35, containing_service=None, input_type=_GETIDENTITYTOKENINFOSREQUEST, output_type=_GETIDENTITYTOKENINFOSRESPONSE, @@ -22010,7 +22091,7 @@ _descriptor.MethodDescriptor( name='getIdentitiesTokenInfos', full_name='org.dash.platform.dapi.v0.Platform.getIdentitiesTokenInfos', - index=37, + index=36, containing_service=None, input_type=_GETIDENTITIESTOKENINFOSREQUEST, output_type=_GETIDENTITIESTOKENINFOSRESPONSE, @@ -22020,7 +22101,7 @@ _descriptor.MethodDescriptor( name='getTokenStatuses', full_name='org.dash.platform.dapi.v0.Platform.getTokenStatuses', - index=38, + index=37, containing_service=None, input_type=_GETTOKENSTATUSESREQUEST, output_type=_GETTOKENSTATUSESRESPONSE, @@ -22030,7 +22111,7 @@ _descriptor.MethodDescriptor( name='getTokenDirectPurchasePrices', full_name='org.dash.platform.dapi.v0.Platform.getTokenDirectPurchasePrices', - index=39, + index=38, containing_service=None, input_type=_GETTOKENDIRECTPURCHASEPRICESREQUEST, output_type=_GETTOKENDIRECTPURCHASEPRICESRESPONSE, @@ -22040,7 +22121,7 @@ _descriptor.MethodDescriptor( name='getTokenContractInfo', full_name='org.dash.platform.dapi.v0.Platform.getTokenContractInfo', - index=40, + index=39, containing_service=None, input_type=_GETTOKENCONTRACTINFOREQUEST, output_type=_GETTOKENCONTRACTINFORESPONSE, @@ -22050,7 +22131,7 @@ _descriptor.MethodDescriptor( name='getTokenPreProgrammedDistributions', full_name='org.dash.platform.dapi.v0.Platform.getTokenPreProgrammedDistributions', - index=41, + index=40, containing_service=None, input_type=_GETTOKENPREPROGRAMMEDDISTRIBUTIONSREQUEST, output_type=_GETTOKENPREPROGRAMMEDDISTRIBUTIONSRESPONSE, @@ -22060,7 +22141,7 @@ _descriptor.MethodDescriptor( name='getTokenPerpetualDistributionLastClaim', full_name='org.dash.platform.dapi.v0.Platform.getTokenPerpetualDistributionLastClaim', - index=42, + index=41, containing_service=None, input_type=_GETTOKENPERPETUALDISTRIBUTIONLASTCLAIMREQUEST, output_type=_GETTOKENPERPETUALDISTRIBUTIONLASTCLAIMRESPONSE, @@ -22070,7 +22151,7 @@ _descriptor.MethodDescriptor( name='getTokenTotalSupply', full_name='org.dash.platform.dapi.v0.Platform.getTokenTotalSupply', - index=43, + index=42, containing_service=None, input_type=_GETTOKENTOTALSUPPLYREQUEST, output_type=_GETTOKENTOTALSUPPLYRESPONSE, @@ -22080,7 +22161,7 @@ _descriptor.MethodDescriptor( name='getGroupInfo', full_name='org.dash.platform.dapi.v0.Platform.getGroupInfo', - index=44, + index=43, containing_service=None, input_type=_GETGROUPINFOREQUEST, output_type=_GETGROUPINFORESPONSE, @@ -22090,7 +22171,7 @@ _descriptor.MethodDescriptor( name='getGroupInfos', full_name='org.dash.platform.dapi.v0.Platform.getGroupInfos', - index=45, + index=44, containing_service=None, input_type=_GETGROUPINFOSREQUEST, output_type=_GETGROUPINFOSRESPONSE, @@ -22100,7 +22181,7 @@ _descriptor.MethodDescriptor( name='getGroupActions', full_name='org.dash.platform.dapi.v0.Platform.getGroupActions', - index=46, + index=45, containing_service=None, input_type=_GETGROUPACTIONSREQUEST, output_type=_GETGROUPACTIONSRESPONSE, @@ -22110,7 +22191,7 @@ _descriptor.MethodDescriptor( name='getGroupActionSigners', full_name='org.dash.platform.dapi.v0.Platform.getGroupActionSigners', - index=47, + index=46, containing_service=None, input_type=_GETGROUPACTIONSIGNERSREQUEST, output_type=_GETGROUPACTIONSIGNERSRESPONSE, @@ -22120,7 +22201,7 @@ _descriptor.MethodDescriptor( name='getAddressInfo', full_name='org.dash.platform.dapi.v0.Platform.getAddressInfo', - index=48, + index=47, containing_service=None, input_type=_GETADDRESSINFOREQUEST, output_type=_GETADDRESSINFORESPONSE, @@ -22130,7 +22211,7 @@ _descriptor.MethodDescriptor( name='getAddressesInfos', full_name='org.dash.platform.dapi.v0.Platform.getAddressesInfos', - index=49, + index=48, containing_service=None, input_type=_GETADDRESSESINFOSREQUEST, output_type=_GETADDRESSESINFOSRESPONSE, @@ -22140,7 +22221,7 @@ _descriptor.MethodDescriptor( name='getAddressesTrunkState', full_name='org.dash.platform.dapi.v0.Platform.getAddressesTrunkState', - index=50, + index=49, containing_service=None, input_type=_GETADDRESSESTRUNKSTATEREQUEST, output_type=_GETADDRESSESTRUNKSTATERESPONSE, @@ -22150,7 +22231,7 @@ _descriptor.MethodDescriptor( name='getAddressesBranchState', full_name='org.dash.platform.dapi.v0.Platform.getAddressesBranchState', - index=51, + index=50, containing_service=None, input_type=_GETADDRESSESBRANCHSTATEREQUEST, output_type=_GETADDRESSESBRANCHSTATERESPONSE, @@ -22160,7 +22241,7 @@ _descriptor.MethodDescriptor( name='getRecentAddressBalanceChanges', full_name='org.dash.platform.dapi.v0.Platform.getRecentAddressBalanceChanges', - index=52, + index=51, containing_service=None, input_type=_GETRECENTADDRESSBALANCECHANGESREQUEST, output_type=_GETRECENTADDRESSBALANCECHANGESRESPONSE, @@ -22170,7 +22251,7 @@ _descriptor.MethodDescriptor( name='getRecentCompactedAddressBalanceChanges', full_name='org.dash.platform.dapi.v0.Platform.getRecentCompactedAddressBalanceChanges', - index=53, + index=52, containing_service=None, input_type=_GETRECENTCOMPACTEDADDRESSBALANCECHANGESREQUEST, output_type=_GETRECENTCOMPACTEDADDRESSBALANCECHANGESRESPONSE, @@ -22180,7 +22261,7 @@ _descriptor.MethodDescriptor( name='getShieldedEncryptedNotes', full_name='org.dash.platform.dapi.v0.Platform.getShieldedEncryptedNotes', - index=54, + index=53, containing_service=None, input_type=_GETSHIELDEDENCRYPTEDNOTESREQUEST, output_type=_GETSHIELDEDENCRYPTEDNOTESRESPONSE, @@ -22190,7 +22271,7 @@ _descriptor.MethodDescriptor( name='getShieldedAnchors', full_name='org.dash.platform.dapi.v0.Platform.getShieldedAnchors', - index=55, + index=54, containing_service=None, input_type=_GETSHIELDEDANCHORSREQUEST, output_type=_GETSHIELDEDANCHORSRESPONSE, @@ -22200,7 +22281,7 @@ _descriptor.MethodDescriptor( name='getMostRecentShieldedAnchor', full_name='org.dash.platform.dapi.v0.Platform.getMostRecentShieldedAnchor', - index=56, + index=55, containing_service=None, input_type=_GETMOSTRECENTSHIELDEDANCHORREQUEST, output_type=_GETMOSTRECENTSHIELDEDANCHORRESPONSE, @@ -22210,7 +22291,7 @@ _descriptor.MethodDescriptor( name='getShieldedPoolState', full_name='org.dash.platform.dapi.v0.Platform.getShieldedPoolState', - index=57, + index=56, containing_service=None, input_type=_GETSHIELDEDPOOLSTATEREQUEST, output_type=_GETSHIELDEDPOOLSTATERESPONSE, @@ -22220,7 +22301,7 @@ _descriptor.MethodDescriptor( name='getShieldedNullifiers', full_name='org.dash.platform.dapi.v0.Platform.getShieldedNullifiers', - index=58, + index=57, containing_service=None, input_type=_GETSHIELDEDNULLIFIERSREQUEST, output_type=_GETSHIELDEDNULLIFIERSRESPONSE, @@ -22230,7 +22311,7 @@ _descriptor.MethodDescriptor( name='getNullifiersTrunkState', full_name='org.dash.platform.dapi.v0.Platform.getNullifiersTrunkState', - index=59, + index=58, containing_service=None, input_type=_GETNULLIFIERSTRUNKSTATEREQUEST, output_type=_GETNULLIFIERSTRUNKSTATERESPONSE, @@ -22240,7 +22321,7 @@ _descriptor.MethodDescriptor( name='getNullifiersBranchState', full_name='org.dash.platform.dapi.v0.Platform.getNullifiersBranchState', - index=60, + index=59, containing_service=None, input_type=_GETNULLIFIERSBRANCHSTATEREQUEST, output_type=_GETNULLIFIERSBRANCHSTATERESPONSE, @@ -22250,7 +22331,7 @@ _descriptor.MethodDescriptor( name='getRecentNullifierChanges', full_name='org.dash.platform.dapi.v0.Platform.getRecentNullifierChanges', - index=61, + index=60, containing_service=None, input_type=_GETRECENTNULLIFIERCHANGESREQUEST, output_type=_GETRECENTNULLIFIERCHANGESRESPONSE, @@ -22260,7 +22341,7 @@ _descriptor.MethodDescriptor( name='getRecentCompactedNullifierChanges', full_name='org.dash.platform.dapi.v0.Platform.getRecentCompactedNullifierChanges', - index=62, + index=61, containing_service=None, input_type=_GETRECENTCOMPACTEDNULLIFIERCHANGESREQUEST, output_type=_GETRECENTCOMPACTEDNULLIFIERCHANGESRESPONSE, 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 281b978988d..20c35720dc1 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 @@ -89,11 +89,6 @@ def __init__(self, channel): request_serializer=platform__pb2.GetDocumentsRequest.SerializeToString, response_deserializer=platform__pb2.GetDocumentsResponse.FromString, ) - self.getDocumentsCount = channel.unary_unary( - '/org.dash.platform.dapi.v0.Platform/getDocumentsCount', - request_serializer=platform__pb2.GetDocumentsCountRequest.SerializeToString, - response_deserializer=platform__pb2.GetDocumentsCountResponse.FromString, - ) self.getIdentityByPublicKeyHash = channel.unary_unary( '/org.dash.platform.dapi.v0.Platform/getIdentityByPublicKeyHash', request_serializer=platform__pb2.GetIdentityByPublicKeyHashRequest.SerializeToString, @@ -425,14 +420,13 @@ def getDocuments(self, request, context): context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') - def getDocumentsCount(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 getIdentityByPublicKeyHash(self, request, context): - """Missing associated documentation comment in .proto file.""" + """`getDocumentsCount` removed in v1: callers express counts via + `getDocuments` with `version.v1.select = COUNT` (optionally + with `group_by`). See `GetDocumentsRequestV1` for the unified + SQL-shaped surface. The v0-count endpoint shipped briefly in + #3623 and never had stable callers; v1 supersedes it entirely. + """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') @@ -797,11 +791,6 @@ def add_PlatformServicer_to_server(servicer, server): request_deserializer=platform__pb2.GetDocumentsRequest.FromString, response_serializer=platform__pb2.GetDocumentsResponse.SerializeToString, ), - 'getDocumentsCount': grpc.unary_unary_rpc_method_handler( - servicer.getDocumentsCount, - request_deserializer=platform__pb2.GetDocumentsCountRequest.FromString, - response_serializer=platform__pb2.GetDocumentsCountResponse.SerializeToString, - ), 'getIdentityByPublicKeyHash': grpc.unary_unary_rpc_method_handler( servicer.getIdentityByPublicKeyHash, request_deserializer=platform__pb2.GetIdentityByPublicKeyHashRequest.FromString, @@ -1302,23 +1291,6 @@ def getDocuments(request, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - @staticmethod - def getDocumentsCount(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/getDocumentsCount', - platform__pb2.GetDocumentsCountRequest.SerializeToString, - platform__pb2.GetDocumentsCountResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - @staticmethod def getIdentityByPublicKeyHash(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 55dd228abc7..c977b021788 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 @@ -2250,6 +2250,11 @@ export class GetDocumentsRequest extends jspb.Message { getV0(): GetDocumentsRequest.GetDocumentsRequestV0 | undefined; setV0(value?: GetDocumentsRequest.GetDocumentsRequestV0): void; + hasV1(): boolean; + clearV1(): void; + getV1(): GetDocumentsRequest.GetDocumentsRequestV1 | undefined; + setV1(value?: GetDocumentsRequest.GetDocumentsRequestV1): void; + getVersionCase(): GetDocumentsRequest.VersionCase; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): GetDocumentsRequest.AsObject; @@ -2264,6 +2269,7 @@ export class GetDocumentsRequest extends jspb.Message { export namespace GetDocumentsRequest { export type AsObject = { v0?: GetDocumentsRequest.GetDocumentsRequestV0.AsObject, + v1?: GetDocumentsRequest.GetDocumentsRequestV1.AsObject, } export class GetDocumentsRequestV0 extends jspb.Message { @@ -2335,9 +2341,104 @@ export namespace GetDocumentsRequest { } } + export class GetDocumentsRequestV1 extends jspb.Message { + getDataContractId(): Uint8Array | string; + getDataContractId_asU8(): Uint8Array; + getDataContractId_asB64(): string; + setDataContractId(value: Uint8Array | string): void; + + getDocumentType(): string; + setDocumentType(value: string): void; + + getWhere(): Uint8Array | string; + getWhere_asU8(): Uint8Array; + getWhere_asB64(): string; + setWhere(value: Uint8Array | string): void; + + getOrderBy(): Uint8Array | string; + getOrderBy_asU8(): Uint8Array; + getOrderBy_asB64(): string; + setOrderBy(value: Uint8Array | string): void; + + hasLimit(): boolean; + clearLimit(): void; + getLimit(): number; + setLimit(value: number): void; + + hasStartAfter(): boolean; + clearStartAfter(): void; + getStartAfter(): Uint8Array | string; + getStartAfter_asU8(): Uint8Array; + getStartAfter_asB64(): string; + setStartAfter(value: Uint8Array | string): void; + + hasStartAt(): boolean; + clearStartAt(): void; + getStartAt(): Uint8Array | string; + getStartAt_asU8(): Uint8Array; + getStartAt_asB64(): string; + setStartAt(value: Uint8Array | string): void; + + getProve(): boolean; + setProve(value: boolean): void; + + getSelect(): GetDocumentsRequest.GetDocumentsRequestV1.SelectMap[keyof GetDocumentsRequest.GetDocumentsRequestV1.SelectMap]; + setSelect(value: GetDocumentsRequest.GetDocumentsRequestV1.SelectMap[keyof GetDocumentsRequest.GetDocumentsRequestV1.SelectMap]): void; + + clearGroupByList(): void; + getGroupByList(): Array; + setGroupByList(value: Array): void; + addGroupBy(value: string, index?: number): string; + + getHaving(): Uint8Array | string; + getHaving_asU8(): Uint8Array; + getHaving_asB64(): string; + setHaving(value: Uint8Array | string): void; + + getStartCase(): GetDocumentsRequestV1.StartCase; + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): GetDocumentsRequestV1.AsObject; + static toObject(includeInstance: boolean, msg: GetDocumentsRequestV1): GetDocumentsRequestV1.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: GetDocumentsRequestV1, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): GetDocumentsRequestV1; + static deserializeBinaryFromReader(message: GetDocumentsRequestV1, reader: jspb.BinaryReader): GetDocumentsRequestV1; + } + + export namespace GetDocumentsRequestV1 { + export type AsObject = { + dataContractId: Uint8Array | string, + documentType: string, + where: Uint8Array | string, + orderBy: Uint8Array | string, + limit: number, + startAfter: Uint8Array | string, + startAt: Uint8Array | string, + prove: boolean, + select: GetDocumentsRequest.GetDocumentsRequestV1.SelectMap[keyof GetDocumentsRequest.GetDocumentsRequestV1.SelectMap], + groupByList: Array, + having: Uint8Array | string, + } + + export interface SelectMap { + DOCUMENTS: 0; + COUNT: 1; + } + + export const Select: SelectMap; + + export enum StartCase { + START_NOT_SET = 0, + START_AFTER = 6, + START_AT = 7, + } + } + export enum VersionCase { VERSION_NOT_SET = 0, V0 = 1, + V1 = 2, } } @@ -2347,6 +2448,11 @@ export class GetDocumentsResponse extends jspb.Message { getV0(): GetDocumentsResponse.GetDocumentsResponseV0 | undefined; setV0(value?: GetDocumentsResponse.GetDocumentsResponseV0): void; + hasV1(): boolean; + clearV1(): void; + getV1(): GetDocumentsResponse.GetDocumentsResponseV1 | undefined; + setV1(value?: GetDocumentsResponse.GetDocumentsResponseV1): void; + getVersionCase(): GetDocumentsResponse.VersionCase; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): GetDocumentsResponse.AsObject; @@ -2361,6 +2467,7 @@ export class GetDocumentsResponse extends jspb.Message { export namespace GetDocumentsResponse { export type AsObject = { v0?: GetDocumentsResponse.GetDocumentsResponseV0.AsObject, + v1?: GetDocumentsResponse.GetDocumentsResponseV1.AsObject, } export class GetDocumentsResponseV0 extends jspb.Message { @@ -2428,119 +2535,11 @@ export namespace GetDocumentsResponse { } } - export enum VersionCase { - VERSION_NOT_SET = 0, - V0 = 1, - } -} - -export class GetDocumentsCountRequest extends jspb.Message { - hasV0(): boolean; - clearV0(): void; - getV0(): GetDocumentsCountRequest.GetDocumentsCountRequestV0 | undefined; - setV0(value?: GetDocumentsCountRequest.GetDocumentsCountRequestV0): void; - - getVersionCase(): GetDocumentsCountRequest.VersionCase; - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): GetDocumentsCountRequest.AsObject; - static toObject(includeInstance: boolean, msg: GetDocumentsCountRequest): GetDocumentsCountRequest.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: GetDocumentsCountRequest, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): GetDocumentsCountRequest; - static deserializeBinaryFromReader(message: GetDocumentsCountRequest, reader: jspb.BinaryReader): GetDocumentsCountRequest; -} - -export namespace GetDocumentsCountRequest { - export type AsObject = { - v0?: GetDocumentsCountRequest.GetDocumentsCountRequestV0.AsObject, - } - - export class GetDocumentsCountRequestV0 extends jspb.Message { - getDataContractId(): Uint8Array | string; - getDataContractId_asU8(): Uint8Array; - getDataContractId_asB64(): string; - setDataContractId(value: Uint8Array | string): void; - - getDocumentType(): string; - setDocumentType(value: string): void; - - getWhere(): Uint8Array | string; - getWhere_asU8(): Uint8Array; - getWhere_asB64(): string; - setWhere(value: Uint8Array | string): void; - - getReturnDistinctCountsInRange(): boolean; - setReturnDistinctCountsInRange(value: boolean): void; - - getOrderBy(): Uint8Array | string; - getOrderBy_asU8(): Uint8Array; - getOrderBy_asB64(): string; - setOrderBy(value: Uint8Array | string): void; - - hasLimit(): boolean; - clearLimit(): void; - getLimit(): number; - setLimit(value: number): void; - - getProve(): boolean; - setProve(value: boolean): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): GetDocumentsCountRequestV0.AsObject; - static toObject(includeInstance: boolean, msg: GetDocumentsCountRequestV0): GetDocumentsCountRequestV0.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: GetDocumentsCountRequestV0, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): GetDocumentsCountRequestV0; - static deserializeBinaryFromReader(message: GetDocumentsCountRequestV0, reader: jspb.BinaryReader): GetDocumentsCountRequestV0; - } - - export namespace GetDocumentsCountRequestV0 { - export type AsObject = { - dataContractId: Uint8Array | string, - documentType: string, - where: Uint8Array | string, - returnDistinctCountsInRange: boolean, - orderBy: Uint8Array | string, - limit: number, - prove: boolean, - } - } - - export enum VersionCase { - VERSION_NOT_SET = 0, - V0 = 1, - } -} - -export class GetDocumentsCountResponse extends jspb.Message { - hasV0(): boolean; - clearV0(): void; - getV0(): GetDocumentsCountResponse.GetDocumentsCountResponseV0 | undefined; - setV0(value?: GetDocumentsCountResponse.GetDocumentsCountResponseV0): void; - - getVersionCase(): GetDocumentsCountResponse.VersionCase; - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): GetDocumentsCountResponse.AsObject; - static toObject(includeInstance: boolean, msg: GetDocumentsCountResponse): GetDocumentsCountResponse.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: GetDocumentsCountResponse, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): GetDocumentsCountResponse; - static deserializeBinaryFromReader(message: GetDocumentsCountResponse, reader: jspb.BinaryReader): GetDocumentsCountResponse; -} - -export namespace GetDocumentsCountResponse { - export type AsObject = { - v0?: GetDocumentsCountResponse.GetDocumentsCountResponseV0.AsObject, - } - - export class GetDocumentsCountResponseV0 extends jspb.Message { - hasCounts(): boolean; - clearCounts(): void; - getCounts(): GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults | undefined; - setCounts(value?: GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults): void; + export class GetDocumentsResponseV1 extends jspb.Message { + hasData(): boolean; + clearData(): void; + getData(): GetDocumentsResponse.GetDocumentsResponseV1.ResultData | undefined; + setData(value?: GetDocumentsResponse.GetDocumentsResponseV1.ResultData): void; hasProof(): boolean; clearProof(): void; @@ -2552,24 +2551,48 @@ export namespace GetDocumentsCountResponse { getMetadata(): ResponseMetadata | undefined; setMetadata(value?: ResponseMetadata): void; - getResultCase(): GetDocumentsCountResponseV0.ResultCase; + getResultCase(): GetDocumentsResponseV1.ResultCase; serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): GetDocumentsCountResponseV0.AsObject; - static toObject(includeInstance: boolean, msg: GetDocumentsCountResponseV0): GetDocumentsCountResponseV0.AsObject; + toObject(includeInstance?: boolean): GetDocumentsResponseV1.AsObject; + static toObject(includeInstance: boolean, msg: GetDocumentsResponseV1): GetDocumentsResponseV1.AsObject; static extensions: {[key: number]: jspb.ExtensionFieldInfo}; static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: GetDocumentsCountResponseV0, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): GetDocumentsCountResponseV0; - static deserializeBinaryFromReader(message: GetDocumentsCountResponseV0, reader: jspb.BinaryReader): GetDocumentsCountResponseV0; + static serializeBinaryToWriter(message: GetDocumentsResponseV1, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): GetDocumentsResponseV1; + static deserializeBinaryFromReader(message: GetDocumentsResponseV1, reader: jspb.BinaryReader): GetDocumentsResponseV1; } - export namespace GetDocumentsCountResponseV0 { + export namespace GetDocumentsResponseV1 { export type AsObject = { - counts?: GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.AsObject, + data?: GetDocumentsResponse.GetDocumentsResponseV1.ResultData.AsObject, proof?: Proof.AsObject, metadata?: ResponseMetadata.AsObject, } + export class Documents extends jspb.Message { + clearDocumentsList(): void; + getDocumentsList(): Array; + getDocumentsList_asU8(): Array; + getDocumentsList_asB64(): Array; + setDocumentsList(value: Array): void; + addDocuments(value: Uint8Array | string, index?: number): Uint8Array | string; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Documents.AsObject; + static toObject(includeInstance: boolean, msg: Documents): Documents.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: Documents, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Documents; + static deserializeBinaryFromReader(message: Documents, reader: jspb.BinaryReader): Documents; + } + + export namespace Documents { + export type AsObject = { + documentsList: Array, + } + } + export class CountEntry extends jspb.Message { hasInKey(): boolean; clearInKey(): void; @@ -2606,9 +2629,9 @@ export namespace GetDocumentsCountResponse { export class CountEntries extends jspb.Message { clearEntriesList(): void; - getEntriesList(): Array; - setEntriesList(value: Array): void; - addEntries(value?: GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry, index?: number): GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry; + getEntriesList(): Array; + setEntriesList(value: Array): void; + addEntries(value?: GetDocumentsResponse.GetDocumentsResponseV1.CountEntry, index?: number): GetDocumentsResponse.GetDocumentsResponseV1.CountEntry; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): CountEntries.AsObject; @@ -2622,7 +2645,7 @@ export namespace GetDocumentsCountResponse { export namespace CountEntries { export type AsObject = { - entriesList: Array, + entriesList: Array, } } @@ -2634,8 +2657,8 @@ export namespace GetDocumentsCountResponse { hasEntries(): boolean; clearEntries(): void; - getEntries(): GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries | undefined; - setEntries(value?: GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries): void; + getEntries(): GetDocumentsResponse.GetDocumentsResponseV1.CountEntries | undefined; + setEntries(value?: GetDocumentsResponse.GetDocumentsResponseV1.CountEntries): void; getVariantCase(): CountResults.VariantCase; serializeBinary(): Uint8Array; @@ -2651,7 +2674,7 @@ export namespace GetDocumentsCountResponse { export namespace CountResults { export type AsObject = { aggregateCount: string, - entries?: GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries.AsObject, + entries?: GetDocumentsResponse.GetDocumentsResponseV1.CountEntries.AsObject, } export enum VariantCase { @@ -2661,9 +2684,44 @@ export namespace GetDocumentsCountResponse { } } + export class ResultData extends jspb.Message { + hasDocuments(): boolean; + clearDocuments(): void; + getDocuments(): GetDocumentsResponse.GetDocumentsResponseV1.Documents | undefined; + setDocuments(value?: GetDocumentsResponse.GetDocumentsResponseV1.Documents): void; + + hasCounts(): boolean; + clearCounts(): void; + getCounts(): GetDocumentsResponse.GetDocumentsResponseV1.CountResults | undefined; + setCounts(value?: GetDocumentsResponse.GetDocumentsResponseV1.CountResults): void; + + getVariantCase(): ResultData.VariantCase; + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ResultData.AsObject; + static toObject(includeInstance: boolean, msg: ResultData): ResultData.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ResultData, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ResultData; + static deserializeBinaryFromReader(message: ResultData, reader: jspb.BinaryReader): ResultData; + } + + export namespace ResultData { + export type AsObject = { + documents?: GetDocumentsResponse.GetDocumentsResponseV1.Documents.AsObject, + counts?: GetDocumentsResponse.GetDocumentsResponseV1.CountResults.AsObject, + } + + export enum VariantCase { + VARIANT_NOT_SET = 0, + DOCUMENTS = 1, + COUNTS = 2, + } + } + export enum ResultCase { RESULT_NOT_SET = 0, - COUNTS = 1, + DATA = 1, PROOF = 2, } } @@ -2671,6 +2729,7 @@ export namespace GetDocumentsCountResponse { export enum VersionCase { VERSION_NOT_SET = 0, V0 = 1, + V1 = 2, } } 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 d70c2e95669..7e9deb3b0c3 100644 --- a/packages/dapi-grpc/clients/platform/v0/web/platform_pb.js +++ b/packages/dapi-grpc/clients/platform/v0/web/platform_pb.js @@ -150,25 +150,26 @@ goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractsResponse.Data goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0.ResultCase', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractsResponse.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.VariantCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.ResultCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.VersionCase', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsRequest', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0.StartCase', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.Select', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.StartCase', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsRequest.VersionCase', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsResponse', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.ResultCase', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.VariantCase', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultCase', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.VariantCase', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsResponse.VersionCase', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetEpochsInfoRequest', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0', null, { proto }); @@ -2193,16 +2194,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.oneofGroups_); +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1 = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.repeatedFields_, proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.oneofGroups_); }; -goog.inherits(proto.org.dash.platform.dapi.v0.GetDocumentsResponse, jspb.Message); +goog.inherits(proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.org.dash.platform.dapi.v0.GetDocumentsResponse.displayName = 'proto.org.dash.platform.dapi.v0.GetDocumentsResponse'; + proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.displayName = 'proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1'; } /** * Generated by JsPbCodeGenerator. @@ -2214,16 +2215,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.oneofGroups_); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.oneofGroups_); }; -goog.inherits(proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0, jspb.Message); +goog.inherits(proto.org.dash.platform.dapi.v0.GetDocumentsResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.displayName = 'proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0'; + proto.org.dash.platform.dapi.v0.GetDocumentsResponse.displayName = 'proto.org.dash.platform.dapi.v0.GetDocumentsResponse'; } /** * Generated by JsPbCodeGenerator. @@ -2235,16 +2236,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.repeatedFields_, null); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.oneofGroups_); }; -goog.inherits(proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents, jspb.Message); +goog.inherits(proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.displayName = 'proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents'; + proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.displayName = 'proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0'; } /** * Generated by JsPbCodeGenerator. @@ -2256,16 +2257,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.oneofGroups_); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.repeatedFields_, null); }; -goog.inherits(proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest, jspb.Message); +goog.inherits(proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.displayName = 'proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest'; + proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.displayName = 'proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents'; } /** * Generated by JsPbCodeGenerator. @@ -2277,16 +2278,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0 = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1 = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.oneofGroups_); }; -goog.inherits(proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0, jspb.Message); +goog.inherits(proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.displayName = 'proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0'; + proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.displayName = 'proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1'; } /** * Generated by JsPbCodeGenerator. @@ -2298,16 +2299,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.oneofGroups_); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents.repeatedFields_, null); }; -goog.inherits(proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse, jspb.Message); +goog.inherits(proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.displayName = 'proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse'; + proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents.displayName = 'proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents'; } /** * Generated by JsPbCodeGenerator. @@ -2319,16 +2320,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0 = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.oneofGroups_); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0, jspb.Message); +goog.inherits(proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.displayName = 'proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0'; + proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry.displayName = 'proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry'; } /** * Generated by JsPbCodeGenerator. @@ -2340,16 +2341,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries.repeatedFields_, null); }; -goog.inherits(proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry, jspb.Message); +goog.inherits(proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry.displayName = 'proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry'; + proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries.displayName = 'proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries'; } /** * Generated by JsPbCodeGenerator. @@ -2361,16 +2362,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries.repeatedFields_, null); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.oneofGroups_); }; -goog.inherits(proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries, jspb.Message); +goog.inherits(proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries.displayName = 'proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries'; + proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.displayName = 'proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults'; } /** * Generated by JsPbCodeGenerator. @@ -2382,16 +2383,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.oneofGroups_); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.oneofGroups_); }; -goog.inherits(proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults, jspb.Message); +goog.inherits(proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.displayName = 'proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults'; + proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.displayName = 'proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData'; } /** * Generated by JsPbCodeGenerator. @@ -24092,14 +24093,15 @@ proto.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.prototype.hasV0 = * @private {!Array>} * @const */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.oneofGroups_ = [[1]]; +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.oneofGroups_ = [[1,2]]; /** * @enum {number} */ proto.org.dash.platform.dapi.v0.GetDocumentsRequest.VersionCase = { VERSION_NOT_SET: 0, - V0: 1 + V0: 1, + V1: 2 }; /** @@ -24140,7 +24142,8 @@ proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.toObject = functio */ proto.org.dash.platform.dapi.v0.GetDocumentsRequest.toObject = function(includeInstance, msg) { var f, obj = { - v0: (f = msg.getV0()) && proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0.toObject(includeInstance, f) + v0: (f = msg.getV0()) && proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0.toObject(includeInstance, f), + v1: (f = msg.getV1()) && proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.toObject(includeInstance, f) }; if (includeInstance) { @@ -24182,6 +24185,11 @@ proto.org.dash.platform.dapi.v0.GetDocumentsRequest.deserializeBinaryFromReader reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0.deserializeBinaryFromReader); msg.setV0(value); break; + case 2: + var value = new proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.deserializeBinaryFromReader); + msg.setV1(value); + break; default: reader.skipField(); break; @@ -24219,6 +24227,14 @@ proto.org.dash.platform.dapi.v0.GetDocumentsRequest.serializeBinaryToWriter = fu proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0.serializeBinaryToWriter ); } + f = message.getV1(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.serializeBinaryToWriter + ); + } }; @@ -24744,43 +24760,13 @@ proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0.protot }; -/** - * optional GetDocumentsRequestV0 v0 = 1; - * @return {?proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0} - */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getV0 = function() { - return /** @type{?proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0} */ ( - jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0, 1)); -}; - - -/** - * @param {?proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0|undefined} value - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest} returns this -*/ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.setV0 = function(value) { - return jspb.Message.setOneofWrapperField(this, 1, proto.org.dash.platform.dapi.v0.GetDocumentsRequest.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest} returns this - */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.clearV0 = function() { - return this.setV0(undefined); -}; - /** - * Returns whether this field is set. - * @return {boolean} + * List of repeated fields within this message type. + * @private {!Array} + * @const */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.hasV0 = function() { - return jspb.Message.getField(this, 1) != null; -}; - - +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.repeatedFields_ = [10]; /** * Oneof group definitions for this message. Each group defines the field @@ -24790,21 +24776,22 @@ proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.hasV0 = function() * @private {!Array>} * @const */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.oneofGroups_ = [[1]]; +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.oneofGroups_ = [[6,7]]; /** * @enum {number} */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.VersionCase = { - VERSION_NOT_SET: 0, - V0: 1 +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.StartCase = { + START_NOT_SET: 0, + START_AFTER: 6, + START_AT: 7 }; /** - * @return {proto.org.dash.platform.dapi.v0.GetDocumentsResponse.VersionCase} + * @return {proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.StartCase} */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.getVersionCase = function() { - return /** @type {proto.org.dash.platform.dapi.v0.GetDocumentsResponse.VersionCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.oneofGroups_[0])); +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.getStartCase = function() { + return /** @type {proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.StartCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.oneofGroups_[0])); }; @@ -24822,8 +24809,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.toObject = function(opt_includeInstance) { - return proto.org.dash.platform.dapi.v0.GetDocumentsResponse.toObject(opt_includeInstance, this); +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.toObject(opt_includeInstance, this); }; @@ -24832,13 +24819,23 @@ proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.toObject = functi * @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.GetDocumentsResponse} msg The msg instance to transform. + * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.toObject = function(includeInstance, msg) { +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.toObject = function(includeInstance, msg) { var f, obj = { - v0: (f = msg.getV0()) && proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.toObject(includeInstance, f) + dataContractId: msg.getDataContractId_asB64(), + documentType: jspb.Message.getFieldWithDefault(msg, 2, ""), + where: msg.getWhere_asB64(), + orderBy: msg.getOrderBy_asB64(), + limit: jspb.Message.getFieldWithDefault(msg, 5, 0), + startAfter: msg.getStartAfter_asB64(), + startAt: msg.getStartAt_asB64(), + prove: jspb.Message.getBooleanFieldWithDefault(msg, 8, false), + select: jspb.Message.getFieldWithDefault(msg, 9, 0), + groupByList: (f = jspb.Message.getRepeatedField(msg, 10)) == null ? undefined : f, + having: msg.getHaving_asB64() }; if (includeInstance) { @@ -24852,23 +24849,23 @@ proto.org.dash.platform.dapi.v0.GetDocumentsResponse.toObject = function(include /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse} + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1} */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.deserializeBinary = function(bytes) { +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.org.dash.platform.dapi.v0.GetDocumentsResponse; - return proto.org.dash.platform.dapi.v0.GetDocumentsResponse.deserializeBinaryFromReader(msg, reader); + var msg = new proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1; + return proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.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.GetDocumentsResponse} msg The message object to deserialize into. + * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse} + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1} */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.deserializeBinaryFromReader = function(msg, reader) { +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -24876,9 +24873,48 @@ proto.org.dash.platform.dapi.v0.GetDocumentsResponse.deserializeBinaryFromReader var field = reader.getFieldNumber(); switch (field) { case 1: - var value = new proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0; - reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.deserializeBinaryFromReader); - msg.setV0(value); + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setDataContractId(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setDocumentType(value); + break; + case 3: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setWhere(value); + break; + case 4: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setOrderBy(value); + break; + case 5: + var value = /** @type {number} */ (reader.readUint32()); + msg.setLimit(value); + break; + case 6: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setStartAfter(value); + break; + case 7: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setStartAt(value); + break; + case 8: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setProve(value); + break; + case 9: + var value = /** @type {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.Select} */ (reader.readEnum()); + msg.setSelect(value); + break; + case 10: + var value = /** @type {string} */ (reader.readString()); + msg.addGroupBy(value); + break; + case 11: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setHaving(value); break; default: reader.skipField(); @@ -24893,9 +24929,9 @@ proto.org.dash.platform.dapi.v0.GetDocumentsResponse.deserializeBinaryFromReader * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.serializeBinary = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.org.dash.platform.dapi.v0.GetDocumentsResponse.serializeBinaryToWriter(this, writer); + proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -24903,396 +24939,540 @@ proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.serializeBinary = /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse} message + * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.serializeBinaryToWriter = function(message, writer) { +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getV0(); - if (f != null) { - writer.writeMessage( + f = message.getDataContractId_asU8(); + if (f.length > 0) { + writer.writeBytes( 1, - f, - proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.serializeBinaryToWriter + f + ); + } + f = message.getDocumentType(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getWhere_asU8(); + if (f.length > 0) { + writer.writeBytes( + 3, + f + ); + } + f = message.getOrderBy_asU8(); + if (f.length > 0) { + writer.writeBytes( + 4, + f + ); + } + f = /** @type {number} */ (jspb.Message.getField(message, 5)); + if (f != null) { + writer.writeUint32( + 5, + f + ); + } + f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 6)); + if (f != null) { + writer.writeBytes( + 6, + f + ); + } + f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 7)); + if (f != null) { + writer.writeBytes( + 7, + f + ); + } + f = message.getProve(); + if (f) { + writer.writeBool( + 8, + f + ); + } + f = message.getSelect(); + if (f !== 0.0) { + writer.writeEnum( + 9, + f + ); + } + f = message.getGroupByList(); + if (f.length > 0) { + writer.writeRepeatedString( + 10, + f + ); + } + f = message.getHaving_asU8(); + if (f.length > 0) { + writer.writeBytes( + 11, + f ); } }; - /** - * 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 + * @enum {number} */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.oneofGroups_ = [[1,2]]; +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.Select = { + DOCUMENTS: 0, + COUNT: 1 +}; /** - * @enum {number} + * optional bytes data_contract_id = 1; + * @return {string} */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.ResultCase = { - RESULT_NOT_SET: 0, - DOCUMENTS: 1, - PROOF: 2 +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.getDataContractId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; + /** - * @return {proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.ResultCase} + * optional bytes data_contract_id = 1; + * This is a type-conversion wrapper around `getDataContractId()` + * @return {string} */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.prototype.getResultCase = function() { - return /** @type {proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.ResultCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.oneofGroups_[0])); +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.getDataContractId_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getDataContractId())); }; - -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} + * optional bytes data_contract_id = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getDataContractId()` + * @return {!Uint8Array} */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.prototype.toObject = function(opt_includeInstance) { - return proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.toObject(opt_includeInstance, this); +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.getDataContractId_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getDataContractId())); }; /** - * 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.GetDocumentsResponse.GetDocumentsResponseV0} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages + * @param {!(string|Uint8Array)} value + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.toObject = function(includeInstance, msg) { - var f, obj = { - documents: (f = msg.getDocuments()) && proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.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) - }; +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.setDataContractId = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); +}; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; + +/** + * optional string document_type = 2; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.getDocumentType = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; -} /** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} + * @param {string} value + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0; - return proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.deserializeBinaryFromReader(msg, reader); +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.setDocumentType = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); }; /** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} + * optional bytes where = 3; + * @return {string} */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.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.GetDocumentsResponse.GetDocumentsResponseV0.Documents; - reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.deserializeBinaryFromReader); - msg.setDocuments(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; +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.getWhere = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); }; /** - * Serializes the message to binary data (in protobuf wire format). + * optional bytes where = 3; + * This is a type-conversion wrapper around `getWhere()` + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.getWhere_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getWhere())); +}; + + +/** + * optional bytes where = 3; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getWhere()` * @return {!Uint8Array} */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.getWhere_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getWhere())); }; /** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages + * @param {!(string|Uint8Array)} value + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getDocuments(); - if (f != null) { - writer.writeMessage( - 1, - f, - proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.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 - ); - } +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.setWhere = function(value) { + return jspb.Message.setProto3BytesField(this, 3, value); }; +/** + * optional bytes order_by = 4; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.getOrderBy = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + /** - * List of repeated fields within this message type. - * @private {!Array} - * @const + * optional bytes order_by = 4; + * This is a type-conversion wrapper around `getOrderBy()` + * @return {string} */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.repeatedFields_ = [1]; +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.getOrderBy_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getOrderBy())); +}; +/** + * optional bytes order_by = 4; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getOrderBy()` + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.getOrderBy_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getOrderBy())); +}; + -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} + * @param {!(string|Uint8Array)} value + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.prototype.toObject = function(opt_includeInstance) { - return proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.toObject(opt_includeInstance, this); +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.setOrderBy = function(value) { + return jspb.Message.setProto3BytesField(this, 4, value); }; /** - * 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.GetDocumentsResponse.GetDocumentsResponseV0.Documents} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages + * optional uint32 limit = 5; + * @return {number} */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.toObject = function(includeInstance, msg) { - var f, obj = { - documentsList: msg.getDocumentsList_asB64() - }; +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.getLimit = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); +}; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; + +/** + * @param {number} value + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1} returns this + */ +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.setLimit = function(value) { + return jspb.Message.setField(this, 5, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1} returns this + */ +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.clearLimit = function() { + return jspb.Message.setField(this, 5, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.hasLimit = function() { + return jspb.Message.getField(this, 5) != null; +}; + + +/** + * optional bytes start_after = 6; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.getStartAfter = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, "")); +}; + + +/** + * optional bytes start_after = 6; + * This is a type-conversion wrapper around `getStartAfter()` + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.getStartAfter_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getStartAfter())); +}; + + +/** + * optional bytes start_after = 6; + * 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.GetDocumentsRequest.GetDocumentsRequestV1.prototype.getStartAfter_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getStartAfter())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1} returns this + */ +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.setStartAfter = function(value) { + return jspb.Message.setOneofField(this, 6, proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.oneofGroups_[0], value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1} returns this + */ +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.clearStartAfter = function() { + return jspb.Message.setOneofField(this, 6, proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.oneofGroups_[0], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.hasStartAfter = function() { + return jspb.Message.getField(this, 6) != null; +}; + + +/** + * optional bytes start_at = 7; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.getStartAt = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 7, "")); +}; + + +/** + * optional bytes start_at = 7; + * This is a type-conversion wrapper around `getStartAt()` + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.getStartAt_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getStartAt())); +}; + + +/** + * optional bytes start_at = 7; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getStartAt()` + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.getStartAt_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getStartAt())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1} returns this + */ +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.setStartAt = function(value) { + return jspb.Message.setOneofField(this, 7, proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.oneofGroups_[0], value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1} returns this + */ +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.clearStartAt = function() { + return jspb.Message.setOneofField(this, 7, proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.oneofGroups_[0], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.hasStartAt = function() { + return jspb.Message.getField(this, 7) != null; +}; + + +/** + * optional bool prove = 8; + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.getProve = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 8, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1} returns this + */ +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.setProve = function(value) { + return jspb.Message.setProto3BooleanField(this, 8, value); }; -} /** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} + * optional Select select = 9; + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.Select} */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents; - return proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.deserializeBinaryFromReader(msg, reader); +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.getSelect = function() { + return /** @type {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.Select} */ (jspb.Message.getFieldWithDefault(this, 9, 0)); }; /** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} + * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.Select} value + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.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.addDocuments(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.setSelect = function(value) { + return jspb.Message.setProto3EnumField(this, 9, value); }; /** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} + * repeated string group_by = 10; + * @return {!Array} */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.getGroupByList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 10)); }; /** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages + * @param {!Array} value + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getDocumentsList_asU8(); - if (f.length > 0) { - writer.writeRepeatedBytes( - 1, - f - ); - } +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.setGroupByList = function(value) { + return jspb.Message.setField(this, 10, value || []); }; /** - * repeated bytes documents = 1; - * @return {!Array} + * @param {string} value + * @param {number=} opt_index + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.prototype.getDocumentsList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.addGroupBy = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 10, value, opt_index); }; /** - * repeated bytes documents = 1; - * This is a type-conversion wrapper around `getDocumentsList()` - * @return {!Array} + * Clears the list making it empty but non-null. + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.prototype.getDocumentsList_asB64 = function() { - return /** @type {!Array} */ (jspb.Message.bytesListAsB64( - this.getDocumentsList())); +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.clearGroupByList = function() { + return this.setGroupByList([]); }; /** - * repeated bytes documents = 1; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getDocumentsList()` - * @return {!Array} + * optional bytes having = 11; + * @return {string} */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.prototype.getDocumentsList_asU8 = function() { - return /** @type {!Array} */ (jspb.Message.bytesListAsU8( - this.getDocumentsList())); +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.getHaving = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 11, "")); }; /** - * @param {!(Array|Array)} value - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} returns this + * optional bytes having = 11; + * This is a type-conversion wrapper around `getHaving()` + * @return {string} */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.prototype.setDocumentsList = function(value) { - return jspb.Message.setField(this, 1, value || []); +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.getHaving_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getHaving())); }; /** - * @param {!(string|Uint8Array)} value - * @param {number=} opt_index - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} returns this + * optional bytes having = 11; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getHaving()` + * @return {!Uint8Array} */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.prototype.addDocuments = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 1, value, opt_index); +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.getHaving_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getHaving())); }; /** - * Clears the list making it empty but non-null. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} returns this + * @param {!(string|Uint8Array)} value + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.prototype.clearDocumentsList = function() { - return this.setDocumentsList([]); +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.prototype.setHaving = function(value) { + return jspb.Message.setProto3BytesField(this, 11, value); }; /** - * optional Documents documents = 1; - * @return {?proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} + * optional GetDocumentsRequestV0 v0 = 1; + * @return {?proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0} */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.prototype.getDocuments = function() { - return /** @type{?proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} */ ( - jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents, 1)); +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getV0 = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0, 1)); }; /** - * @param {?proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents|undefined} value - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} returns this + * @param {?proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.prototype.setDocuments = function(value) { - return jspb.Message.setOneofWrapperField(this, 1, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.oneofGroups_[0], value); +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.setV0 = function(value) { + return jspb.Message.setOneofWrapperField(this, 1, proto.org.dash.platform.dapi.v0.GetDocumentsRequest.oneofGroups_[0], value); }; /** * Clears the message field making it undefined. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.prototype.clearDocuments = function() { - return this.setDocuments(undefined); +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.clearV0 = function() { + return this.setV0(undefined); }; @@ -25300,36 +25480,36 @@ proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.prot * Returns whether this field is set. * @return {boolean} */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.prototype.hasDocuments = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.hasV0 = function() { return jspb.Message.getField(this, 1) != null; }; /** - * optional Proof proof = 2; - * @return {?proto.org.dash.platform.dapi.v0.Proof} + * optional GetDocumentsRequestV1 v1 = 2; + * @return {?proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1} */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.prototype.getProof = function() { - return /** @type{?proto.org.dash.platform.dapi.v0.Proof} */ ( - jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.Proof, 2)); +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getV1 = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1, 2)); }; /** - * @param {?proto.org.dash.platform.dapi.v0.Proof|undefined} value - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} returns this + * @param {?proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.prototype.setProof = function(value) { - return jspb.Message.setOneofWrapperField(this, 2, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.oneofGroups_[0], value); +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.setV1 = function(value) { + return jspb.Message.setOneofWrapperField(this, 2, proto.org.dash.platform.dapi.v0.GetDocumentsRequest.oneofGroups_[0], value); }; /** * Clears the message field making it undefined. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.prototype.clearProof = function() { - return this.setProof(undefined); +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.clearV1 = function() { + return this.setV1(undefined); }; @@ -25337,82 +25517,162 @@ proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.prot * Returns whether this field is set. * @return {boolean} */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.prototype.hasProof = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.hasV1 = function() { return jspb.Message.getField(this, 2) != null; }; + /** - * optional ResponseMetadata metadata = 3; - * @return {?proto.org.dash.platform.dapi.v0.ResponseMetadata} + * 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.GetDocumentsResponse.GetDocumentsResponseV0.prototype.getMetadata = function() { - return /** @type{?proto.org.dash.platform.dapi.v0.ResponseMetadata} */ ( - jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.ResponseMetadata, 3)); -}; +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.oneofGroups_ = [[1,2]]; +/** + * @enum {number} + */ +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.VersionCase = { + VERSION_NOT_SET: 0, + V0: 1, + V1: 2 +}; /** - * @param {?proto.org.dash.platform.dapi.v0.ResponseMetadata|undefined} value - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} returns this -*/ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.prototype.setMetadata = function(value) { - return jspb.Message.setWrapperField(this, 3, value); + * @return {proto.org.dash.platform.dapi.v0.GetDocumentsResponse.VersionCase} + */ +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.getVersionCase = function() { + return /** @type {proto.org.dash.platform.dapi.v0.GetDocumentsResponse.VersionCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.oneofGroups_[0])); }; + +if (jspb.Message.GENERATE_TO_OBJECT) { /** - * Clears the message field making it undefined. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} returns this + * 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.GetDocumentsResponse.GetDocumentsResponseV0.prototype.clearMetadata = function() { - return this.setMetadata(undefined); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetDocumentsResponse.toObject(opt_includeInstance, this); }; /** - * Returns whether this field is set. - * @return {boolean} + * 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.GetDocumentsResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.prototype.hasMetadata = function() { - return jspb.Message.getField(this, 3) != null; +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.toObject = function(includeInstance, msg) { + var f, obj = { + v0: (f = msg.getV0()) && proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.toObject(includeInstance, f), + v1: (f = msg.getV1()) && proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; }; +} /** - * optional GetDocumentsResponseV0 v0 = 1; - * @return {?proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse} */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.getV0 = function() { - return /** @type{?proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} */ ( - jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0, 1)); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetDocumentsResponse; + return proto.org.dash.platform.dapi.v0.GetDocumentsResponse.deserializeBinaryFromReader(msg, reader); }; /** - * @param {?proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0|undefined} value - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse} returns this -*/ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.setV0 = function(value) { - return jspb.Message.setOneofWrapperField(this, 1, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.oneofGroups_[0], value); + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse} + */ +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.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.GetDocumentsResponse.GetDocumentsResponseV0; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.deserializeBinaryFromReader); + msg.setV0(value); + break; + case 2: + var value = new proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.deserializeBinaryFromReader); + msg.setV1(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; }; /** - * Clears the message field making it undefined. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse} returns this + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.clearV0 = function() { - return this.setV0(undefined); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetDocumentsResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); }; /** - * Returns whether this field is set. - * @return {boolean} + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.hasV0 = function() { - return jspb.Message.getField(this, 1) != null; +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getV0(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.serializeBinaryToWriter + ); + } + f = message.getV1(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.serializeBinaryToWriter + ); + } }; @@ -25425,21 +25685,22 @@ proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.hasV0 = function( * @private {!Array>} * @const */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.oneofGroups_ = [[1]]; +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.oneofGroups_ = [[1,2]]; /** * @enum {number} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.VersionCase = { - VERSION_NOT_SET: 0, - V0: 1 +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.ResultCase = { + RESULT_NOT_SET: 0, + DOCUMENTS: 1, + PROOF: 2 }; /** - * @return {proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.VersionCase} + * @return {proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.ResultCase} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.prototype.getVersionCase = function() { - return /** @type {proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.VersionCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.oneofGroups_[0])); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.prototype.getResultCase = function() { + return /** @type {proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.ResultCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.oneofGroups_[0])); }; @@ -25457,8 +25718,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.prototype.toObject = function(opt_includeInstance) { - return proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.toObject(opt_includeInstance, this); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.toObject(opt_includeInstance, this); }; @@ -25467,13 +25728,15 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.prototype.toObject = fu * @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.GetDocumentsCountRequest} msg The msg instance to transform. + * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.toObject = function(includeInstance, msg) { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.toObject = function(includeInstance, msg) { var f, obj = { - v0: (f = msg.getV0()) && proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.toObject(includeInstance, f) + documents: (f = msg.getDocuments()) && proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.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) { @@ -25487,23 +25750,23 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.toObject = function(inc /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest} + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.deserializeBinary = function(bytes) { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest; - return proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.deserializeBinaryFromReader(msg, reader); + var msg = new proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0; + return proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.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.GetDocumentsCountRequest} msg The message object to deserialize into. + * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest} + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.deserializeBinaryFromReader = function(msg, reader) { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -25511,9 +25774,19 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.deserializeBinaryFromRe var field = reader.getFieldNumber(); switch (field) { case 1: - var value = new proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0; - reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.deserializeBinaryFromReader); - msg.setV0(value); + var value = new proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.deserializeBinaryFromReader); + msg.setDocuments(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(); @@ -25528,9 +25801,9 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.deserializeBinaryFromRe * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.prototype.serializeBinary = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.serializeBinaryToWriter(this, writer); + proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -25538,24 +25811,47 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.prototype.serializeBina /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest} message + * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.serializeBinaryToWriter = function(message, writer) { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getV0(); + f = message.getDocuments(); if (f != null) { writer.writeMessage( 1, f, - proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.serializeBinaryToWriter + proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.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 ); } }; +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.repeatedFields_ = [1]; + if (jspb.Message.GENERATE_TO_OBJECT) { @@ -25571,8 +25867,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.prototype.toObject = function(opt_includeInstance) { - return proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.toObject(opt_includeInstance, this); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.toObject(opt_includeInstance, this); }; @@ -25581,19 +25877,13 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountReques * @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.GetDocumentsCountRequest.GetDocumentsCountRequestV0} msg The msg instance to transform. + * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.toObject = function(includeInstance, msg) { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.toObject = function(includeInstance, msg) { var f, obj = { - dataContractId: msg.getDataContractId_asB64(), - documentType: jspb.Message.getFieldWithDefault(msg, 2, ""), - where: msg.getWhere_asB64(), - returnDistinctCountsInRange: jspb.Message.getBooleanFieldWithDefault(msg, 4, false), - orderBy: msg.getOrderBy_asB64(), - limit: jspb.Message.getFieldWithDefault(msg, 6, 0), - prove: jspb.Message.getBooleanFieldWithDefault(msg, 7, false) + documentsList: msg.getDocumentsList_asB64() }; if (includeInstance) { @@ -25607,23 +25897,23 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountReques /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0} + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.deserializeBinary = function(bytes) { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0; - return proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.deserializeBinaryFromReader(msg, reader); + var msg = new proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents; + return proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.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.GetDocumentsCountRequest.GetDocumentsCountRequestV0} msg The message object to deserialize into. + * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0} + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.deserializeBinaryFromReader = function(msg, reader) { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -25632,31 +25922,7 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountReques switch (field) { case 1: var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setDataContractId(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setDocumentType(value); - break; - case 3: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setWhere(value); - break; - case 4: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setReturnDistinctCountsInRange(value); - break; - case 5: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setOrderBy(value); - break; - case 6: - var value = /** @type {number} */ (reader.readUint32()); - msg.setLimit(value); - break; - case 7: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setProve(value); + msg.addDocuments(value); break; default: reader.skipField(); @@ -25671,9 +25937,9 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountReques * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.prototype.serializeBinary = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.serializeBinaryToWriter(this, writer); + proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -25681,305 +25947,182 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountReques /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0} message + * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.serializeBinaryToWriter = function(message, writer) { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getDataContractId_asU8(); - if (f.length > 0) { - writer.writeBytes( - 1, - f - ); - } - f = message.getDocumentType(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } - f = message.getWhere_asU8(); - if (f.length > 0) { - writer.writeBytes( - 3, - f - ); - } - f = message.getReturnDistinctCountsInRange(); - if (f) { - writer.writeBool( - 4, - f - ); - } - f = message.getOrderBy_asU8(); - if (f.length > 0) { - writer.writeBytes( - 5, - f - ); - } - f = /** @type {number} */ (jspb.Message.getField(message, 6)); - if (f != null) { - writer.writeUint32( - 6, - f - ); - } - f = message.getProve(); - if (f) { - writer.writeBool( - 7, - f - ); - } -}; - - -/** - * optional bytes data_contract_id = 1; - * @return {string} - */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.prototype.getDataContractId = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * optional bytes data_contract_id = 1; - * This is a type-conversion wrapper around `getDataContractId()` - * @return {string} - */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.prototype.getDataContractId_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getDataContractId())); -}; - - -/** - * optional bytes data_contract_id = 1; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getDataContractId()` - * @return {!Uint8Array} - */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.prototype.getDataContractId_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getDataContractId())); -}; - - -/** - * @param {!(string|Uint8Array)} value - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0} returns this - */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.prototype.setDataContractId = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); -}; - - -/** - * optional string document_type = 2; - * @return {string} - */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.prototype.getDocumentType = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0} returns this - */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.prototype.setDocumentType = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - - -/** - * optional bytes where = 3; - * @return {string} - */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.prototype.getWhere = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); -}; - - -/** - * optional bytes where = 3; - * This is a type-conversion wrapper around `getWhere()` - * @return {string} - */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.prototype.getWhere_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getWhere())); + f = message.getDocumentsList_asU8(); + if (f.length > 0) { + writer.writeRepeatedBytes( + 1, + f + ); + } }; /** - * optional bytes where = 3; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getWhere()` - * @return {!Uint8Array} + * repeated bytes documents = 1; + * @return {!Array} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.prototype.getWhere_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getWhere())); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.prototype.getDocumentsList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); }; /** - * @param {!(string|Uint8Array)} value - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0} returns this + * repeated bytes documents = 1; + * This is a type-conversion wrapper around `getDocumentsList()` + * @return {!Array} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.prototype.setWhere = function(value) { - return jspb.Message.setProto3BytesField(this, 3, value); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.prototype.getDocumentsList_asB64 = function() { + return /** @type {!Array} */ (jspb.Message.bytesListAsB64( + this.getDocumentsList())); }; /** - * optional bool return_distinct_counts_in_range = 4; - * @return {boolean} + * repeated bytes documents = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getDocumentsList()` + * @return {!Array} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.prototype.getReturnDistinctCountsInRange = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 4, false)); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.prototype.getDocumentsList_asU8 = function() { + return /** @type {!Array} */ (jspb.Message.bytesListAsU8( + this.getDocumentsList())); }; /** - * @param {boolean} value - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0} returns this + * @param {!(Array|Array)} value + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.prototype.setReturnDistinctCountsInRange = function(value) { - return jspb.Message.setProto3BooleanField(this, 4, value); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.prototype.setDocumentsList = function(value) { + return jspb.Message.setField(this, 1, value || []); }; /** - * optional bytes order_by = 5; - * @return {string} + * @param {!(string|Uint8Array)} value + * @param {number=} opt_index + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.prototype.getOrderBy = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, "")); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.prototype.addDocuments = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 1, value, opt_index); }; /** - * optional bytes order_by = 5; - * This is a type-conversion wrapper around `getOrderBy()` - * @return {string} + * Clears the list making it empty but non-null. + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.prototype.getOrderBy_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getOrderBy())); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.prototype.clearDocumentsList = function() { + return this.setDocumentsList([]); }; /** - * optional bytes order_by = 5; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getOrderBy()` - * @return {!Uint8Array} + * optional Documents documents = 1; + * @return {?proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.prototype.getOrderBy_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getOrderBy())); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.prototype.getDocuments = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents, 1)); }; /** - * @param {!(string|Uint8Array)} value - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0} returns this - */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.prototype.setOrderBy = function(value) { - return jspb.Message.setProto3BytesField(this, 5, value); + * @param {?proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} returns this +*/ +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.prototype.setDocuments = function(value) { + return jspb.Message.setOneofWrapperField(this, 1, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.oneofGroups_[0], value); }; /** - * optional uint32 limit = 6; - * @return {number} + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.prototype.getLimit = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 6, 0)); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.prototype.clearDocuments = function() { + return this.setDocuments(undefined); }; /** - * @param {number} value - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0} returns this + * Returns whether this field is set. + * @return {boolean} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.prototype.setLimit = function(value) { - return jspb.Message.setField(this, 6, value); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.prototype.hasDocuments = function() { + return jspb.Message.getField(this, 1) != null; }; /** - * Clears the field making it undefined. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0} returns this + * optional Proof proof = 2; + * @return {?proto.org.dash.platform.dapi.v0.Proof} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.prototype.clearLimit = function() { - return jspb.Message.setField(this, 6, undefined); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.prototype.getProof = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.Proof} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.Proof, 2)); }; /** - * Returns whether this field is set. - * @return {boolean} - */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.prototype.hasLimit = function() { - return jspb.Message.getField(this, 6) != null; + * @param {?proto.org.dash.platform.dapi.v0.Proof|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} returns this +*/ +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.prototype.setProof = function(value) { + return jspb.Message.setOneofWrapperField(this, 2, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.oneofGroups_[0], value); }; /** - * optional bool prove = 7; - * @return {boolean} + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.prototype.getProve = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 7, false)); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.prototype.clearProof = function() { + return this.setProof(undefined); }; /** - * @param {boolean} value - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0} returns this + * Returns whether this field is set. + * @return {boolean} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0.prototype.setProve = function(value) { - return jspb.Message.setProto3BooleanField(this, 7, value); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.prototype.hasProof = function() { + return jspb.Message.getField(this, 2) != null; }; /** - * optional GetDocumentsCountRequestV0 v0 = 1; - * @return {?proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0} + * optional ResponseMetadata metadata = 3; + * @return {?proto.org.dash.platform.dapi.v0.ResponseMetadata} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.prototype.getV0 = function() { - return /** @type{?proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0} */ ( - jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.GetDocumentsCountRequestV0, 1)); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.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.GetDocumentsCountRequest.GetDocumentsCountRequestV0|undefined} value - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest} returns this + * @param {?proto.org.dash.platform.dapi.v0.ResponseMetadata|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.prototype.setV0 = function(value) { - return jspb.Message.setOneofWrapperField(this, 1, proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.oneofGroups_[0], value); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.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.GetDocumentsCountRequest} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.prototype.clearV0 = function() { - return this.setV0(undefined); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.prototype.clearMetadata = function() { + return this.setMetadata(undefined); }; @@ -25987,8 +26130,8 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.prototype.clearV0 = fun * Returns whether this field is set. * @return {boolean} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.prototype.hasV0 = function() { - return jspb.Message.getField(this, 1) != null; +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.prototype.hasMetadata = function() { + return jspb.Message.getField(this, 3) != null; }; @@ -26001,21 +26144,22 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountRequest.prototype.hasV0 = funct * @private {!Array>} * @const */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.oneofGroups_ = [[1]]; +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.oneofGroups_ = [[1,2]]; /** * @enum {number} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.VersionCase = { - VERSION_NOT_SET: 0, - V0: 1 +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultCase = { + RESULT_NOT_SET: 0, + DATA: 1, + PROOF: 2 }; /** - * @return {proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.VersionCase} + * @return {proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultCase} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.prototype.getVersionCase = function() { - return /** @type {proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.VersionCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.oneofGroups_[0])); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.prototype.getResultCase = function() { + return /** @type {proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.oneofGroups_[0])); }; @@ -26033,8 +26177,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.prototype.toObject = function(opt_includeInstance) { - return proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.toObject(opt_includeInstance, this); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.toObject(opt_includeInstance, this); }; @@ -26043,13 +26187,15 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.prototype.toObject = f * @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.GetDocumentsCountResponse} msg The msg instance to transform. + * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.toObject = function(includeInstance, msg) { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.toObject = function(includeInstance, msg) { var f, obj = { - v0: (f = msg.getV0()) && proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.toObject(includeInstance, f) + data: (f = msg.getData()) && proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.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) { @@ -26063,23 +26209,23 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.toObject = function(in /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse} + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.deserializeBinary = function(bytes) { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse; - return proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.deserializeBinaryFromReader(msg, reader); + var msg = new proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1; + return proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.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.GetDocumentsCountResponse} msg The message object to deserialize into. + * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse} + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.deserializeBinaryFromReader = function(msg, reader) { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -26087,9 +26233,19 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.deserializeBinaryFromR var field = reader.getFieldNumber(); switch (field) { case 1: - var value = new proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0; - reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.deserializeBinaryFromReader); - msg.setV0(value); + var value = new proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.deserializeBinaryFromReader); + msg.setData(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(); @@ -26104,9 +26260,9 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.deserializeBinaryFromR * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.prototype.serializeBinary = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.serializeBinaryToWriter(this, writer); + proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -26114,18 +26270,34 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.prototype.serializeBin /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse} message + * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.serializeBinaryToWriter = function(message, writer) { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getV0(); + f = message.getData(); if (f != null) { writer.writeMessage( 1, f, - proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.serializeBinaryToWriter + proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.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 ); } }; @@ -26133,30 +26305,11 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.serializeBinaryToWrite /** - * 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>} + * List of repeated fields within this message type. + * @private {!Array} * @const */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.oneofGroups_ = [[1,2]]; - -/** - * @enum {number} - */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.ResultCase = { - RESULT_NOT_SET: 0, - COUNTS: 1, - PROOF: 2 -}; - -/** - * @return {proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.ResultCase} - */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.prototype.getResultCase = function() { - return /** @type {proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.ResultCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.oneofGroups_[0])); -}; +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents.repeatedFields_ = [1]; @@ -26173,8 +26326,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.prototype.toObject = function(opt_includeInstance) { - return proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.toObject(opt_includeInstance, this); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents.toObject(opt_includeInstance, this); }; @@ -26183,15 +26336,13 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo * @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.GetDocumentsCountResponse.GetDocumentsCountResponseV0} msg The msg instance to transform. + * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.toObject = function(includeInstance, msg) { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents.toObject = function(includeInstance, msg) { var f, obj = { - counts: (f = msg.getCounts()) && proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.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) + documentsList: msg.getDocumentsList_asB64() }; if (includeInstance) { @@ -26205,23 +26356,23 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0} + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.deserializeBinary = function(bytes) { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0; - return proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.deserializeBinaryFromReader(msg, reader); + var msg = new proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents; + return proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents.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.GetDocumentsCountResponse.GetDocumentsCountResponseV0} msg The message object to deserialize into. + * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0} + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.deserializeBinaryFromReader = function(msg, reader) { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -26229,19 +26380,8 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo var field = reader.getFieldNumber(); switch (field) { case 1: - var value = new proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults; - reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.deserializeBinaryFromReader); - msg.setCounts(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); + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.addDocuments(value); break; default: reader.skipField(); @@ -26253,49 +26393,93 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo /** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents.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.GetDocumentsResponse.GetDocumentsResponseV1.Documents} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getDocumentsList_asU8(); + if (f.length > 0) { + writer.writeRepeatedBytes( + 1, + f + ); + } +}; + + +/** + * repeated bytes documents = 1; + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents.prototype.getDocumentsList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); +}; + + +/** + * repeated bytes documents = 1; + * This is a type-conversion wrapper around `getDocumentsList()` + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents.prototype.getDocumentsList_asB64 = function() { + return /** @type {!Array} */ (jspb.Message.bytesListAsB64( + this.getDocumentsList())); +}; + + +/** + * repeated bytes documents = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getDocumentsList()` + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents.prototype.getDocumentsList_asU8 = function() { + return /** @type {!Array} */ (jspb.Message.bytesListAsU8( + this.getDocumentsList())); +}; + + +/** + * @param {!(Array|Array)} value + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents} returns this + */ +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents.prototype.setDocumentsList = function(value) { + return jspb.Message.setField(this, 1, value || []); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @param {number=} opt_index + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents.prototype.addDocuments = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 1, value, opt_index); }; /** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages + * Clears the list making it empty but non-null. + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getCounts(); - if (f != null) { - writer.writeMessage( - 1, - f, - proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.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 - ); - } +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents.prototype.clearDocumentsList = function() { + return this.setDocumentsList([]); }; @@ -26315,8 +26499,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry.prototype.toObject = function(opt_includeInstance) { - return proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry.toObject(opt_includeInstance, this); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry.toObject(opt_includeInstance, this); }; @@ -26325,11 +26509,11 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo * @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.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry} msg The msg instance to transform. + * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry.toObject = function(includeInstance, msg) { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry.toObject = function(includeInstance, msg) { var f, obj = { inKey: msg.getInKey_asB64(), key: msg.getKey_asB64(), @@ -26347,23 +26531,23 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry} + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry.deserializeBinary = function(bytes) { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry; - return proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry.deserializeBinaryFromReader(msg, reader); + var msg = new proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry; + return proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry.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.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry} msg The message object to deserialize into. + * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry} + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry.deserializeBinaryFromReader = function(msg, reader) { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -26395,9 +26579,9 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry.prototype.serializeBinary = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry.serializeBinaryToWriter(this, writer); + proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -26405,11 +26589,11 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry} message + * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry.serializeBinaryToWriter = function(message, writer) { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 1)); if (f != null) { @@ -26439,7 +26623,7 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo * optional bytes in_key = 1; * @return {string} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry.prototype.getInKey = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry.prototype.getInKey = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; @@ -26449,7 +26633,7 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo * This is a type-conversion wrapper around `getInKey()` * @return {string} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry.prototype.getInKey_asB64 = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry.prototype.getInKey_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getInKey())); }; @@ -26462,7 +26646,7 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo * This is a type-conversion wrapper around `getInKey()` * @return {!Uint8Array} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry.prototype.getInKey_asU8 = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry.prototype.getInKey_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getInKey())); }; @@ -26470,18 +26654,18 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo /** * @param {!(string|Uint8Array)} value - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry.prototype.setInKey = function(value) { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry.prototype.setInKey = function(value) { return jspb.Message.setField(this, 1, value); }; /** * Clears the field making it undefined. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry.prototype.clearInKey = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry.prototype.clearInKey = function() { return jspb.Message.setField(this, 1, undefined); }; @@ -26490,7 +26674,7 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo * Returns whether this field is set. * @return {boolean} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry.prototype.hasInKey = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry.prototype.hasInKey = function() { return jspb.Message.getField(this, 1) != null; }; @@ -26499,7 +26683,7 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo * optional bytes key = 2; * @return {string} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry.prototype.getKey = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry.prototype.getKey = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; @@ -26509,7 +26693,7 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo * This is a type-conversion wrapper around `getKey()` * @return {string} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry.prototype.getKey_asB64 = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry.prototype.getKey_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getKey())); }; @@ -26522,7 +26706,7 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo * This is a type-conversion wrapper around `getKey()` * @return {!Uint8Array} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry.prototype.getKey_asU8 = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry.prototype.getKey_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getKey())); }; @@ -26530,9 +26714,9 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo /** * @param {!(string|Uint8Array)} value - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry.prototype.setKey = function(value) { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry.prototype.setKey = function(value) { return jspb.Message.setProto3BytesField(this, 2, value); }; @@ -26541,16 +26725,16 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo * optional uint64 count = 3; * @return {string} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry.prototype.getCount = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry.prototype.getCount = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "0")); }; /** * @param {string} value - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry.prototype.setCount = function(value) { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry.prototype.setCount = function(value) { return jspb.Message.setProto3StringIntField(this, 3, value); }; @@ -26561,7 +26745,7 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo * @private {!Array} * @const */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries.repeatedFields_ = [1]; +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries.repeatedFields_ = [1]; @@ -26578,8 +26762,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries.prototype.toObject = function(opt_includeInstance) { - return proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries.toObject(opt_includeInstance, this); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries.toObject(opt_includeInstance, this); }; @@ -26588,14 +26772,14 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo * @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.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries} msg The msg instance to transform. + * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries.toObject = function(includeInstance, msg) { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries.toObject = function(includeInstance, msg) { var f, obj = { entriesList: jspb.Message.toObjectList(msg.getEntriesList(), - proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry.toObject, includeInstance) + proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry.toObject, includeInstance) }; if (includeInstance) { @@ -26609,23 +26793,23 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries} + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries.deserializeBinary = function(bytes) { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries; - return proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries.deserializeBinaryFromReader(msg, reader); + var msg = new proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries; + return proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries.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.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries} msg The message object to deserialize into. + * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries} + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries.deserializeBinaryFromReader = function(msg, reader) { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -26633,8 +26817,8 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo var field = reader.getFieldNumber(); switch (field) { case 1: - var value = new proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry; - reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry.deserializeBinaryFromReader); + var value = new proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry.deserializeBinaryFromReader); msg.addEntries(value); break; default: @@ -26650,9 +26834,9 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries.prototype.serializeBinary = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries.serializeBinaryToWriter(this, writer); + proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -26660,18 +26844,18 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries} message + * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries.serializeBinaryToWriter = function(message, writer) { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getEntriesList(); if (f.length > 0) { writer.writeRepeatedMessage( 1, f, - proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry.serializeBinaryToWriter + proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry.serializeBinaryToWriter ); } }; @@ -26679,38 +26863,38 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo /** * repeated CountEntry entries = 1; - * @return {!Array} + * @return {!Array} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries.prototype.getEntriesList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry, 1)); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries.prototype.getEntriesList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry, 1)); }; /** - * @param {!Array} value - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries} returns this + * @param {!Array} value + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries.prototype.setEntriesList = function(value) { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries.prototype.setEntriesList = function(value) { return jspb.Message.setRepeatedWrapperField(this, 1, value); }; /** - * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry=} opt_value + * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry=} opt_value * @param {number=} opt_index - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry} + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries.prototype.addEntries = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntry, opt_index); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries.prototype.addEntries = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry, opt_index); }; /** * Clears the list making it empty but non-null. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries.prototype.clearEntriesList = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries.prototype.clearEntriesList = function() { return this.setEntriesList([]); }; @@ -26724,22 +26908,22 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo * @private {!Array>} * @const */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.oneofGroups_ = [[1,2]]; +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.oneofGroups_ = [[1,2]]; /** * @enum {number} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.VariantCase = { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.VariantCase = { VARIANT_NOT_SET: 0, AGGREGATE_COUNT: 1, ENTRIES: 2 }; /** - * @return {proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.VariantCase} + * @return {proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.VariantCase} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.prototype.getVariantCase = function() { - return /** @type {proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.VariantCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.oneofGroups_[0])); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.prototype.getVariantCase = function() { + return /** @type {proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.VariantCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.oneofGroups_[0])); }; @@ -26757,8 +26941,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.prototype.toObject = function(opt_includeInstance) { - return proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.toObject(opt_includeInstance, this); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.toObject(opt_includeInstance, this); }; @@ -26767,14 +26951,14 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo * @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.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults} msg The msg instance to transform. + * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.toObject = function(includeInstance, msg) { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.toObject = function(includeInstance, msg) { var f, obj = { aggregateCount: jspb.Message.getFieldWithDefault(msg, 1, "0"), - entries: (f = msg.getEntries()) && proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries.toObject(includeInstance, f) + entries: (f = msg.getEntries()) && proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries.toObject(includeInstance, f) }; if (includeInstance) { @@ -26788,23 +26972,23 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults} + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.deserializeBinary = function(bytes) { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults; - return proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.deserializeBinaryFromReader(msg, reader); + var msg = new proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults; + return proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.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.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults} msg The message object to deserialize into. + * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults} + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.deserializeBinaryFromReader = function(msg, reader) { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -26816,8 +27000,8 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo msg.setAggregateCount(value); break; case 2: - var value = new proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries; - reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries.deserializeBinaryFromReader); + var value = new proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries.deserializeBinaryFromReader); msg.setEntries(value); break; default: @@ -26833,9 +27017,9 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.prototype.serializeBinary = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.serializeBinaryToWriter(this, writer); + proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -26843,11 +27027,11 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults} message + * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.serializeBinaryToWriter = function(message, writer) { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = /** @type {string} */ (jspb.Message.getField(message, 1)); if (f != null) { @@ -26861,7 +27045,7 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo writer.writeMessage( 2, f, - proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries.serializeBinaryToWriter + proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries.serializeBinaryToWriter ); } }; @@ -26871,26 +27055,26 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo * optional uint64 aggregate_count = 1; * @return {string} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.prototype.getAggregateCount = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.prototype.getAggregateCount = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "0")); }; /** * @param {string} value - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.prototype.setAggregateCount = function(value) { - return jspb.Message.setOneofField(this, 1, proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.oneofGroups_[0], value); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.prototype.setAggregateCount = function(value) { + return jspb.Message.setOneofField(this, 1, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.oneofGroups_[0], value); }; /** * Clears the field making it undefined. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.prototype.clearAggregateCount = function() { - return jspb.Message.setOneofField(this, 1, proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.oneofGroups_[0], undefined); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.prototype.clearAggregateCount = function() { + return jspb.Message.setOneofField(this, 1, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.oneofGroups_[0], undefined); }; @@ -26898,35 +27082,35 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo * Returns whether this field is set. * @return {boolean} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.prototype.hasAggregateCount = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.prototype.hasAggregateCount = function() { return jspb.Message.getField(this, 1) != null; }; /** * optional CountEntries entries = 2; - * @return {?proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries} + * @return {?proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.prototype.getEntries = function() { - return /** @type{?proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries} */ ( - jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries, 2)); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.prototype.getEntries = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries, 2)); }; /** - * @param {?proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountEntries|undefined} value - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults} returns this + * @param {?proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntries|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.prototype.setEntries = function(value) { - return jspb.Message.setOneofWrapperField(this, 2, proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.oneofGroups_[0], value); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.prototype.setEntries = function(value) { + return jspb.Message.setOneofWrapperField(this, 2, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.oneofGroups_[0], value); }; /** * Clears the message field making it undefined. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.prototype.clearEntries = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.prototype.clearEntries = function() { return this.setEntries(undefined); }; @@ -26935,35 +27119,226 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo * Returns whether this field is set. * @return {boolean} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults.prototype.hasEntries = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.prototype.hasEntries = 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.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.oneofGroups_ = [[1,2]]; + +/** + * @enum {number} + */ +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.VariantCase = { + VARIANT_NOT_SET: 0, + DOCUMENTS: 1, + COUNTS: 2 +}; + +/** + * @return {proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.VariantCase} + */ +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.prototype.getVariantCase = function() { + return /** @type {proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.VariantCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.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.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.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.GetDocumentsResponse.GetDocumentsResponseV1.ResultData} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.toObject = function(includeInstance, msg) { + var f, obj = { + documents: (f = msg.getDocuments()) && proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents.toObject(includeInstance, f), + counts: (f = msg.getCounts()) && proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.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.GetDocumentsResponse.GetDocumentsResponseV1.ResultData} + */ +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData; + return proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.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.GetDocumentsResponse.GetDocumentsResponseV1.ResultData} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData} + */ +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.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.GetDocumentsResponse.GetDocumentsResponseV1.Documents; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents.deserializeBinaryFromReader); + msg.setDocuments(value); + break; + case 2: + var value = new proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.deserializeBinaryFromReader); + msg.setCounts(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.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.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.GetDocumentsResponse.GetDocumentsResponseV1.ResultData} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getDocuments(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents.serializeBinaryToWriter + ); + } + f = message.getCounts(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults.serializeBinaryToWriter + ); + } +}; + + +/** + * optional Documents documents = 1; + * @return {?proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents} + */ +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.prototype.getDocuments = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents, 1)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.Documents|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData} returns this +*/ +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.prototype.setDocuments = function(value) { + return jspb.Message.setOneofWrapperField(this, 1, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData} returns this + */ +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.prototype.clearDocuments = function() { + return this.setDocuments(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.prototype.hasDocuments = function() { + return jspb.Message.getField(this, 1) != null; +}; + + /** - * optional CountResults counts = 1; - * @return {?proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults} + * optional CountResults counts = 2; + * @return {?proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.prototype.getCounts = function() { - return /** @type{?proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults} */ ( - jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults, 1)); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.prototype.getCounts = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults, 2)); }; /** - * @param {?proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.CountResults|undefined} value - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0} returns this + * @param {?proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResults|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.prototype.setCounts = function(value) { - return jspb.Message.setOneofWrapperField(this, 1, proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.oneofGroups_[0], value); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.prototype.setCounts = function(value) { + return jspb.Message.setOneofWrapperField(this, 2, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.oneofGroups_[0], value); }; /** * Clears the message field making it undefined. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.prototype.clearCounts = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.prototype.clearCounts = function() { return this.setCounts(undefined); }; @@ -26972,7 +27347,44 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo * Returns whether this field is set. * @return {boolean} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.prototype.hasCounts = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData.prototype.hasCounts = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional ResultData data = 1; + * @return {?proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData} + */ +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.prototype.getData = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData, 1)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultData|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1} returns this +*/ +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.prototype.setData = function(value) { + return jspb.Message.setOneofWrapperField(this, 1, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1} returns this + */ +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.prototype.clearData = function() { + return this.setData(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.prototype.hasData = function() { return jspb.Message.getField(this, 1) != null; }; @@ -26981,7 +27393,7 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo * optional Proof proof = 2; * @return {?proto.org.dash.platform.dapi.v0.Proof} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.prototype.getProof = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.prototype.getProof = function() { return /** @type{?proto.org.dash.platform.dapi.v0.Proof} */ ( jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.Proof, 2)); }; @@ -26989,18 +27401,18 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo /** * @param {?proto.org.dash.platform.dapi.v0.Proof|undefined} value - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.prototype.setProof = function(value) { - return jspb.Message.setOneofWrapperField(this, 2, proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.oneofGroups_[0], value); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.prototype.setProof = function(value) { + return jspb.Message.setOneofWrapperField(this, 2, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.oneofGroups_[0], value); }; /** * Clears the message field making it undefined. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.prototype.clearProof = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.prototype.clearProof = function() { return this.setProof(undefined); }; @@ -27009,7 +27421,7 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo * Returns whether this field is set. * @return {boolean} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.prototype.hasProof = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.prototype.hasProof = function() { return jspb.Message.getField(this, 2) != null; }; @@ -27018,7 +27430,7 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo * optional ResponseMetadata metadata = 3; * @return {?proto.org.dash.platform.dapi.v0.ResponseMetadata} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.prototype.getMetadata = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.prototype.getMetadata = function() { return /** @type{?proto.org.dash.platform.dapi.v0.ResponseMetadata} */ ( jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.ResponseMetadata, 3)); }; @@ -27026,18 +27438,18 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo /** * @param {?proto.org.dash.platform.dapi.v0.ResponseMetadata|undefined} value - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.prototype.setMetadata = function(value) { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.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.GetDocumentsCountResponse.GetDocumentsCountResponseV0} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.prototype.clearMetadata = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.prototype.clearMetadata = function() { return this.setMetadata(undefined); }; @@ -27046,35 +27458,35 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountRespo * Returns whether this field is set. * @return {boolean} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0.prototype.hasMetadata = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.prototype.hasMetadata = function() { return jspb.Message.getField(this, 3) != null; }; /** - * optional GetDocumentsCountResponseV0 v0 = 1; - * @return {?proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0} + * optional GetDocumentsResponseV0 v0 = 1; + * @return {?proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.prototype.getV0 = function() { - return /** @type{?proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0} */ ( - jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0, 1)); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.getV0 = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0, 1)); }; /** - * @param {?proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.GetDocumentsCountResponseV0|undefined} value - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse} returns this + * @param {?proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.prototype.setV0 = function(value) { - return jspb.Message.setOneofWrapperField(this, 1, proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.oneofGroups_[0], value); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.setV0 = function(value) { + return jspb.Message.setOneofWrapperField(this, 1, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.oneofGroups_[0], value); }; /** * Clears the message field making it undefined. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.prototype.clearV0 = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.clearV0 = function() { return this.setV0(undefined); }; @@ -27083,11 +27495,48 @@ proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.prototype.clearV0 = fu * Returns whether this field is set. * @return {boolean} */ -proto.org.dash.platform.dapi.v0.GetDocumentsCountResponse.prototype.hasV0 = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.hasV0 = function() { return jspb.Message.getField(this, 1) != null; }; +/** + * optional GetDocumentsResponseV1 v1 = 2; + * @return {?proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1} + */ +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.getV1 = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1, 2)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse} returns this +*/ +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.setV1 = function(value) { + return jspb.Message.setOneofWrapperField(this, 2, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse} returns this + */ +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.clearV1 = function() { + return this.setV1(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.hasV1 = function() { + return jspb.Message.getField(this, 2) != null; +}; + + /** * Oneof group definitions for this message. Each group defines the field 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 c693f69285a..589095161be 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 @@ -139,15 +139,6 @@ type PlatformgetDocuments = { readonly responseType: typeof platform_pb.GetDocumentsResponse; }; -type PlatformgetDocumentsCount = { - readonly methodName: string; - readonly service: typeof Platform; - readonly requestStream: false; - readonly responseStream: false; - readonly requestType: typeof platform_pb.GetDocumentsCountRequest; - readonly responseType: typeof platform_pb.GetDocumentsCountResponse; -}; - type PlatformgetIdentityByPublicKeyHash = { readonly methodName: string; readonly service: typeof Platform; @@ -588,7 +579,6 @@ export class Platform { static readonly getDataContractHistory: PlatformgetDataContractHistory; static readonly getDataContracts: PlatformgetDataContracts; static readonly getDocuments: PlatformgetDocuments; - static readonly getDocumentsCount: PlatformgetDocumentsCount; static readonly getIdentityByPublicKeyHash: PlatformgetIdentityByPublicKeyHash; static readonly getIdentityByNonUniquePublicKeyHash: PlatformgetIdentityByNonUniquePublicKeyHash; static readonly waitForStateTransitionResult: PlatformwaitForStateTransitionResult; @@ -805,15 +795,6 @@ export class PlatformClient { requestMessage: platform_pb.GetDocumentsRequest, callback: (error: ServiceError|null, responseMessage: platform_pb.GetDocumentsResponse|null) => void ): UnaryResponse; - getDocumentsCount( - requestMessage: platform_pb.GetDocumentsCountRequest, - metadata: grpc.Metadata, - callback: (error: ServiceError|null, responseMessage: platform_pb.GetDocumentsCountResponse|null) => void - ): UnaryResponse; - getDocumentsCount( - requestMessage: platform_pb.GetDocumentsCountRequest, - callback: (error: ServiceError|null, responseMessage: platform_pb.GetDocumentsCountResponse|null) => void - ): UnaryResponse; getIdentityByPublicKeyHash( requestMessage: platform_pb.GetIdentityByPublicKeyHashRequest, 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 b59c679c8df..e7d245b66a6 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 @@ -145,15 +145,6 @@ Platform.getDocuments = { responseType: platform_pb.GetDocumentsResponse }; -Platform.getDocumentsCount = { - methodName: "getDocumentsCount", - service: Platform, - requestStream: false, - responseStream: false, - requestType: platform_pb.GetDocumentsCountRequest, - responseType: platform_pb.GetDocumentsCountResponse -}; - Platform.getIdentityByPublicKeyHash = { methodName: "getIdentityByPublicKeyHash", service: Platform, @@ -1049,37 +1040,6 @@ PlatformClient.prototype.getDocuments = function getDocuments(requestMessage, me }; }; -PlatformClient.prototype.getDocumentsCount = function getDocumentsCount(requestMessage, metadata, callback) { - if (arguments.length === 2) { - callback = arguments[1]; - } - var client = grpc.unary(Platform.getDocumentsCount, { - 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.getIdentityByPublicKeyHash = function getIdentityByPublicKeyHash(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 14dd5bae289..e1c0564a280 100644 --- a/packages/dapi-grpc/protos/platform/v0/platform.proto +++ b/packages/dapi-grpc/protos/platform/v0/platform.proto @@ -36,8 +36,6 @@ service Platform { rpc getDataContracts(GetDataContractsRequest) returns (GetDataContractsResponse); rpc getDocuments(GetDocumentsRequest) returns (GetDocumentsResponse); - rpc getDocumentsCount(GetDocumentsCountRequest) - returns (GetDocumentsCountResponse); rpc getIdentityByPublicKeyHash(GetIdentityByPublicKeyHashRequest) returns (GetIdentityByPublicKeyHashResponse); rpc getIdentityByNonUniquePublicKeyHash( @@ -594,7 +592,182 @@ message GetDocumentsRequest { } bool prove = 8; // Flag to request a proof as the response } - oneof version { GetDocumentsRequestV0 v0 = 1; } + + // SQL-shaped successor to v0 that unifies `getDocuments` and + // `getDocumentsCount` under a single request type with a typed + // `select` projection and optional `group_by` / `having` clauses. + // + // Mode is determined by `select` × `group_by` × `having`: + // + // * `select = DOCUMENTS, group_by = []`: return matched documents + // (identical semantics to v0). + // * `select = COUNT, group_by = []`: return a single aggregate + // count. With an `In` clause the server fans out per-In via + // `query_aggregate_count` and sums (O(|In| × log n), see + // `RangeNoProof`'s compound-summed path); with a range clause + // it uses `AggregateCountOnRange`. + // * `select = COUNT, group_by = []`: return per-group + // `CountEntry` rows. Only supported when the grouping field + // matches an `In`-constrained or range-constrained where clause; + // other shapes return `Unsupported` (see Phase 1 notes below). + // + // `having` is wire-reserved for Phase 2. Any non-empty `having` + // value returns `Unsupported("HAVING clause is not yet + // implemented")` regardless of `select` / `group_by`. + // + // **Phase 1 supported shapes** (everything else rejects with a + // typed `QuerySyntaxError::Unsupported` so callers can detect + // un-wired capabilities without parsing prose). Bullets are + // kept single-line so the generated Rust doc comments don't trip + // rustdoc's `list_item_without_indent` lint on continuation + // lines. + // + // `select=DOCUMENTS, group_by=[]`: any where shape v0 supports. + // + // `select=COUNT, group_by=[]`: + // - empty where → `documentsCountable: true` doctype. + // - `==` only → `countable: true` index covering the fields. + // - one `In` → `countable: true` index covering the fields (per-In aggregate fan-out). + // - one range → `rangeCountable: true` index. + // - one `In` + one range → `rangeCountable: true` compound index (per-In aggregate fan-out on no-proof; rejected on prove because the aggregate proof primitive can't fork). + // + // `select=COUNT, group_by=[g]`: + // - g is the In clause's field → `countable: true` index, grouped by g (PerInValue on no-proof, CountTree element proof per In branch on prove). + // - g is the range clause's field → `rangeCountable: true` index, grouped by g (RangeDistinct on no-proof, distinct range proof on prove). + // + // `select=COUNT, group_by=[a, b]`: + // - a is the In field AND b is the range field, in that order → existing compound distinct shape; entries carry both `in_key` (= a's value) and `key` (= b's value). + // + // **Phase 1 rejected shapes** (return `Unsupported`): + // - any non-empty `having` (always). + // - `select=DOCUMENTS` with non-empty `group_by`. + // - `select=COUNT` with `group_by` on a field that is not constrained by an `In` or range where clause. + // - `select=COUNT` with `group_by.len() > 2`. + // - `select=COUNT` with 2-field `group_by` that does not match the `(in_field, range_field)` shape above. + // + // **Absent-from-tree branches on `In`-grouped queries**: when + // `select=COUNT, group_by=[in_field]` and an `In` value has no + // matching documents, the underlying merk index has nothing to + // emit (zero-count branches aren't materialized as CountTree + // elements), so the wire `CountEntries.entries` list contains + // only the In values that exist. + // + // The SDK's proof decoder surfaces this by **omission**, not by + // a sentinel `count` value: the current point-lookup path query + // doesn't set `absence_proofs_for_non_existing_searched_keys: + // true`, so grovedb's `verify_query` silently drops absent-Key + // branches from the verified elements stream. The drive-side + // verifier (`verify_point_lookup_count_proof`) therefore emits + // one `SplitCountEntry` per **present** In branch and the SDK + // wraps those into `CountEntry`. Callers that need to detect + // "queried but absent" diff their request's In array against + // the returned entries by `key` (each entry's `key` is the + // serialized In value, recoverable via + // `document_type.serialize_value_for_key(in_field, v, …)`). + // `SplitCountEntry::count`'s `Option` and the `None` + // variant exist for a future absence-proof variant; today the + // wire `CountEntry.count` is plain `uint64`. + // + // For range-grouped queries the walker only emits keys that + // exist in the index, which IS SQL-conformant; no equivalent + // reconstruction step because the range itself is unbounded and + // the caller has no explicit "expected keys" list to compare + // against. + message GetDocumentsRequestV1 { + // Projection over the matched row set. Determines whether the + // response carries documents or count results. + enum Select { + // Return matched documents. `group_by` must be empty. + DOCUMENTS = 0; + // Return a count — single aggregate when `group_by` is empty, + // per-group entries when `group_by` names a field. + COUNT = 1; + } + + bytes data_contract_id = 1; // The data contract owning the documents + string document_type = 2; // Document type within the contract + bytes where = 3; // CBOR-encoded where clauses (same shape as v0) + bytes order_by = 4; // CBOR-encoded order_by clauses (same shape as v0) + // Maximum number of rows to return. + // + // **Wire semantics on the `optional uint32` field**: `None` + // (unset) requests the server's default; `Some(N)` with `N > 0` + // requests an explicit cap of `N`. `Some(0)` is **rejected with + // `InvalidLimit` across every SELECT mode** — zero-cap is + // structurally meaningless and the legacy v0 `uint32`-with-0-as- + // sentinel mapping doesn't extend to `optional uint32` (the + // whole point of switching is that `None` carries "unset" + // explicitly). Callers must send `None` for "use server default." + // + // Per-mode behavior of `Some(N > 0)`: + // - `select=DOCUMENTS`: matched-document cap (same as v0). + // - `select=COUNT, group_by=[]`: **rejected with `InvalidLimit` + // when set**. Aggregate count is a single row by construction + // — a limit would either be redundant (≥ 1) or silently + // mislead callers if the dispatcher's per-In fan-out honored + // it and returned a partial sum disguised as a total. Omit + // `limit` for aggregate count. + // - `select=COUNT, group_by=[in_field]`: **rejected with + // `InvalidLimit` when set**. The In array is already capped + // at 100 entries by `WhereClause::in_values()`, so the + // result is bounded by construction; a separate `limit` + // would either be redundant or silently truncate the proof + // to fewer In branches than the caller asked for (the + // PointLookupProof shape can't represent a partial-In + // selection in its `SizedQuery`). Narrow the In array + // directly to reduce the result set. + // - `select=COUNT, group_by=[range_field]`: entries cap on + // the distinct-range walk. + // - `select=COUNT, group_by=[in_field, range_field]`: global + // cap over the emitted `(in_key, key)` lex stream — NOT + // per-In-branch. The compound walk pushes one + // `SizedQuery::limit` over the combined tuple stream, so a + // request with `|In| = 3` and `limit = 5` returns at most + // 5 entries total across all In branches (ordered by + // `(in_key, key)`, direction from the first `order_by` + // clause). + // Both range-grouped variants share the same validate-don't- + // clamp policy on prove paths — `limit > max_query_limit` + // returns `InvalidLimit` rather than silent clamping (see + // `RangeDistinctProof`'s contract; unset falls back to the + // SDK-shared `DEFAULT_QUERY_LIMIT` compile-time constant so + // proof bytes are deterministic across operators). + optional uint32 limit = 5; + + // Pagination cursor. Valid only for `select=DOCUMENTS`. The + // count surface (`select=COUNT`) rejects cursors entirely: + // aggregate counts have no concept of "start," and per-group + // entry paginators would need a new merk walk that doesn't + // exist yet — callers paginate counts by narrowing the + // where-clause range itself instead. + oneof start { + bytes start_after = 6; + bytes start_at = 7; + } + + bool prove = 8; // Request a grovedb proof instead of raw rows + + // SQL `SELECT` projection. Default `DOCUMENTS` keeps v0 semantics + // for callers that just want documents back. + Select select = 9; + + // SQL `GROUP BY` field names, in left-to-right order. Empty = + // no explicit grouping (aggregate for `select=COUNT`). See + // message-level docstring for the Phase 1 supported shapes. + repeated string group_by = 10; + + // SQL `HAVING` clauses, CBOR-encoded the same way as `where`. + // **Phase 1: always rejected when non-empty** with + // `Unsupported("HAVING clause is not yet implemented")`. + // Reserved on the wire so future capability can land without + // another version bump. + bytes having = 11; + } + + oneof version { + GetDocumentsRequestV0 v0 = 1; + GetDocumentsRequestV1 v1 = 2; + } } message GetDocumentsResponse { @@ -610,108 +783,49 @@ message GetDocumentsResponse { } ResponseMetadata metadata = 3; // Metadata about the blockchain state } - oneof version { GetDocumentsResponseV0 v0 = 1; } -} + // v1 response. Two-variant outer `oneof` mirrors every other + // `Get*Response`: a non-proof result at position 1, the proof at + // position 2. The non-proof result is itself a `oneof` because + // a single v1 request can produce either matched documents (for + // `select=DOCUMENTS`) or count results (for `select=COUNT`) — + // wrapping them in an inner `ResultData` keeps the outer shape + // canonical without flattening to a three-variant oneof. + // + // Wire shape by `request.select` × `group_by` × `prove`: + // - `select=DOCUMENTS` (no prove) → `result.data.documents`. + // - `select=COUNT, group_by=[]` (no prove) → `result.data.counts.aggregate_count`. + // - `select=COUNT, group_by=[…]` (no prove) → `result.data.counts.entries`. + // - any select (prove) → `result.proof`. + // + // `CountResults` / `CountEntry` / `CountEntries` are nested in + // `GetDocumentsResponseV1` rather than re-exported from a + // top-level message — the v0 `getDocumentsCount` endpoint that + // previously owned them has been removed in this version (it + // shipped briefly in #3623 and never had stable callers); v1 is + // the single home for the count wire types. + message GetDocumentsResponseV1 { + // Documents result variant — matches the v0 `Documents` + // message field-for-field (kept distinct so v1 doesn't reach + // into v0's namespace once v0 is eventually retired). + message Documents { + repeated bytes documents = 1; + } -// Unified count query. -// -// Mode is determined by the where clauses encoded in `where` plus -// the explicit `return_distinct_counts_in_range` flag. The wire -// shape of the no-proof response makes the mode explicit via -// `CountResults.variant`: -// * No `In` clause and `return_distinct_counts_in_range` = false: -// total count → `CountResults.aggregate_count` (single u64). -// * Exactly one `In` clause (no range): per-`In`-value counts → -// `CountResults.entries`, one `CountEntry` for each value in -// the `In` array constrained by the other `==` clauses. At -// most one `In` per request; multiple `In` clauses are an -// InvalidArgument error. -// * A range clause (`>`, `<`, `between*`, `startsWith`) and -// `return_distinct_counts_in_range` = true: per-distinct-value -// range histogram → `CountResults.entries`, one `CountEntry` -// per distinct value within the range. Requires -// `range_countable: true` on the index (see Indexes book -// chapter). Also supports an `In` clause on a prefix property -// of the index — in that case each entry carries BOTH the In -// value (`CountEntry.in_key`) and the terminator value -// (`CountEntry.key`). Cross-fork sums are NOT computed -// server-side; callers reduce client-side if they want a flat -// histogram (see book chapter "Range Modes"). -// * A range clause with `return_distinct_counts_in_range` = false: -// total over range → `CountResults.aggregate_count`. Also -// requires `range_countable: true`. -// -// When `prove = true`, the response is a grovedb proof instead of -// a `CountResults` value; the client verifies and recovers the -// same per-mode shape (single u64 for aggregate, per-key map for -// distinct). -message GetDocumentsCountRequest { - message GetDocumentsCountRequestV0 { - bytes data_contract_id = 1; - string document_type = 2; - bytes where = 3; // CBOR-encoded where clauses - // Default false (single sum). When true and a range clause is - // present, return per-distinct-value entries within the range. - bool return_distinct_counts_in_range = 4; - // CBOR-encoded order_by clauses. Same encoding as - // `GetDocumentsRequestV0.order_by`. The first clause's direction - // controls entry ordering in split-mode responses (per-`In`-value - // or per-range-distinct-value). On the `RangeDistinctProof` prove - // path the direction is part of the proof's path query, so the - // SDK must reconstruct the same value — empty `order_by` defaults - // to ascending on both sides for determinism. Ignored for - // total-count responses and for the `PointLookupProof` path - // (which sorts In keys lex-ascending unconditionally for prove/ - // no-proof parity). - bytes order_by = 5; - // Maximum number of entries to return. - // - **No-proof paths**: server clamps to its `max_query_limit` - // config; unset → server default. - // - **Prove paths** (`RangeDistinctProof`): validate-don't-clamp. - // `limit > max_query_limit` returns `InvalidLimit` rather than - // silently clamping, because silent clamping would invisibly - // break verification (proof determinism requires the SDK to - // reconstruct the same path query). Unset falls back to - // `crate::config::DEFAULT_QUERY_LIMIT` (a compile-time constant - // the SDK also reads) — explicitly NOT the operator-tunable - // `default_query_limit`, so proof bytes are deterministic - // across operators regardless of their runtime config. - // Has no effect on total-count responses. - optional uint32 limit = 6; - bool prove = 7; - } - oneof version { GetDocumentsCountRequestV0 v0 = 1; } -} - -message GetDocumentsCountResponse { - message GetDocumentsCountResponseV0 { - // A single per-key entry: the splitting key value and how many - // documents match. Used by the `entries` variant of - // `CountResults` for per-`In`-value and per-distinct-value-in- - // range modes. - // - // For compound queries (an `In` clause on a prefix property of a - // `range_countable` index plus a range clause on the terminator), - // each entry carries BOTH the In-fork's prefix value - // (`in_key`) and the terminator value (`key`). Cross-fork - // aggregation is intentionally NOT done server-side — callers - // get the unmerged per-(in_key, key) view and can sum - // client-side if they want a flat histogram. See the book - // chapter ("Range Modes") for rationale. + // A single per-key entry. Carries `in_key` for compound + // queries (`In` on a prefix property of a `range_countable` + // index plus a range clause on the terminator) where each + // entry is keyed by both the In-fork's prefix value (`in_key`) + // and the terminator value (`key`). Cross-fork aggregation is + // intentionally NOT done server-side — callers get the + // unmerged per-`(in_key, key)` view and can reduce client-side + // if they want a flat histogram. message CountEntry { - // Serialized prefix key for compound queries — the In's value - // for this fork. Absent for flat queries with no `In` on - // prefix (in which case entries are keyed purely by `key`). optional bytes in_key = 1; - // Serialized terminator key (the range-property value for - // distinct-range modes, or the `In` value for per-In-value - // mode without a range clause). bytes key = 2; - // `jstype = JS_STRING` so JS/Web clients receive a string and don't - // round counts > 2^53-1 to the nearest representable Number. Matches - // the convention used elsewhere in this proto for `uint64` fields - // that can exceed Number.MAX_SAFE_INTEGER. + // `jstype = JS_STRING` so JS/Web clients receive a string + // and don't round counts > 2^53−1 to the nearest + // representable Number. uint64 count = 3 [jstype = JS_STRING]; } @@ -721,29 +835,40 @@ message GetDocumentsCountResponse { // Non-proof count result. Shape is mode-dependent and made // explicit on the wire via the inner `variant` oneof: - // * `aggregate_count`: total-count and range-without-distinct - // modes — a single u64 with no per-key breakdown. Callers - // read the total directly without scanning an entries list. - // * `entries`: per-`In`-value and per-distinct-value-in-range - // modes — one CountEntry per distinct value, in serialized- - // key order subject to the first `order_by` clause's - // direction and `limit`. + // * `aggregate_count`: `select=COUNT, group_by=[]` — + // single u64 with no per-key breakdown. + // * `entries`: `select=COUNT, group_by=[…]` — one + // CountEntry per distinct group, in serialized-key order + // (subject to the first `order_by` clause's direction and + // `limit`). message CountResults { oneof variant { - // `jstype = JS_STRING` for the same reason as - // `CountEntry.count` — JS Number rounds at 2^53−1. uint64 aggregate_count = 1 [jstype = JS_STRING]; CountEntries entries = 2; } } + // Non-proof result wrapper. The outer `oneof result` switches + // between this and `proof`; this inner oneof switches between + // the two non-proof shapes the v1 surface can return. + message ResultData { + oneof variant { + Documents documents = 1; + CountResults counts = 2; + } + } + oneof result { - CountResults counts = 1; + ResultData data = 1; Proof proof = 2; } ResponseMetadata metadata = 3; } - oneof version { GetDocumentsCountResponseV0 v0 = 1; } + + oneof version { + GetDocumentsResponseV0 v0 = 1; + GetDocumentsResponseV1 v1 = 2; + } } message GetIdentityByPublicKeyHashRequest { diff --git a/packages/rs-dapi-client/src/transport/grpc.rs b/packages/rs-dapi-client/src/transport/grpc.rs index 49c4d7147f0..3b9aa9eed5b 100644 --- a/packages/rs-dapi-client/src/transport/grpc.rs +++ b/packages/rs-dapi-client/src/transport/grpc.rs @@ -205,14 +205,6 @@ impl_transport_request_grpc!( get_documents ); -impl_transport_request_grpc!( - platform_proto::GetDocumentsCountRequest, - platform_proto::GetDocumentsCountResponse, - PlatformGrpcClient, - RequestSettings::default(), - get_documents_count -); - impl_transport_request_grpc!( platform_proto::GetDataContractRequest, platform_proto::GetDataContractResponse, diff --git a/packages/rs-dapi/src/services/platform_service/mod.rs b/packages/rs-dapi/src/services/platform_service/mod.rs index 437a10bf13f..1fa71606a43 100644 --- a/packages/rs-dapi/src/services/platform_service/mod.rs +++ b/packages/rs-dapi/src/services/platform_service/mod.rs @@ -344,12 +344,6 @@ impl Platform for PlatformServiceImpl { dapi_grpc::platform::v0::GetDocumentsResponse ); - drive_method!( - get_documents_count, - dapi_grpc::platform::v0::GetDocumentsCountRequest, - dapi_grpc::platform::v0::GetDocumentsCountResponse - ); - // System methods drive_method!( get_consensus_params, diff --git a/packages/rs-dpp/Cargo.toml b/packages/rs-dpp/Cargo.toml index a9fce764e0c..472d91d725e 100644 --- a/packages/rs-dpp/Cargo.toml +++ b/packages/rs-dpp/Cargo.toml @@ -71,7 +71,7 @@ strum = { version = "0.26", features = ["derive"] } json-schema-compatibility-validator = { path = '../rs-json-schema-compatibility-validator', optional = true } once_cell = "1.19.0" tracing = { version = "0.1.41" } -grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "a917d92d2477672eed73c4c08e53e93449a6a094", optional = true } +grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "7a649386ac8a06a608a614385a2333e03cd931c3", optional = true } [dev-dependencies] tokio = { version = "1.40", features = ["full"] } diff --git a/packages/rs-dpp/src/withdrawal/mod.rs b/packages/rs-dpp/src/withdrawal/mod.rs index 8a5fc3a0f5f..0d39b205992 100644 --- a/packages/rs-dpp/src/withdrawal/mod.rs +++ b/packages/rs-dpp/src/withdrawal/mod.rs @@ -143,7 +143,7 @@ pub mod pooling_serde { (Pooling::Standard, 2), ] { let bytes = - bincode::serde::encode_to_vec(&Wrap(variant), bincode::config::standard()) + bincode::serde::encode_to_vec(Wrap(variant), bincode::config::standard()) .expect("bincode encode"); assert_eq!(bytes.last(), Some(&expected_u8)); let (restored, _): (Wrap, usize) = diff --git a/packages/rs-drive-abci/Cargo.toml b/packages/rs-drive-abci/Cargo.toml index 423531000c0..2a2fda97c30 100644 --- a/packages/rs-drive-abci/Cargo.toml +++ b/packages/rs-drive-abci/Cargo.toml @@ -82,7 +82,7 @@ derive_more = { version = "1.0", features = ["from", "deref", "deref_mut"] } async-trait = "0.1.77" console-subscriber = { version = "0.4", optional = true } bls-signatures = { git = "https://github.com/dashpay/bls-signatures", rev = "0842b17583888e8f46c252a4ee84cdfd58e0546f", optional = true } -grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "a917d92d2477672eed73c4c08e53e93449a6a094" } +grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "7a649386ac8a06a608a614385a2333e03cd931c3" } nonempty = "0.11" [dev-dependencies] @@ -103,7 +103,7 @@ dpp = { path = "../rs-dpp", default-features = false, features = [ drive = { path = "../rs-drive", features = ["fixtures-and-mocks"] } drive-proof-verifier = { path = "../rs-drive-proof-verifier" } strategy-tests = { path = "../strategy-tests" } -grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "a917d92d2477672eed73c4c08e53e93449a6a094", features = ["client"] } +grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "7a649386ac8a06a608a614385a2333e03cd931c3", features = ["client"] } assert_matches = "1.5.0" drive-abci = { path = ".", features = ["testing-config", "mocks"] } bls-signatures = { git = "https://github.com/dashpay/bls-signatures", rev = "0842b17583888e8f46c252a4ee84cdfd58e0546f" } diff --git a/packages/rs-drive-abci/src/query/document_count_query/mod.rs b/packages/rs-drive-abci/src/query/document_count_query/mod.rs deleted file mode 100644 index 61f10e4f3a9..00000000000 --- a/packages/rs-drive-abci/src/query/document_count_query/mod.rs +++ /dev/null @@ -1,54 +0,0 @@ -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_documents_count_request::Version as RequestVersion; -use dapi_grpc::platform::v0::get_documents_count_response::Version as ResponseVersion; -use dapi_grpc::platform::v0::{GetDocumentsCountRequest, GetDocumentsCountResponse}; -use dpp::version::PlatformVersion; - -mod v0; - -impl Platform { - /// Querying of document count - pub fn query_documents_count( - &self, - GetDocumentsCountRequest { version }: GetDocumentsCountRequest, - platform_state: &PlatformState, - platform_version: &PlatformVersion, - ) -> Result, Error> { - let Some(version) = version else { - return Ok(QueryValidationResult::new_with_error( - QueryError::DecodingError("could not decode documents count query".to_string()), - )); - }; - - let feature_version_bounds = &platform_version.drive_abci.query.document_count_query; - - let feature_version = match &version { - RequestVersion::V0(_) => 0, - }; - if !feature_version_bounds.check_version(feature_version) { - return Ok(QueryValidationResult::new_with_error( - QueryError::UnsupportedQueryVersion( - "documents_count".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_documents_count_v0(request_v0, platform_state, platform_version)?; - - Ok(result.map(|response_v0| GetDocumentsCountResponse { - version: Some(ResponseVersion::V0(response_v0)), - })) - } - } - } -} diff --git a/packages/rs-drive-abci/src/query/document_count_query/v0/mod.rs b/packages/rs-drive-abci/src/query/document_count_query/v0/mod.rs deleted file mode 100644 index c97f3d971d2..00000000000 --- a/packages/rs-drive-abci/src/query/document_count_query/v0/mod.rs +++ /dev/null @@ -1,1149 +0,0 @@ -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::response_metadata::CheckpointUsed; -use crate::query::QueryValidationResult; -use dapi_grpc::platform::v0::get_documents_count_request::GetDocumentsCountRequestV0; -use dapi_grpc::platform::v0::get_documents_count_response::{ - get_documents_count_response_v0, GetDocumentsCountResponseV0, -}; -use dpp::check_validation_result_with_data; -use dpp::data_contract::accessors::v0::DataContractV0Getters; -use dpp::identifier::Identifier; -use dpp::platform_value::Value; -use dpp::validation::ValidationResult; -use dpp::version::PlatformVersion; -use drive::error::query::QuerySyntaxError; -use drive::query::{DocumentCountRequest, DocumentCountResponse, SplitCountEntry}; -use drive::util::grove_operations::GroveDBToUse; - -/// Wrap a single aggregate `u64` plus current-state metadata into the -/// protobuf `GetDocumentsCountResponseV0`. Produces the `CountResults -/// .variant.AggregateCount(_)` wire shape used by total-count and -/// range-without-distinct modes — the dispatcher routes drive's -/// `DocumentCountResponse::Aggregate(_)` through here so the wire -/// answer is a single u64, not an entries map with one empty-key -/// entry. -fn count_response_aggregate( - count: u64, - platform: &Platform, - platform_state: &PlatformState, -) -> GetDocumentsCountResponseV0 { - GetDocumentsCountResponseV0 { - result: Some(get_documents_count_response_v0::Result::Counts( - get_documents_count_response_v0::CountResults { - variant: Some( - get_documents_count_response_v0::count_results::Variant::AggregateCount(count), - ), - }, - )), - metadata: Some(platform.response_metadata_v0(platform_state, CheckpointUsed::Current)), - } -} - -/// Wrap a vector of [`SplitCountEntry`]s plus current-state metadata -/// into the protobuf `GetDocumentsCountResponseV0`. Produces the -/// `CountResults.variant.Entries(_)` wire shape used by per-`In`-value -/// and per-distinct-value-in-range modes. Note that an aggregate -/// total never reaches here — see [`count_response_aggregate`]. -fn count_response_with_entries( - entries: Vec, - platform: &Platform, - platform_state: &PlatformState, -) -> GetDocumentsCountResponseV0 { - let entries: Vec = entries - .into_iter() - .map(|e| get_documents_count_response_v0::CountEntry { - in_key: e.in_key, - key: e.key, - count: e.count, - }) - .collect(); - GetDocumentsCountResponseV0 { - result: Some(get_documents_count_response_v0::Result::Counts( - get_documents_count_response_v0::CountResults { - variant: Some( - get_documents_count_response_v0::count_results::Variant::Entries( - get_documents_count_response_v0::CountEntries { entries }, - ), - ), - }, - )), - metadata: Some(platform.response_metadata_v0(platform_state, CheckpointUsed::Current)), - } -} - -impl Platform { - pub(super) fn query_documents_count_v0( - &self, - GetDocumentsCountRequestV0 { - data_contract_id, - document_type: document_type_name, - r#where, - return_distinct_counts_in_range, - order_by, - limit, - prove, - }: GetDocumentsCountRequestV0, - platform_state: &PlatformState, - platform_version: &PlatformVersion, - ) -> Result, Error> { - let contract_id: Identifier = check_validation_result_with_data!(data_contract_id - .try_into() - .map_err(|_| QueryError::InvalidArgument( - "id must be a valid identifier (32 bytes long)".to_string() - ))); - - let (_, contract) = self.drive.get_contract_with_fetch_info_and_fee( - contract_id.to_buffer(), - None, - true, - None, - platform_version, - )?; - - let contract = check_validation_result_with_data!(contract.ok_or(QueryError::Query( - QuerySyntaxError::DataContractNotFound( - "contract not found when querying from value with contract info", - ) - ))); - - let contract_ref = &contract.contract; - - let document_type = check_validation_result_with_data!(contract_ref - .document_type_for_name(document_type_name.as_str()) - .map_err(|_| QueryError::InvalidArgument(format!( - "document type {} not found for contract {}", - document_type_name, contract_id - )))); - - let where_clause = if r#where.is_empty() { - Value::Null - } else { - check_validation_result_with_data!(ciborium::de::from_reader(r#where.as_slice()) - .map_err(|_| { - QueryError::Query(QuerySyntaxError::DeserializationError( - "unable to decode 'where' query from cbor".to_string(), - )) - })) - }; - - // `order_by` is decoded the same way as `where`: empty bytes - // → `Value::Null` (no clauses), any other shape must be a - // CBOR-encoded outer array of `[field, direction]` inner - // arrays. Drive parses + validates per clause. Required on - // the `(In + prove)` dispatch arm for proof determinism; - // empty is fine on every other arm (drive synthesizes an - // ascending default for split-mode entry direction). - let order_by_clause = if order_by.is_empty() { - Value::Null - } else { - check_validation_result_with_data!(ciborium::de::from_reader(order_by.as_slice()) - .map_err(|_| { - QueryError::Query(QuerySyntaxError::DeserializationError( - "unable to decode 'order_by' query from cbor".to_string(), - )) - })) - }; - - // Hand the raw decoded where + order_by `Value`s to drive — - // same pattern `query_documents_v0` uses. Drive parses + - // validates per clause and surfaces any error as - // `Error::Query(...)`, which the existing match arm below maps - // to a query-validation result. Drive also applies per-mode - // limit policy: - // - no-proof modes silently clamp to `max_query_limit` - // (proto contract — "passing a larger value just gets - // clamped, not rejected") - // - the prove-distinct mode rejects `limit > max_query_limit` - // instead of clamping, because client-side proof - // reconstruction needs the exact same limit value the - // server used; silent clamping would silently break - // verification on requests above the cap. - let request = DocumentCountRequest { - contract: contract_ref, - document_type, - raw_where_value: where_clause, - raw_order_by_value: order_by_clause, - return_distinct_counts_in_range, - limit, - prove, - drive_config: &self.config.drive, - }; - let drive_response = - match self - .drive - .execute_document_count_request(request, None, platform_version) - { - Ok(r) => r, - Err(drive::error::Error::Query(qe)) => { - return Ok(QueryValidationResult::new_with_error(QueryError::Query(qe))); - } - Err(e) => return Err(e.into()), - }; - - let response = match drive_response { - DocumentCountResponse::Aggregate(count) => { - count_response_aggregate(count, self, platform_state) - } - DocumentCountResponse::Entries(entries) => { - count_response_with_entries(entries, self, platform_state) - } - DocumentCountResponse::Proof(proof_bytes) => { - let (grovedb_used, proof) = - self.response_proof_v0(platform_state, proof_bytes, GroveDBToUse::Current)?; - GetDocumentsCountResponseV0 { - result: Some(get_documents_count_response_v0::Result::Proof(proof)), - metadata: Some(self.response_metadata_v0(platform_state, grovedb_used)), - } - } - }; - Ok(QueryValidationResult::new_with_data(response)) - } -} - -#[cfg(test)] -mod tests { - use super::*; - use crate::query::tests::{setup_platform, store_data_contract, store_document}; - use dpp::dashcore::Network; - use dpp::data_contract::document_type::random_document::CreateRandomDocument; - use dpp::document::DocumentV0Setters; - use dpp::tests::json_document::json_document_to_contract_with_ids; - use rand::rngs::StdRng; - use rand::SeedableRng; - - /// Builds an in-memory v12 contract with a `widget` document type - /// that has `documentsCountable: true` — the type's primary-key - /// tree becomes a CountTree, enabling the unfiltered total-count - /// fast path on both no-proof and prove paths. - fn build_documents_countable_widget_contract() -> dpp::prelude::DataContract { - use dpp::data_contract::DataContractFactory; - use dpp::platform_value::platform_value; - - const PROTOCOL_VERSION_V12: u32 = 12; - let factory = - DataContractFactory::new(PROTOCOL_VERSION_V12).expect("expected to create factory"); - let document_schema = platform_value!({ - "type": "object", - "documentsCountable": true, - "properties": { - "color": {"type": "string", "position": 0, "maxLength": 32}, - }, - "additionalProperties": false, - }); - let schemas = platform_value!({ "widget": document_schema }); - factory - .create_with_value_config( - dpp::tests::utils::generate_random_identifier_struct(), - 0, - schemas, - None, - None, - ) - .expect("create contract") - .data_contract_owned() - } - - /// Unfiltered total count via the `documentsCountable: true` fast - /// path. Asserts O(1) read of the primary-key CountTree returns - /// the correct count after a few inserts. - #[test] - fn test_documents_count_no_prove() { - use dpp::data_contract::accessors::v0::DataContractV0Getters; - - let (platform, state, version) = setup_platform(None, Network::Testnet, None); - let platform_version = PlatformVersion::latest(); - - let contract = build_documents_countable_widget_contract(); - store_data_contract(&platform, &contract, version); - - let document_type = contract - .document_type_for_name("widget") - .expect("widget exists"); - - // Insert 5 widgets. - for i in 1..=5u8 { - let random_document = document_type - .random_document(Some(i as u64), platform_version) - .expect("expected to get random document"); - store_document( - &platform, - &contract, - document_type, - &random_document, - platform_version, - ); - } - - let request = GetDocumentsCountRequestV0 { - data_contract_id: contract.id().to_vec(), - document_type: "widget".to_string(), - r#where: vec![], - return_distinct_counts_in_range: false, - order_by: Vec::new(), - limit: None, - prove: false, - }; - - let result = platform - .query_documents_count_v0(request, &state, version) - .expect("expected query to succeed"); - - assert!(result.errors.is_empty(), "errors: {:?}", result.errors); - - match result.data { - Some(GetDocumentsCountResponseV0 { - result: Some(get_documents_count_response_v0::Result::Counts( - get_documents_count_response_v0::CountResults { - variant: - Some(get_documents_count_response_v0::count_results::Variant::AggregateCount( - total, - )), - }, - )), - metadata: Some(_), - }) => { - assert_eq!(total, 5, "expected count of 5 documents"); - } - other => panic!("expected aggregate count result, got {:?}", other), - } - } - - /// Same fast-path query as `test_documents_count_no_prove`, but - /// against an empty contract (no documents inserted). Asserts the - /// path returns 0 cleanly rather than erroring. - #[test] - fn test_documents_count_empty_result() { - use dpp::data_contract::accessors::v0::DataContractV0Getters; - - let (platform, state, version) = setup_platform(None, Network::Testnet, None); - let _platform_version = PlatformVersion::latest(); - - let contract = build_documents_countable_widget_contract(); - store_data_contract(&platform, &contract, version); - - let request = GetDocumentsCountRequestV0 { - data_contract_id: contract.id().to_vec(), - document_type: "widget".to_string(), - r#where: vec![], - return_distinct_counts_in_range: false, - order_by: Vec::new(), - limit: None, - prove: false, - }; - - let result = platform - .query_documents_count_v0(request, &state, version) - .expect("expected query to succeed"); - - assert!(result.errors.is_empty(), "errors: {:?}", result.errors); - - match result.data { - Some(GetDocumentsCountResponseV0 { - result: Some(get_documents_count_response_v0::Result::Counts( - get_documents_count_response_v0::CountResults { - variant: - Some(get_documents_count_response_v0::count_results::Variant::AggregateCount( - total, - )), - }, - )), - metadata: Some(_), - }) => { - assert_eq!(total, 0, "expected count of 0 documents"); - } - other => panic!("expected aggregate count result, got {:?}", other), - } - } - - fn serialize_where_clauses_to_cbor(where_clauses: Vec) -> Vec { - use ciborium::value::Value as CborValue; - let cbor: CborValue = TryInto::::try_into(Value::Array(where_clauses)) - .expect("expected to convert where clauses to cbor value"); - let mut out = Vec::new(); - ciborium::ser::into_writer(&cbor, &mut out).expect("expected to serialize where clauses"); - out - } - - fn store_person_document( - platform: &crate::test::helpers::setup::TempPlatform, - data_contract: &dpp::prelude::DataContract, - id: [u8; 32], - first_name: &str, - last_name: &str, - age: u64, - platform_version: &PlatformVersion, - ) { - use dpp::document::{Document, DocumentV0}; - use std::collections::BTreeMap; - - let document_type = data_contract - .document_type_for_name("person") - .expect("expected document type"); - - let mut properties = BTreeMap::new(); - properties.insert("firstName".to_string(), Value::Text(first_name.to_string())); - properties.insert("lastName".to_string(), Value::Text(last_name.to_string())); - properties.insert("age".to_string(), Value::U64(age)); - - let document: Document = DocumentV0 { - id: Identifier::from(id), - owner_id: Identifier::from([0u8; 32]), - properties, - revision: None, - created_at: None, - updated_at: None, - transferred_at: None, - created_at_block_height: None, - updated_at_block_height: None, - transferred_at_block_height: None, - created_at_core_block_height: None, - updated_at_core_block_height: None, - transferred_at_core_block_height: None, - creator_id: None, - } - .into(); - - store_document( - platform, - data_contract, - document_type, - &document, - platform_version, - ); - } - - #[test] - fn test_documents_count_with_in_operator() { - let (platform, state, version) = setup_platform(None, Network::Testnet, None); - let platform_version = PlatformVersion::latest(); - - let data_contract = json_document_to_contract_with_ids( - "tests/supporting_files/contract/family/family-contract-countable.json", - None, - None, - false, - platform_version, - ) - .expect("expected to get json based contract"); - - store_data_contract(&platform, &data_contract, version); - - // 3 docs with age=30, 2 with age=40, 1 with age=50. - store_person_document( - &platform, - &data_contract, - [1u8; 32], - "Alice", - "Smith", - 30, - platform_version, - ); - store_person_document( - &platform, - &data_contract, - [2u8; 32], - "Bob", - "Smith", - 30, - platform_version, - ); - store_person_document( - &platform, - &data_contract, - [3u8; 32], - "Carol", - "Smith", - 30, - platform_version, - ); - store_person_document( - &platform, - &data_contract, - [4u8; 32], - "Dave", - "Smith", - 40, - platform_version, - ); - store_person_document( - &platform, - &data_contract, - [5u8; 32], - "Eve", - "Smith", - 40, - platform_version, - ); - store_person_document( - &platform, - &data_contract, - [6u8; 32], - "Frank", - "Smith", - 50, - platform_version, - ); - - // [["age", "in", [30, 40]]] - let where_clauses = vec![Value::Array(vec![ - Value::Text("age".to_string()), - Value::Text("in".to_string()), - Value::Array(vec![Value::U64(30), Value::U64(40)]), - ])]; - - let request = GetDocumentsCountRequestV0 { - data_contract_id: data_contract.id().to_vec(), - document_type: "person".to_string(), - r#where: serialize_where_clauses_to_cbor(where_clauses), - return_distinct_counts_in_range: false, - order_by: Vec::new(), - limit: None, - prove: false, - }; - - let result = platform - .query_documents_count_v0(request, &state, version) - .expect("expected query to succeed"); - - assert!(result.errors.is_empty(), "errors: {:?}", result.errors); - - match result.data { - Some(GetDocumentsCountResponseV0 { - result: - Some(get_documents_count_response_v0::Result::Counts( - get_documents_count_response_v0::CountResults { - variant: - Some(get_documents_count_response_v0::count_results::Variant::Entries( - entries, - )), - }, - )), - metadata: Some(_), - }) => { - let total: u64 = entries.entries.iter().map(|e| e.count).sum(); - assert_eq!(total, 5, "expected count of 5 (3 age=30 + 2 age=40)"); - } - other => panic!("expected per-In-value entries result, got {:?}", other), - } - } - - #[test] - fn test_documents_count_range_without_range_countable_index_returns_clear_error() { - let (platform, state, version) = setup_platform(None, Network::Testnet, None); - let platform_version = PlatformVersion::latest(); - - let data_contract = json_document_to_contract_with_ids( - "tests/supporting_files/contract/family/family-contract-countable.json", - None, - None, - false, - platform_version, - ) - .expect("expected to get json based contract"); - - store_data_contract(&platform, &data_contract, version); - - // [["age", ">", 20]] — range operator on a contract whose `age` - // index is `countable` but NOT `range_countable`. The range - // path now accepts range operators, but the picker must report - // "no usable index" so the handler surfaces a clear error. - let where_clauses = vec![Value::Array(vec![ - Value::Text("age".to_string()), - Value::Text(">".to_string()), - Value::U64(20), - ])]; - - let request = GetDocumentsCountRequestV0 { - data_contract_id: data_contract.id().to_vec(), - document_type: "person".to_string(), - r#where: serialize_where_clauses_to_cbor(where_clauses), - return_distinct_counts_in_range: false, - order_by: Vec::new(), - limit: None, - prove: false, - }; - - let result = platform - .query_documents_count_v0(request, &state, version) - .expect("expected query to return validation error"); - - // Step 2 of the refactor moved the no-covering-index check into - // rs-drive, where it surfaces as - // `Query(WhereClauseOnNonIndexedProperty)` rather than the - // handler-local `InvalidArgument`. Both shapes are valid - // rejections — accept either. - assert!( - matches!( - result.errors.as_slice(), - [QueryError::InvalidArgument(msg)] if msg.contains("range_countable") - ) || matches!( - result.errors.as_slice(), - [QueryError::Query(QuerySyntaxError::WhereClauseOnNonIndexedProperty(msg))] - if msg.contains("range_countable") - ), - "expected range_countable-index rejection, got {:?}", - result.errors - ); - } - - /// `prove = true` + Equal-on-single-property-countable-index = - /// the fully-covered fast path that produces a real grovedb proof - /// of the CountTree element at `[..., firstName, "Alice", 0]`. - /// Asserts the response is a `Proof` variant with non-empty bytes - /// — drive emits a CountTree element proof here, not the legacy - /// materialize-and-count document proof. - #[test] - fn test_documents_count_with_prove_and_covering_equal() { - use dpp::document::DocumentV0Setters; - - let (platform, state, version) = setup_platform(None, Network::Testnet, None); - let platform_version = PlatformVersion::latest(); - - let data_contract = json_document_to_contract_with_ids( - "tests/supporting_files/contract/family/family-contract-countable.json", - None, - None, - false, - platform_version, - ) - .expect("expected to get json based contract"); - - store_data_contract(&platform, &data_contract, version); - - let document_type = data_contract - .document_type_for_name("person") - .expect("expected document type"); - - // Insert 2 docs at firstName=Alice and 1 at firstName=Bob so - // the targeted CountTree (`byFirstName` index, value=Alice) - // has count_value > 0. - let mut std_rng = StdRng::seed_from_u64(500); - for first_name in ["Alice", "Alice", "Bob"] { - let mut doc = document_type - .random_document_with_rng(&mut std_rng, platform_version) - .expect("expected to get random document"); - let mut props = std::collections::BTreeMap::new(); - props.insert("firstName".to_string(), Value::Text(first_name.to_string())); - props.insert("lastName".to_string(), Value::Text("Smith".to_string())); - props.insert("age".to_string(), Value::U64(30)); - doc.set_properties(props); - store_document( - &platform, - &data_contract, - document_type, - &doc, - platform_version, - ); - } - - let where_clauses = vec![Value::Array(vec![ - Value::Text("firstName".to_string()), - Value::Text("==".to_string()), - Value::Text("Alice".to_string()), - ])]; - - let request = GetDocumentsCountRequestV0 { - data_contract_id: data_contract.id().to_vec(), - document_type: "person".to_string(), - r#where: serialize_where_clauses_to_cbor(where_clauses), - return_distinct_counts_in_range: false, - order_by: Vec::new(), - limit: None, - prove: true, - }; - - let result = platform - .query_documents_count_v0(request, &state, version) - .expect("expected query to succeed"); - - assert!(result.errors.is_empty(), "errors: {:?}", result.errors); - - match result.data { - Some(GetDocumentsCountResponseV0 { - result: Some(get_documents_count_response_v0::Result::Proof(proof)), - metadata: Some(_), - }) => { - assert!( - !proof.grovedb_proof.is_empty(), - "expected non-empty grovedb proof bytes for covered prove count", - ); - } - other => panic!("expected Proof response, got {:?}", other), - } - } - - /// Symmetric-rejection contract: `prove = true` with no where - /// clauses (or any where shape that doesn't fully cover a - /// `countable: true` index) rejects with - /// `WhereClauseOnNonIndexedProperty`. Matches the no-proof Total - /// mode's behaviour when no covering countable index exists, and - /// makes contract authors' index-design defects visible at the - /// API boundary rather than silently materializing every doc. - #[test] - fn test_documents_count_prove_without_covering_index_returns_clear_error() { - let (platform, state, version) = setup_platform(None, Network::Testnet, None); - let platform_version = PlatformVersion::latest(); - - let data_contract = json_document_to_contract_with_ids( - "tests/supporting_files/contract/family/family-contract-countable.json", - None, - None, - false, - platform_version, - ) - .expect("expected to get json based contract"); - - store_data_contract(&platform, &data_contract, version); - - let request = GetDocumentsCountRequestV0 { - data_contract_id: data_contract.id().to_vec(), - document_type: "person".to_string(), - r#where: vec![], - return_distinct_counts_in_range: false, - order_by: Vec::new(), - limit: None, - prove: true, - }; - - let result = platform - .query_documents_count_v0(request, &state, version) - .expect("expected query to surface a validation error"); - - assert!( - matches!( - result.errors.as_slice(), - [QueryError::Query( - QuerySyntaxError::WhereClauseOnNonIndexedProperty(msg), - )] if msg.contains("countable") - ), - "expected covering-index rejection, got {:?}", - result.errors, - ); - } - - /// End-to-end pin for `prove = true` + `In`. - /// - /// `detect_mode` must route `(has_range=false, has_in=true, - /// prove=true, _)` to `PointLookupProof`, which builds a - /// per-branch CountTree-element proof via the shared - /// [`DriveDocumentCountQuery::point_lookup_count_path_query`] - /// builder (no document materialization, no `u16::MAX` cap on - /// matching docs — the proof shape is O(|In values| × log n)). - /// A regression that dispatches In+prove back through - /// `PerInValue` would emit a `Counts(...)` no-proof variant - /// instead, and the SDK verifier would bail with - /// `NoProofInResult`. - /// - /// Asserts the response variant is `Proof(non-empty bytes)`. - /// `order_by` is unused on this path — the builder sorts In - /// keys lex-ascending unconditionally for prove/no-proof - /// parity (see `point_lookup_count_path_query`), so proof - /// determinism is independent of the request's order_by. - #[test] - fn test_documents_count_with_in_and_prove_returns_proof() { - let (platform, state, version) = setup_platform(None, Network::Testnet, None); - let platform_version = PlatformVersion::latest(); - - let data_contract = json_document_to_contract_with_ids( - "tests/supporting_files/contract/family/family-contract-countable.json", - None, - None, - false, - platform_version, - ) - .expect("expected to get json based contract"); - - store_data_contract(&platform, &data_contract, version); - - // Same distribution as `test_documents_count_with_in_operator`: - // 3 docs at age=30, 2 at age=40, 1 at age=50. We ask for - // `age in [30, 40]` so the proof has to cover two forks. One - // doc at age=50 is outside the In set, so the proof must NOT - // collapse to the full contents. - for (id, name, age) in [ - ([1u8; 32], "Alice", 30u64), - ([2u8; 32], "Bob", 30), - ([3u8; 32], "Carol", 30), - ([4u8; 32], "Dave", 40), - ([5u8; 32], "Eve", 40), - ([6u8; 32], "Frank", 50), - ] { - store_person_document( - &platform, - &data_contract, - id, - name, - "Smith", - age, - platform_version, - ); - } - - // [["age", "in", [30, 40]]] - let where_clauses = vec![Value::Array(vec![ - Value::Text("age".to_string()), - Value::Text("in".to_string()), - Value::Array(vec![Value::U64(30), Value::U64(40)]), - ])]; - - // [["age", "asc"]] — required for the materialize-and-count - // proof walker; bug #2 in the doc comment above turned this - // omission into a hard error. - let order_by = vec![Value::Array(vec![ - Value::Text("age".to_string()), - Value::Text("asc".to_string()), - ])]; - - let request = GetDocumentsCountRequestV0 { - data_contract_id: data_contract.id().to_vec(), - document_type: "person".to_string(), - r#where: serialize_where_clauses_to_cbor(where_clauses), - return_distinct_counts_in_range: false, - order_by: serialize_where_clauses_to_cbor(order_by), - limit: None, - prove: true, - }; - - let result = platform - .query_documents_count_v0(request, &state, version) - .expect("expected query to succeed"); - - assert!(result.errors.is_empty(), "errors: {:?}", result.errors); - - match result.data { - Some(GetDocumentsCountResponseV0 { - result: Some(get_documents_count_response_v0::Result::Proof(proof)), - metadata: Some(_), - }) => { - // Non-empty grovedb proof bytes pin that the - // `PointLookupProof` dispatch actually emitted a - // materialize-and-count proof rather than a - // degenerate empty envelope. End-to-end SDK-verifier - // round-trip (group verified docs by the In field's - // serialized value → per-key entries) is exercised - // by the SDK integration tests once those are - // restored post-testnet. - assert!( - !proof.grovedb_proof.is_empty(), - "expected non-empty grovedb proof bytes for In + prove count" - ); - } - other => panic!( - "expected Proof response from In + prove count, got {:?}", - other - ), - } - } - - /// End-to-end test for the range count happy path against a v12 - /// contract whose `widget` document type carries a - /// `rangeCountable: true` index over `color`. Exercises the - /// `find_range_countable_index_for_where_clauses` → - /// `execute_range_count_no_proof` route in the no-prove handler, - /// in both summed and distinct modes plus the pagination knobs. - #[test] - fn test_documents_count_range_query_no_prove() { - use dpp::data_contract::DataContractFactory; - use dpp::document::DocumentV0Setters; - use dpp::platform_value::platform_value; - - const PROTOCOL_VERSION_V12: u32 = 12; - - let (platform, state, version) = setup_platform(None, Network::Testnet, None); - let platform_version = PlatformVersion::latest(); - - // Build an in-memory v12 contract with a range_countable index. - let factory = - DataContractFactory::new(PROTOCOL_VERSION_V12).expect("expected to create factory"); - let document_schema = platform_value!({ - "type": "object", - "properties": { - "color": {"type": "string", "position": 0, "maxLength": 32}, - }, - "indices": [{ - "name": "byColor", - "properties": [{"color": "asc"}], - "countable": "countable", - "rangeCountable": true, - }], - "additionalProperties": false, - }); - let schemas = platform_value!({ "widget": document_schema }); - let contract = factory - .create_with_value_config( - dpp::tests::utils::generate_random_identifier_struct(), - 0, - schemas, - None, - None, - ) - .expect("create contract") - .data_contract_owned(); - - store_data_contract(&platform, &contract, version); - - let document_type = contract - .document_type_for_name("widget") - .expect("widget exists"); - - // 6 docs across 3 colors: red×2, blue×1, green×3. - for (i, color) in ["red", "red", "blue", "green", "green", "green"] - .iter() - .enumerate() - { - let mut doc = document_type - .random_document(Some((i + 1) as u64), platform_version) - .expect("random doc"); - let mut props = std::collections::BTreeMap::new(); - props.insert("color".to_string(), Value::Text(color.to_string())); - doc.set_properties(props); - store_document(&platform, &contract, document_type, &doc, platform_version); - } - - // Helper: issue a range count request with the given options. - // `ascending` controls the direction encoded into the - // `order_by` field as `[["color", "asc"|"desc"]]`. `None` → - // empty `order_by` bytes, which drive treats as "use ascending - // default" for split-mode entry ordering. - let make_request = |distinct: bool, limit: Option, ascending: Option| { - let where_clauses = vec![Value::Array(vec![ - Value::Text("color".to_string()), - Value::Text(">".to_string()), - Value::Text("blue".to_string()), - ])]; - let order_by_bytes = match ascending { - Some(asc) => serialize_where_clauses_to_cbor(vec![Value::Array(vec![ - Value::Text("color".to_string()), - Value::Text(if asc { "asc" } else { "desc" }.to_string()), - ])]), - None => Vec::new(), - }; - GetDocumentsCountRequestV0 { - data_contract_id: contract.id().to_vec(), - document_type: "widget".to_string(), - r#where: serialize_where_clauses_to_cbor(where_clauses), - return_distinct_counts_in_range: distinct, - order_by: order_by_bytes, - limit, - prove: false, - } - }; - - // Sum mode: green(3) + red(2) = 5. Range-without-distinct - // collapses to `AggregateCount` on the wire (no empty-key - // entry wrapping). - let result = platform - .query_documents_count_v0(make_request(false, None, None), &state, version) - .expect("query should succeed"); - assert!(result.errors.is_empty(), "errors: {:?}", result.errors); - match result.data { - Some(GetDocumentsCountResponseV0 { - result: Some(get_documents_count_response_v0::Result::Counts( - get_documents_count_response_v0::CountResults { - variant: - Some(get_documents_count_response_v0::count_results::Variant::AggregateCount( - total, - )), - }, - )), - .. - }) => { - assert_eq!(total, 5, "summed range mode → aggregate of 5"); - } - other => panic!("expected aggregate result, got {:?}", other), - } - - // Distinct mode ascending: [(green, 3), (red, 2)] in entries. - let result = platform - .query_documents_count_v0(make_request(true, None, Some(true)), &state, version) - .expect("query should succeed"); - assert!(result.errors.is_empty(), "errors: {:?}", result.errors); - match result.data { - Some(GetDocumentsCountResponseV0 { - result: - Some(get_documents_count_response_v0::Result::Counts( - get_documents_count_response_v0::CountResults { - variant: - Some(get_documents_count_response_v0::count_results::Variant::Entries( - entries, - )), - }, - )), - .. - }) => { - assert_eq!(entries.entries.len(), 2); - assert_eq!(entries.entries[0].key, b"green".to_vec()); - assert_eq!(entries.entries[0].count, 3); - assert_eq!(entries.entries[1].key, b"red".to_vec()); - assert_eq!(entries.entries[1].count, 2); - } - other => panic!("expected entries result, got {:?}", other), - } - - // Distinct mode with limit=1: only the first entry (ascending → green). - let result = platform - .query_documents_count_v0(make_request(true, Some(1), Some(true)), &state, version) - .expect("query should succeed"); - assert!(result.errors.is_empty()); - match result.data { - Some(GetDocumentsCountResponseV0 { - result: - Some(get_documents_count_response_v0::Result::Counts( - get_documents_count_response_v0::CountResults { - variant: - Some(get_documents_count_response_v0::count_results::Variant::Entries( - entries, - )), - }, - )), - .. - }) => { - assert_eq!(entries.entries.len(), 1); - assert_eq!(entries.entries[0].key, b"green".to_vec()); - } - other => panic!("expected entries result, got {:?}", other), - } - - // Distinct descending: [(red, 2), (green, 3)] in entries. - let result = platform - .query_documents_count_v0(make_request(true, None, Some(false)), &state, version) - .expect("query should succeed"); - assert!(result.errors.is_empty()); - match result.data { - Some(GetDocumentsCountResponseV0 { - result: - Some(get_documents_count_response_v0::Result::Counts( - get_documents_count_response_v0::CountResults { - variant: - Some(get_documents_count_response_v0::count_results::Variant::Entries( - entries, - )), - }, - )), - .. - }) => { - assert_eq!(entries.entries.len(), 2); - assert_eq!(entries.entries[0].key, b"red".to_vec()); - assert_eq!(entries.entries[1].key, b"green".to_vec()); - } - other => panic!("expected entries result, got {:?}", other), - } - } - - /// End-to-end pin for the `RangeDistinctProof` dispatch path — - /// `return_distinct_counts_in_range = true` + `prove = true` + - /// a range clause. Backed by a regular grovedb range proof - /// against the property-name `ProvableCountTree` whose - /// `KVValueHashFeatureType[WithChildHash]` ops carry per- - /// distinct-value counts bound to the merk root via - /// `node_hash_with_count`. Asserts the wire-shape contract: - /// a `Proof` response variant with non-empty grovedb proof - /// bytes (not the empty-envelope degenerate shape that a - /// no-match query would emit). - #[test] - fn test_documents_count_range_with_prove_and_distinct_returns_proof() { - use dpp::data_contract::DataContractFactory; - use dpp::platform_value::platform_value; - - const PROTOCOL_VERSION_V12: u32 = 12; - - let (platform, state, version) = setup_platform(None, Network::Testnet, None); - - let factory = - DataContractFactory::new(PROTOCOL_VERSION_V12).expect("expected to create factory"); - let document_schema = platform_value!({ - "type": "object", - "properties": { - "color": {"type": "string", "position": 0, "maxLength": 32}, - }, - "indices": [{ - "name": "byColor", - "properties": [{"color": "asc"}], - "countable": "countable", - "rangeCountable": true, - }], - "additionalProperties": false, - }); - let schemas = platform_value!({ "widget": document_schema }); - let contract = factory - .create_with_value_config( - dpp::tests::utils::generate_random_identifier_struct(), - 0, - schemas, - None, - None, - ) - .expect("create contract") - .data_contract_owned(); - - store_data_contract(&platform, &contract, version); - - // Insert a few widgets spread across distinct color values - // so the prove-distinct path actually carries per-key counts - // in its proof — without this the proof covers an empty - // range and the test only verifies dispatch acceptance. - // Same distribution as the no-prove test above: - // red×2, green×3, blue×1. `color > "blue"` excludes blue, - // so the proof should carry per-color entries for red(2) - // and green(3). - let document_type = contract - .document_type_for_name("widget") - .expect("widget exists"); - let platform_version = PlatformVersion::latest(); - for (i, color) in ["red", "red", "green", "green", "green", "blue"] - .iter() - .enumerate() - { - let mut doc = document_type - .random_document(Some((i + 1) as u64), platform_version) - .expect("random doc"); - let mut props = std::collections::BTreeMap::new(); - props.insert("color".to_string(), Value::Text(color.to_string())); - doc.set_properties(props); - store_document(&platform, &contract, document_type, &doc, platform_version); - } - - let where_clauses = vec![Value::Array(vec![ - Value::Text("color".to_string()), - Value::Text(">".to_string()), - Value::Text("blue".to_string()), - ])]; - let request = GetDocumentsCountRequestV0 { - data_contract_id: contract.id().to_vec(), - document_type: "widget".to_string(), - r#where: serialize_where_clauses_to_cbor(where_clauses), - return_distinct_counts_in_range: true, - order_by: Vec::new(), - limit: None, - prove: true, - }; - - let result = platform - .query_documents_count_v0(request, &state, version) - .expect("query should succeed"); - assert!( - result.errors.is_empty(), - "expected no validation errors, got {:?}", - result.errors - ); - match result.data { - Some(GetDocumentsCountResponseV0 { - result: Some(get_documents_count_response_v0::Result::Proof(proof)), - metadata: Some(_), - }) => { - // The proof should not be empty since we inserted - // matching documents — a non-trivial proof shape - // pins that the prover actually emitted per-key - // count entries, not just a degenerate envelope. - assert!( - !proof.grovedb_proof.is_empty(), - "expected non-empty grovedb proof bytes for non-empty range result" - ); - } - other => panic!("expected Proof response, got {:?}", other), - } - } -} diff --git a/packages/rs-drive-abci/src/query/document_query/mod.rs b/packages/rs-drive-abci/src/query/document_query/mod.rs index 417e1b9112d..cd41f4539b7 100644 --- a/packages/rs-drive-abci/src/query/document_query/mod.rs +++ b/packages/rs-drive-abci/src/query/document_query/mod.rs @@ -9,9 +9,17 @@ use dapi_grpc::platform::v0::{GetDocumentsRequest, GetDocumentsResponse}; use dpp::version::PlatformVersion; mod v0; +mod v1; impl Platform { - /// Querying of documents + /// Querying of documents. + /// + /// Dispatches on the request's `version` oneof: + /// - `V0`: legacy `getDocuments` shape (matched documents only). + /// - `V1`: SQL-shaped unified surface (`select` × `group_by` × `having`) + /// that covers both `getDocuments` and `getDocumentsCount`. See + /// `query_documents_v1` for the supported / not-yet-implemented + /// shape table. pub fn query_documents( &self, GetDocumentsRequest { version }: GetDocumentsRequest, @@ -28,11 +36,12 @@ impl Platform { let feature_version = match &version { RequestVersion::V0(_) => 0, + RequestVersion::V1(_) => 1, }; if !feature_version_bounds.check_version(feature_version) { return Ok(QueryValidationResult::new_with_error( QueryError::UnsupportedQueryVersion( - "data_contracts".to_string(), + "document_query".to_string(), feature_version_bounds.min_version, feature_version_bounds.max_version, platform_version.protocol_version, @@ -49,6 +58,14 @@ impl Platform { version: Some(ResponseVersion::V0(response_v0)), })) } + RequestVersion::V1(request_v1) => { + let result = + self.query_documents_v1(request_v1, platform_state, platform_version)?; + + Ok(result.map(|response_v1| GetDocumentsResponse { + version: Some(ResponseVersion::V1(response_v1)), + })) + } } } } diff --git a/packages/rs-drive-abci/src/query/document_query/v1/mod.rs b/packages/rs-drive-abci/src/query/document_query/v1/mod.rs new file mode 100644 index 00000000000..aa5a31a1acb --- /dev/null +++ b/packages/rs-drive-abci/src/query/document_query/v1/mod.rs @@ -0,0 +1,619 @@ +//! v1 handler for `getDocuments` — SQL-shaped unified surface +//! covering both matched-document queries and count queries under a +//! single request type with `select`, `group_by`, and `having` +//! clauses. +//! +//! ## What this handler is +//! +//! **Wire-format unification.** Phase 1 ships no new server-side +//! execution capability: every supported request shape reaches an +//! existing drive executor (`DriveDocumentQuery` for `DOCUMENTS`, +//! `Drive::execute_document_count_request` for `COUNT`) and produces +//! the same proof bytes / response data the now-removed +//! `getDocumentsCount` v0 endpoint did. The v1 surface just makes +//! the SQL semantics explicit on the wire so callers don't have to +//! reverse-engineer "this where clause shape happens to produce +//! per-value entries." +//! +//! ## What it rejects +//! +//! Every request shape outside the existing drive-executor surface +//! returns [`QuerySyntaxError::Unsupported`] with `"… is not yet +//! implemented"` text. The error variant carries a `String` so the +//! exact rejected shape reaches the caller, and the message wording +//! signals **future capability**, not malformed request — clients +//! can keep these requests around in code and they'll start working +//! once the capability lands without a wire-format change. See the +//! message-level docstring on `GetDocumentsRequestV1` in +//! `platform.proto` for the full Phase 1 supported/rejected shape +//! table. + +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::response_metadata::CheckpointUsed; +use crate::query::QueryValidationResult; +use dapi_grpc::platform::v0::get_documents_request::get_documents_request_v0::Start as RequestV0Start; +use dapi_grpc::platform::v0::get_documents_request::get_documents_request_v1::{ + Select, Start as RequestV1Start, +}; +use dapi_grpc::platform::v0::get_documents_request::{ + GetDocumentsRequestV0, GetDocumentsRequestV1, +}; +use dapi_grpc::platform::v0::get_documents_response::get_documents_response_v1::{ + count_results, result_data, CountEntries, CountEntry, CountResults, Documents, ResultData, +}; +use dapi_grpc::platform::v0::get_documents_response::{ + get_documents_response_v0, get_documents_response_v1, GetDocumentsResponseV1, +}; +use dpp::check_validation_result_with_data; +use dpp::data_contract::accessors::v0::DataContractV0Getters; +use dpp::identifier::Identifier; +use dpp::platform_value::Value; +use dpp::validation::ValidationResult; +use dpp::version::PlatformVersion; +use drive::error::query::QuerySyntaxError; +use drive::query::{ + CountMode, DocumentCountRequest, DocumentCountResponse, SplitCountEntry, WhereClause, + WhereOperator, +}; +use drive::util::grove_operations::GroveDBToUse; + +/// Build a `QuerySyntaxError::Unsupported` carrying a stable +/// " is not yet implemented" message. The wording is +/// deliberate — Phase 1 of v1 publishes a SQL-shaped surface that +/// the server only partially implements; the rejected shapes signal +/// future capability, not malformed requests, and callers can keep +/// the request structure unchanged when the capability lands. +fn not_yet_implemented(feature: &str) -> QueryError { + QueryError::Query(QuerySyntaxError::Unsupported(format!( + "{} is not yet implemented", + feature + ))) +} + +/// Parse the raw CBOR-encoded `where` bytes into structured +/// [`WhereClause`]s. v1 needs the structured form to enforce +/// `group_by` ↔ where-field cross-checks before delegating. +fn decode_where_clauses(where_bytes: &[u8]) -> Result, QueryError> { + if where_bytes.is_empty() { + return Ok(Vec::new()); + } + let value: Value = ciborium::de::from_reader(where_bytes).map_err(|_| { + QueryError::Query(QuerySyntaxError::DeserializationError( + "unable to decode 'where' query from cbor".to_string(), + )) + })?; + let array = match value { + Value::Array(a) => a, + Value::Null => return Ok(Vec::new()), + _ => { + return Err(QueryError::Query( + QuerySyntaxError::InvalidFormatWhereClause( + "where clause must be an array".to_string(), + ), + )); + } + }; + let mut clauses = Vec::with_capacity(array.len()); + for entry in array { + let components = match entry { + Value::Array(c) => c, + _ => { + return Err(QueryError::Query( + QuerySyntaxError::InvalidFormatWhereClause( + "where clause must be an array".to_string(), + ), + )); + } + }; + let clause = WhereClause::from_components(&components).map_err(|e| { + QueryError::Query(QuerySyntaxError::InvalidFormatWhereClause(format!( + "invalid where clause components: {e}" + ))) + })?; + clauses.push(clause); + } + Ok(clauses) +} + +/// Re-decode the CBOR-encoded `order_by` bytes into a `Value` for +/// drive's count dispatcher (which accepts the raw `Value` form to +/// avoid re-imposing a parse). `Value::Null` (empty `order_by` on +/// the wire) → no clauses. +fn decode_order_by_value(order_by_bytes: &[u8]) -> Result { + if order_by_bytes.is_empty() { + return Ok(Value::Null); + } + ciborium::de::from_reader(order_by_bytes).map_err(|_| { + QueryError::Query(QuerySyntaxError::DeserializationError( + "unable to decode 'order_by' query from cbor".to_string(), + )) + }) +} + +/// Validate the `select` × `group_by` × `having` combination +/// against the Phase 1 supported-shape table. Returns the routing +/// decision so the handler knows whether to dispatch to the +/// documents-fetch path or the count path, and which response +/// shape to produce. +fn validate_and_route( + request_v1: &GetDocumentsRequestV1, + where_clauses: &[WhereClause], +) -> Result { + // An unknown integer here is malformed wire input (a + // discriminant the `Select` proto enum doesn't define), NOT a + // future capability — there's no future protocol value that + // would map a garbage integer to a valid behavior. Use + // `InvalidArgument` so clients can distinguish "garbage in this + // field" from `not_yet_implemented`'s "valid request shape, just + // not wired yet" contract (see [`not_yet_implemented`] above). + let select = Select::try_from(request_v1.select).map_err(|_| { + QueryError::InvalidArgument(format!( + "select value {} is not a valid `Select` enum discriminant \ + (expected {} = DOCUMENTS or {} = COUNT)", + request_v1.select, + Select::Documents as i32, + Select::Count as i32, + )) + })?; + + // Centralized `limit: Some(0)` rejection. + // + // `limit` is `optional uint32` on the wire, so `Some(0)` is a + // distinct value any raw-gRPC/WASM/FFI caller can encode. Three + // legacy behaviors collide on this value across the v1 dispatch + // surface: + // - `SELECT DOCUMENTS` would `unwrap_or(0)` and forward to v0, + // where `limit=0` is the v0-uint32 sentinel for "use server + // default" — accept-as-default. + // - `SELECT COUNT` with `mode ∈ {Aggregate, GroupByIn}` would + // reject via the `is_some()` check below — reject-as-invalid. + // - `SELECT COUNT` with `mode ∈ {GroupByRange, GroupByCompound}` + // would pass `Some(0)` through to drive, which honors it as a + // zero-cap walk — accept-as-zero. + // + // Three semantics for the same wire bytes is bad contract. The + // v1 wire's whole point of switching to `optional uint32` was + // to make "unset" explicit (`None`), so `Some(0)` only makes + // sense as an *explicit* zero — and a zero-cap query returns + // no useful information regardless of mode. Reject it uniformly + // at the validation boundary so callers see a single, + // mode-independent contract: `None` for "use server default", + // `Some(N > 0)` for an explicit cap, `Some(0)` is invalid. + if request_v1.limit == Some(0) { + return Err(QueryError::Query(QuerySyntaxError::InvalidLimit( + "limit = 0 is not a valid wire value on the v1 \ + `optional uint32` field; omit `limit` (None) to use the \ + server's default, or pass a positive integer for an \ + explicit cap (a zero-cap query is structurally \ + meaningless regardless of SELECT mode)" + .to_string(), + ))); + } + + if !request_v1.having.is_empty() { + return Err(not_yet_implemented("HAVING clause")); + } + + match select { + Select::Documents => { + if !request_v1.group_by.is_empty() { + return Err(not_yet_implemented( + "GROUP BY with SELECT DOCUMENTS (use SELECT COUNT with GROUP BY \ + for per-group counts, or SELECT DOCUMENTS without GROUP BY for \ + matched documents)", + )); + } + Ok(RoutingDecision::Documents) + } + Select::Count => { + let in_field: Option<&str> = where_clauses + .iter() + .find(|wc| wc.operator == WhereOperator::In) + .map(|wc| wc.field.as_str()); + let range_field: Option<&str> = where_clauses + .iter() + .find(|wc| { + matches!( + wc.operator, + WhereOperator::GreaterThan + | WhereOperator::GreaterThanOrEquals + | WhereOperator::LessThan + | WhereOperator::LessThanOrEquals + | WhereOperator::Between + | WhereOperator::BetweenExcludeBounds + | WhereOperator::BetweenExcludeLeft + | WhereOperator::BetweenExcludeRight + | WhereOperator::StartsWith + ) + }) + .map(|wc| wc.field.as_str()); + + // Compute the SQL-shape mode from `(group_by, where)` + // first; check `limit` validity against the mode after + // so the rejection lives in one place keyed off + // `CountMode::accepts_limit()`. + let mode = match request_v1.group_by.as_slice() { + [] => CountMode::Aggregate, + [field] => { + if Some(field.as_str()) == in_field { + // Single-field GROUP BY on the `In` field is + // only well-defined when no range clause is + // also constraining the result; otherwise + // Drive's compound walk emits unmerged + // `(in_key, key)` entries that don't match + // the caller's stated grouping. Force them + // to spell out the compound shape with a + // two-element `group_by`. + if range_field.is_some() { + return Err(not_yet_implemented( + "single-field GROUP BY when both `In` and range \ + clauses are present (use a two-element GROUP BY \ + `[in_field, range_field]` for the compound shape, \ + or drop the other constraint)", + )); + } + CountMode::GroupByIn + } else if Some(field.as_str()) == range_field { + // Same compound-shape concern as the In + // branch above — `group_by=[range_field]` + // with an active `In` clause produces + // compound rows from Drive that don't match + // the caller's grouping. + if in_field.is_some() { + return Err(not_yet_implemented( + "single-field GROUP BY when both `In` and range \ + clauses are present (use a two-element GROUP BY \ + `[in_field, range_field]` for the compound shape, \ + or drop the other constraint)", + )); + } + CountMode::GroupByRange + } else { + return Err(not_yet_implemented(&format!( + "GROUP BY on field '{}' which is not constrained by an \ + `In` or range where clause", + field + ))); + } + } + [first, second] => { + if Some(first.as_str()) == in_field && Some(second.as_str()) == range_field { + CountMode::GroupByCompound + } else { + return Err(not_yet_implemented( + "two-field GROUP BY outside the `(In, range)` compound \ + shape (the existing compound count path orders entries \ + as `(in_key, key)`; other orderings would need a new \ + merk walk)", + )); + } + } + _ => return Err(not_yet_implemented("GROUP BY with more than two fields")), + }; + + // Reject `limit` on modes that can't honor it. Aggregate + // returns one row; GroupByIn is bounded by the In array + // (capped at 100 by `WhereClause::in_values()`) and the + // PointLookupProof path can't represent a partial-In + // selection in its `SizedQuery`. Either way silent + // truncation or fan-out summing would mislead callers + // who set a `limit`. + if request_v1.limit.is_some() && !mode.accepts_limit() { + let reason = match mode { + CountMode::Aggregate => { + "`limit` is not valid for SELECT COUNT with empty GROUP BY \ + (aggregate count is a single row; omit `limit` to fix)" + } + CountMode::GroupByIn => { + "`limit` is not valid for SELECT COUNT with GROUP BY on an \ + `In` field (result is bounded by the In array — capped at \ + 100 entries; narrow the In array directly to reduce the \ + result set)" + } + CountMode::GroupByRange | CountMode::GroupByCompound => unreachable!( + "`accepts_limit()` returns true for these variants; \ + outer guard already filtered them out" + ), + }; + return Err(QueryError::Query(QuerySyntaxError::InvalidLimit( + reason.to_string(), + ))); + } + + Ok(RoutingDecision::Count(mode)) + } + } +} + +/// Outcome of `validate_and_route` — names the path the v1 request +/// will dispatch to. +/// +/// `Count(CountMode)` carries the SQL-shape contract (`Aggregate` / +/// `GroupByIn` / `GroupByRange` / `GroupByCompound`) directly; the +/// dispatcher passes it through to [`DocumentCountRequest::mode`] +/// without further translation. +enum RoutingDecision { + Documents, + Count(CountMode), +} + +/// Test-only: expose the routing decision for unit tests without +/// needing a full `Platform` setup. +#[cfg(test)] +pub(super) fn validate_and_route_for_tests( + request_v1: &GetDocumentsRequestV1, + where_clauses: &[WhereClause], +) -> Result<&'static str, QueryError> { + validate_and_route(request_v1, where_clauses).map(|d| match d { + RoutingDecision::Documents => "documents", + RoutingDecision::Count(CountMode::Aggregate) => "count_aggregate", + RoutingDecision::Count(CountMode::GroupByIn) => "count_entries_via_in_field", + RoutingDecision::Count(CountMode::GroupByRange) => "count_entries_via_range_field", + RoutingDecision::Count(CountMode::GroupByCompound) => "count_entries_via_compound", + }) +} + +impl Platform { + pub(super) fn query_documents_v1( + &self, + request_v1: GetDocumentsRequestV1, + platform_state: &PlatformState, + platform_version: &PlatformVersion, + ) -> Result, Error> { + let where_clauses = match decode_where_clauses(&request_v1.r#where) { + Ok(c) => c, + Err(e) => return Ok(QueryValidationResult::new_with_error(e)), + }; + + let routing = match validate_and_route(&request_v1, &where_clauses) { + Ok(r) => r, + Err(e) => return Ok(QueryValidationResult::new_with_error(e)), + }; + + match routing { + RoutingDecision::Documents => { + self.dispatch_documents_v1(request_v1, platform_state, platform_version) + } + RoutingDecision::Count(mode) => { + self.dispatch_count_v1(request_v1, mode, platform_state, platform_version) + } + } + } + + /// Forward a `select = DOCUMENTS` request through the v0 + /// handler. v1 doesn't add any documents-side capability — the + /// SQL-shaped fields (`select`, `group_by`, `having`) are all + /// validated as documents-compatible above (empty `group_by`, + /// empty `having`, etc.) before reaching here. + fn dispatch_documents_v1( + &self, + request_v1: GetDocumentsRequestV1, + platform_state: &PlatformState, + platform_version: &PlatformVersion, + ) -> Result, Error> { + let start = request_v1.start.map(|s| match s { + RequestV1Start::StartAfter(b) => RequestV0Start::StartAfter(b), + RequestV1Start::StartAt(b) => RequestV0Start::StartAt(b), + }); + // `limit` is `optional uint32` on v1 vs unwrapped `uint32` + // (default 0) on v0. `None` on v1 → 0 on v0 (v0 reads `0` + // as "use the server's `default_query_limit`"). `Some(0)` + // can't reach here — `validate_and_route` rejects it for + // every SELECT mode so the v1 contract is uniform; only + // `None` or `Some(N > 0)` survive. + let request_v0 = GetDocumentsRequestV0 { + data_contract_id: request_v1.data_contract_id, + document_type: request_v1.document_type, + r#where: request_v1.r#where, + order_by: request_v1.order_by, + limit: request_v1.limit.unwrap_or(0), + prove: request_v1.prove, + start, + }; + let result = self.query_documents_v0(request_v0, platform_state, platform_version)?; + Ok(result.map(translate_documents_v0_to_v1)) + } + + /// Forward a `select = COUNT` request to drive's count + /// dispatcher. `mode` is the SQL-shape contract derived from + /// `(select, group_by, where)` by `validate_and_route`; drive + /// uses it to pick the executor strategy and decide whether to + /// collapse the response to a single aggregate or return per- + /// group entries. The wire response is `GetDocumentsResponseV1` + /// with the inner `ResultData.counts` variant for non-proof + /// results. + fn dispatch_count_v1( + &self, + request_v1: GetDocumentsRequestV1, + mode: CountMode, + platform_state: &PlatformState, + platform_version: &PlatformVersion, + ) -> Result, Error> { + if request_v1.start.is_some() { + return Ok(QueryValidationResult::new_with_error(not_yet_implemented( + "start_after / start_at with SELECT COUNT (paginate by narrowing the \ + range clause itself)", + ))); + } + + let contract_id: Identifier = check_validation_result_with_data!(request_v1 + .data_contract_id + .try_into() + .map_err(|_| QueryError::InvalidArgument( + "id must be a valid identifier (32 bytes long)".to_string() + ))); + + let (_, contract_fetch_info) = self.drive.get_contract_with_fetch_info_and_fee( + contract_id.to_buffer(), + None, + true, + None, + platform_version, + )?; + let contract_fetch_info = check_validation_result_with_data!(contract_fetch_info.ok_or( + QueryError::Query(QuerySyntaxError::DataContractNotFound( + "contract not found when querying from value with contract info", + )) + )); + let contract_ref = &contract_fetch_info.contract; + let document_type = check_validation_result_with_data!(contract_ref + .document_type_for_name(request_v1.document_type.as_str()) + .map_err(|_| QueryError::InvalidArgument(format!( + "document type {} not found for contract {}", + request_v1.document_type, contract_id + )))); + + let where_value = if request_v1.r#where.is_empty() { + Value::Null + } else { + check_validation_result_with_data!(ciborium::de::from_reader( + request_v1.r#where.as_slice() + ) + .map_err( + |_| QueryError::Query(QuerySyntaxError::DeserializationError( + "unable to decode 'where' query from cbor".to_string() + )) + )) + }; + let order_by_value = match decode_order_by_value(&request_v1.order_by) { + Ok(v) => v, + Err(e) => return Ok(QueryValidationResult::new_with_error(e)), + }; + + let drive_request = DocumentCountRequest { + contract: contract_ref, + document_type, + raw_where_value: where_value, + raw_order_by_value: order_by_value, + mode, + limit: request_v1.limit, + prove: request_v1.prove, + drive_config: &self.config.drive, + }; + let drive_response = + match self + .drive + .execute_document_count_request(drive_request, None, platform_version) + { + Ok(r) => r, + Err(drive::error::Error::Query(qe)) => { + return Ok(QueryValidationResult::new_with_error(QueryError::Query(qe))); + } + Err(e) => return Err(e.into()), + }; + + let response = match drive_response { + DocumentCountResponse::Aggregate(count) => GetDocumentsResponseV1 { + result: Some(get_documents_response_v1::Result::Data(ResultData { + variant: Some(result_data::Variant::Counts(CountResults { + variant: Some(count_results::Variant::AggregateCount(count)), + })), + })), + metadata: Some(self.response_metadata_v0(platform_state, CheckpointUsed::Current)), + }, + DocumentCountResponse::Entries(entries) => { + if mode.is_aggregate() { + // `select=COUNT, group_by=[]` against a request + // that drove a PerInValue execution (In + no + // range + no prove). Sum entries into a single + // aggregate before emission. `saturating_add` + // on the off-chance an operator-misconfigured + // count tree exceeds u64; realistic ceiling is + // `|In| × max_per-branch-count`, well under u64. + let total: u64 = entries + .iter() + // `count.unwrap_or(0)` here is safe: this + // arm is server-side, summing entries the + // executor emitted. Executor never emits + // `None` (that's an SDK-side + // synthesis-for-missing concept). The + // `unwrap_or(0)` is a belt-and-suspenders + // guard against any future executor that + // forgets the contract. + .map(|e| e.count.unwrap_or(0)) + .fold(0u64, |a, b| a.saturating_add(b)); + GetDocumentsResponseV1 { + result: Some(get_documents_response_v1::Result::Data(ResultData { + variant: Some(result_data::Variant::Counts(CountResults { + variant: Some(count_results::Variant::AggregateCount(total)), + })), + })), + metadata: Some( + self.response_metadata_v0(platform_state, CheckpointUsed::Current), + ), + } + } else { + GetDocumentsResponseV1 { + result: Some(get_documents_response_v1::Result::Data(ResultData { + variant: Some(result_data::Variant::Counts(CountResults { + variant: Some(count_results::Variant::Entries(CountEntries { + entries: entries.into_iter().map(into_v1_entry).collect(), + })), + })), + })), + metadata: Some( + self.response_metadata_v0(platform_state, CheckpointUsed::Current), + ), + } + } + } + DocumentCountResponse::Proof(proof_bytes) => { + let (grovedb_used, proof) = + self.response_proof_v0(platform_state, proof_bytes, GroveDBToUse::Current)?; + GetDocumentsResponseV1 { + result: Some(get_documents_response_v1::Result::Proof(proof)), + metadata: Some(self.response_metadata_v0(platform_state, grovedb_used)), + } + } + }; + + Ok(QueryValidationResult::new_with_data(response)) + } +} + +fn into_v1_entry(e: SplitCountEntry) -> CountEntry { + CountEntry { + in_key: e.in_key, + key: e.key, + // The wire `count` is `uint64`, so it can only carry + // `Some(_)`. Server-side never emits `None` entries to + // begin with — `None` is the SDK-side synthesis signal for + // "caller's In array contained a value the proof was + // silent on," and that decision lives client-side because + // the wire never has the caller's full In array context. + // `unwrap_or(0)` is defense-in-depth: a future executor + // bug emitting `None` shouldn't crash the response path, + // it should round to zero on the wire (matching the + // proto's `uint64` default). + count: e.count.unwrap_or(0), + } +} + +/// Translate a v0 `GetDocumentsResponseV0` into v1's response +/// envelope (Documents-or-Proof wrapping the v0 oneof result into +/// v1's `ResultData`-or-`Proof` shape). +fn translate_documents_v0_to_v1( + response_v0: dapi_grpc::platform::v0::get_documents_response::GetDocumentsResponseV0, +) -> GetDocumentsResponseV1 { + let metadata = response_v0.metadata; + let result = match response_v0.result { + Some(get_documents_response_v0::Result::Documents(docs)) => { + Some(get_documents_response_v1::Result::Data(ResultData { + variant: Some(result_data::Variant::Documents(Documents { + documents: docs.documents, + })), + })) + } + Some(get_documents_response_v0::Result::Proof(proof)) => { + Some(get_documents_response_v1::Result::Proof(proof)) + } + None => None, + }; + GetDocumentsResponseV1 { result, metadata } +} + +#[cfg(test)] +mod tests; diff --git a/packages/rs-drive-abci/src/query/document_query/v1/tests.rs b/packages/rs-drive-abci/src/query/document_query/v1/tests.rs new file mode 100644 index 00000000000..a636d4ccc57 --- /dev/null +++ b/packages/rs-drive-abci/src/query/document_query/v1/tests.rs @@ -0,0 +1,1532 @@ +//! Tests for the v1 `getDocuments` handler — pure wire-format +//! unification of v0 documents + the (now-removed) v0-count endpoint. +//! +//! Two layers of coverage: +//! - Top-level (this module): validate-and-route routing tests + a +//! handful of end-to-end smoke tests for the v1 wire envelope. +//! - [`ported_v0_count_tests`] (nested below): the full v0-count +//! integration suite, ported verbatim to the v1 request shape so +//! the count-execution surface keeps its load-bearing coverage +//! under the new envelope. + +use super::*; +use crate::query::tests::{setup_platform, store_data_contract, store_document}; +use dapi_grpc::platform::v0::get_documents_request::get_documents_request_v1::{ + Select as V1Select, Start as V1Start, +}; +use dpp::dashcore::Network; +use dpp::data_contract::accessors::v0::DataContractV0Getters; +use dpp::data_contract::document_type::random_document::CreateRandomDocument; +use dpp::platform_value::platform_value; + +fn empty_v1_request() -> GetDocumentsRequestV1 { + GetDocumentsRequestV1 { + data_contract_id: vec![0u8; 32], + document_type: "widget".to_string(), + r#where: Vec::new(), + order_by: Vec::new(), + limit: None, + start: None, + prove: false, + select: V1Select::Documents as i32, + group_by: Vec::new(), + having: Vec::new(), + } +} + +fn assert_not_yet_implemented(result: Result<&'static str, QueryError>, expected_feature: &str) { + match result { + Err(QueryError::Query(QuerySyntaxError::Unsupported(msg))) => { + assert!( + msg.contains(expected_feature) && msg.contains("not yet implemented"), + "expected message containing '{}' and 'not yet implemented', got: {}", + expected_feature, + msg + ); + } + other => panic!( + "expected QueryError::Query(Unsupported) for '{}', got {:?}", + expected_feature, other + ), + } +} + +#[test] +fn reject_having_non_empty() { + let request = GetDocumentsRequestV1 { + having: vec![0x01, 0x02], + ..empty_v1_request() + }; + assert_not_yet_implemented(validate_and_route_for_tests(&request, &[]), "HAVING clause"); +} + +/// Unknown `Select` enum discriminants (e.g. `42`) are malformed +/// wire input, not future capability. The handler must classify +/// them as [`QueryError::InvalidArgument`] — `not_yet_implemented` +/// carries the contract "valid request shape, caller can keep it +/// unchanged when capability lands" which is wrong for garbage +/// enum discriminants (no future protocol value would make `42` +/// meaningful for `Select`). +/// +/// Pins the discriminator so a future refactor that re-collapses +/// the two error classes back together (e.g. someone replaces the +/// `InvalidArgument` with `not_yet_implemented` for "consistency" +/// with the surrounding HAVING/GROUP BY rejections) fails loudly +/// rather than silently masking malformed inputs. +#[test] +fn reject_unknown_select_enum_value_as_invalid_argument() { + let request = GetDocumentsRequestV1 { + // Neither 0 (DOCUMENTS) nor 1 (COUNT); a discriminant + // outside the `Select` enum's defined set. + select: 42, + ..empty_v1_request() + }; + match validate_and_route_for_tests(&request, &[]) { + Err(QueryError::InvalidArgument(msg)) => { + assert!( + msg.contains("42") && msg.contains("Select"), + "expected invalid-discriminant message naming the value and the \ + enum, got: {}", + msg + ); + } + Err(QueryError::Query(QuerySyntaxError::Unsupported(msg))) => panic!( + "expected InvalidArgument for unknown Select discriminant; got \ + not_yet_implemented(\"{}\"). The two error classes carry different \ + contracts (malformed input vs. future capability) and must not be \ + collapsed.", + msg + ), + other => panic!("expected InvalidArgument, got {:?}", other), + } +} + +/// `limit: Some(0)` is invalid on the v1 `optional uint32 limit` +/// field across **every** SELECT mode. The legacy ambiguity (where +/// the same wire bytes meant "use server default" in DOCUMENTS +/// mode but `InvalidLimit` in some COUNT modes) is fixed by a +/// uniform rejection at the validation boundary. +/// +/// Pins the contract end-to-end across: +/// - `SELECT DOCUMENTS` (previously `unwrap_or(0)` into v0 sentinel). +/// - `SELECT COUNT, group_by=[]` (previously rejected via +/// `is_some()` but with a mode-specific message). +/// - `SELECT COUNT, group_by=[in_field]` (same). +/// - `SELECT COUNT, group_by=[range_field]` (previously +/// accepted-as-zero). +/// - `SELECT COUNT, group_by=[in_field, range_field]` (same). +/// +/// All five modes must return `QuerySyntaxError::InvalidLimit` +/// with the centralized message — not five different rejection +/// reasons. +#[test] +fn reject_limit_some_zero_uniformly_across_select_modes() { + let in_clauses = || { + vec![WhereClause { + field: "brand".to_string(), + operator: WhereOperator::In, + value: platform_value!(["acme", "contoso"]), + }] + }; + let range_clauses = || { + vec![WhereClause { + field: "color".to_string(), + operator: WhereOperator::GreaterThan, + value: platform_value!("blue"), + }] + }; + let in_and_range_clauses = || { + vec![ + WhereClause { + field: "brand".to_string(), + operator: WhereOperator::In, + value: platform_value!(["acme", "contoso"]), + }, + WhereClause { + field: "color".to_string(), + operator: WhereOperator::GreaterThan, + value: platform_value!("blue"), + }, + ] + }; + + // (test_label, request_builder, where_clauses) + let cases: Vec<(&str, GetDocumentsRequestV1, Vec)> = vec![ + ( + "SELECT DOCUMENTS, group_by=[]", + GetDocumentsRequestV1 { + select: V1Select::Documents as i32, + limit: Some(0), + ..empty_v1_request() + }, + Vec::new(), + ), + ( + "SELECT COUNT, group_by=[] (Aggregate) with In clause", + GetDocumentsRequestV1 { + select: V1Select::Count as i32, + limit: Some(0), + ..empty_v1_request() + }, + in_clauses(), + ), + ( + "SELECT COUNT, group_by=[in_field] (GroupByIn)", + GetDocumentsRequestV1 { + select: V1Select::Count as i32, + group_by: vec!["brand".to_string()], + limit: Some(0), + ..empty_v1_request() + }, + in_clauses(), + ), + ( + "SELECT COUNT, group_by=[range_field] (GroupByRange)", + GetDocumentsRequestV1 { + select: V1Select::Count as i32, + group_by: vec!["color".to_string()], + limit: Some(0), + ..empty_v1_request() + }, + range_clauses(), + ), + ( + "SELECT COUNT, group_by=[in_field, range_field] (GroupByCompound)", + GetDocumentsRequestV1 { + select: V1Select::Count as i32, + group_by: vec!["brand".to_string(), "color".to_string()], + limit: Some(0), + ..empty_v1_request() + }, + in_and_range_clauses(), + ), + ]; + + for (label, request, where_clauses) in cases { + match validate_and_route_for_tests(&request, &where_clauses) { + Err(QueryError::Query(QuerySyntaxError::InvalidLimit(msg))) => { + assert!( + msg.contains("limit = 0") && msg.contains("v1"), + "[{}] expected centralized `limit = 0` rejection message, \ + got: {}", + label, + msg + ); + } + other => panic!( + "[{}] expected QuerySyntaxError::InvalidLimit for limit=Some(0); \ + got {:?}. If this case now accepts Some(0) the v1 contract is \ + no longer uniform — every wire-visible `Some(0)` must be \ + rejected at the validation boundary.", + label, other + ), + } + } +} + +#[test] +fn reject_group_by_with_documents() { + let request = GetDocumentsRequestV1 { + select: V1Select::Documents as i32, + group_by: vec!["color".to_string()], + ..empty_v1_request() + }; + assert_not_yet_implemented( + validate_and_route_for_tests(&request, &[]), + "GROUP BY with SELECT DOCUMENTS", + ); +} + +#[test] +fn reject_group_by_field_not_in_where_clauses() { + let request = GetDocumentsRequestV1 { + select: V1Select::Count as i32, + group_by: vec!["color".to_string()], + ..empty_v1_request() + }; + assert_not_yet_implemented( + validate_and_route_for_tests(&request, &[]), + "GROUP BY on field 'color' which is not constrained", + ); +} + +#[test] +fn reject_group_by_more_than_two_fields() { + let request = GetDocumentsRequestV1 { + select: V1Select::Count as i32, + group_by: vec!["a".to_string(), "b".to_string(), "c".to_string()], + ..empty_v1_request() + }; + assert_not_yet_implemented( + validate_and_route_for_tests(&request, &[]), + "GROUP BY with more than two fields", + ); +} + +#[test] +fn reject_two_field_group_by_outside_compound_shape() { + let request = GetDocumentsRequestV1 { + select: V1Select::Count as i32, + group_by: vec!["color".to_string(), "brand".to_string()], + ..empty_v1_request() + }; + let where_clauses = vec![ + WhereClause { + field: "brand".to_string(), + operator: WhereOperator::In, + value: platform_value!(["acme", "contoso"]), + }, + WhereClause { + field: "color".to_string(), + operator: WhereOperator::GreaterThan, + value: platform_value!("blue"), + }, + ]; + assert_not_yet_implemented( + validate_and_route_for_tests(&request, &where_clauses), + "two-field GROUP BY outside the `(In, range)` compound shape", + ); +} + +#[test] +fn accept_count_with_empty_group_by_routes_to_aggregate() { + let request = GetDocumentsRequestV1 { + select: V1Select::Count as i32, + ..empty_v1_request() + }; + assert_eq!( + validate_and_route_for_tests(&request, &[]).unwrap(), + "count_aggregate" + ); +} + +#[test] +fn reject_count_aggregate_with_limit() { + // Aggregate count is a single row; a `limit` is structurally + // meaningless and previously caused Drive's per-In fan-out + // to honor it and return a partial sum disguised as a total. + let request = GetDocumentsRequestV1 { + select: V1Select::Count as i32, + limit: Some(1), + ..empty_v1_request() + }; + let where_clauses = vec![WhereClause { + field: "age".to_string(), + operator: WhereOperator::In, + value: platform_value!([30u32, 40u32]), + }]; + match validate_and_route_for_tests(&request, &where_clauses) { + Err(QueryError::Query(QuerySyntaxError::InvalidLimit(msg))) => { + assert!( + msg.contains("aggregate count is a single row"), + "expected aggregate-count limit-rejection message, got: {msg}" + ); + } + other => panic!("expected InvalidLimit, got {other:?}"), + } +} + +#[test] +fn reject_count_group_by_in_with_limit() { + // GROUP BY on an `In` field returns at most `|In|` entries + // (capped at 100 by `WhereClause::in_values()`). A `limit` + // is either redundant (≤ 100) or would silently truncate + // the proof to fewer In branches than requested — the + // PointLookupProof path can't represent a partial-In + // selection in its `SizedQuery`, so the limit gets dropped + // before reaching the path-query builder. Reject upstream + // to make the contract explicit. + let request = GetDocumentsRequestV1 { + select: V1Select::Count as i32, + group_by: vec!["age".to_string()], + limit: Some(1), + ..empty_v1_request() + }; + let where_clauses = vec![WhereClause { + field: "age".to_string(), + operator: WhereOperator::In, + value: platform_value!([30u32, 40u32, 50u32]), + }]; + match validate_and_route_for_tests(&request, &where_clauses) { + Err(QueryError::Query(QuerySyntaxError::InvalidLimit(msg))) => { + assert!( + msg.contains("bounded by the In array"), + "expected GroupByIn limit-rejection message, got: {msg}" + ); + } + other => panic!("expected InvalidLimit, got {other:?}"), + } +} + +#[test] +fn reject_single_field_group_by_on_in_field_when_range_also_constrained() { + // `group_by=[in_field]` looks well-formed in isolation, but + // the simultaneous range clause forces Drive's compound walk + // to emit `(in_key, key)` rows that don't match the caller's + // single-field grouping. Caller must spell out the compound + // shape explicitly with `[in_field, range_field]`. + let request = GetDocumentsRequestV1 { + select: V1Select::Count as i32, + group_by: vec!["brand".to_string()], + ..empty_v1_request() + }; + let where_clauses = vec![ + WhereClause { + field: "brand".to_string(), + operator: WhereOperator::In, + value: platform_value!(["acme", "contoso"]), + }, + WhereClause { + field: "color".to_string(), + operator: WhereOperator::GreaterThan, + value: platform_value!("blue"), + }, + ]; + assert_not_yet_implemented( + validate_and_route_for_tests(&request, &where_clauses), + "single-field GROUP BY when both `In` and range clauses are present", + ); +} + +#[test] +fn reject_single_field_group_by_on_range_field_when_in_also_constrained() { + // Mirror of the above for the range-field branch: same + // compound-shape mismatch, different `group_by` entry. + let request = GetDocumentsRequestV1 { + select: V1Select::Count as i32, + group_by: vec!["color".to_string()], + ..empty_v1_request() + }; + let where_clauses = vec![ + WhereClause { + field: "brand".to_string(), + operator: WhereOperator::In, + value: platform_value!(["acme", "contoso"]), + }, + WhereClause { + field: "color".to_string(), + operator: WhereOperator::GreaterThan, + value: platform_value!("blue"), + }, + ]; + assert_not_yet_implemented( + validate_and_route_for_tests(&request, &where_clauses), + "single-field GROUP BY when both `In` and range clauses are present", + ); +} + +#[test] +fn accept_count_group_by_in_field_routes_to_in_entries() { + let request = GetDocumentsRequestV1 { + select: V1Select::Count as i32, + group_by: vec!["brand".to_string()], + ..empty_v1_request() + }; + let where_clauses = vec![WhereClause { + field: "brand".to_string(), + operator: WhereOperator::In, + value: platform_value!(["acme", "contoso"]), + }]; + assert_eq!( + validate_and_route_for_tests(&request, &where_clauses).unwrap(), + "count_entries_via_in_field" + ); +} + +#[test] +fn accept_count_group_by_range_field_routes_to_range_entries() { + let request = GetDocumentsRequestV1 { + select: V1Select::Count as i32, + group_by: vec!["color".to_string()], + ..empty_v1_request() + }; + let where_clauses = vec![WhereClause { + field: "color".to_string(), + operator: WhereOperator::GreaterThan, + value: platform_value!("blue"), + }]; + assert_eq!( + validate_and_route_for_tests(&request, &where_clauses).unwrap(), + "count_entries_via_range_field" + ); +} + +#[test] +fn accept_count_group_by_compound_routes_to_compound_entries() { + let request = GetDocumentsRequestV1 { + select: V1Select::Count as i32, + group_by: vec!["brand".to_string(), "color".to_string()], + ..empty_v1_request() + }; + let where_clauses = vec![ + WhereClause { + field: "brand".to_string(), + operator: WhereOperator::In, + value: platform_value!(["acme", "contoso"]), + }, + WhereClause { + field: "color".to_string(), + operator: WhereOperator::GreaterThan, + value: platform_value!("blue"), + }, + ]; + assert_eq!( + validate_and_route_for_tests(&request, &where_clauses).unwrap(), + "count_entries_via_compound" + ); +} + +#[test] +fn e2e_documents_select_matches_v0() { + use dpp::data_contract::DataContractFactory; + + const PROTOCOL_VERSION_V12: u32 = 12; + + let (platform, state, version) = setup_platform(None, Network::Testnet, None); + let platform_version = PlatformVersion::latest(); + + let factory = DataContractFactory::new(PROTOCOL_VERSION_V12).expect("factory"); + let document_schema = platform_value!({ + "type": "object", + "properties": { + "color": {"type": "string", "position": 0, "maxLength": 32}, + }, + "indices": [{ + "name": "byColor", + "properties": [{"color": "asc"}], + }], + "additionalProperties": false, + }); + let schemas = platform_value!({ "widget": document_schema }); + let contract = factory + .create_with_value_config( + dpp::tests::utils::generate_random_identifier_struct(), + 0, + schemas, + None, + None, + ) + .expect("create contract") + .data_contract_owned(); + store_data_contract(&platform, &contract, version); + + let document_type = contract.document_type_for_name("widget").expect("widget"); + for i in 1..=3u8 { + let doc = document_type + .random_document(Some(i as u64), platform_version) + .expect("random doc"); + store_document(&platform, &contract, document_type, &doc, platform_version); + } + + // v0 baseline. + let request_v0 = GetDocumentsRequestV0 { + data_contract_id: contract.id().to_vec(), + document_type: "widget".to_string(), + r#where: Vec::new(), + order_by: Vec::new(), + limit: 0, + prove: false, + start: None, + }; + let v0_result = platform + .query_documents_v0(request_v0, &state, version) + .expect("v0 query"); + let v0_docs = match v0_result.data { + Some(r) => match r.result { + Some(get_documents_response_v0::Result::Documents(d)) => d.documents, + other => panic!("v0: expected Documents, got {:?}", other), + }, + None => panic!("v0: empty data"), + }; + assert_eq!(v0_docs.len(), 3); + + // v1 equivalent. + let request_v1 = GetDocumentsRequestV1 { + data_contract_id: contract.id().to_vec(), + document_type: "widget".to_string(), + r#where: Vec::new(), + order_by: Vec::new(), + limit: None, + start: None, + prove: false, + select: V1Select::Documents as i32, + group_by: Vec::new(), + having: Vec::new(), + }; + let v1_result = platform + .query_documents_v1(request_v1, &state, version) + .expect("v1 query"); + let v1_docs = match v1_result.data { + Some(r) => match r.result { + Some(get_documents_response_v1::Result::Data(ResultData { + variant: Some(result_data::Variant::Documents(d)), + })) => d.documents, + other => panic!("v1: expected Documents, got {:?}", other), + }, + None => panic!("v1: empty data"), + }; + assert_eq!(v1_docs, v0_docs, "v0 and v1 returned the same documents"); +} + +#[test] +fn e2e_having_rejection_surfaces_in_response() { + let (platform, state, version) = setup_platform(None, Network::Testnet, None); + let request = GetDocumentsRequestV1 { + data_contract_id: vec![0u8; 32], + document_type: "anything".to_string(), + r#where: Vec::new(), + order_by: Vec::new(), + limit: None, + start: None, + prove: false, + select: V1Select::Count as i32, + group_by: Vec::new(), + having: vec![0xFF, 0xFE], + }; + let result = platform + .query_documents_v1(request, &state, version) + .expect("query call should not error at the transport layer"); + assert!( + !result.errors.is_empty(), + "expected validation error for HAVING request" + ); + match &result.errors[0] { + QueryError::Query(QuerySyntaxError::Unsupported(msg)) => { + assert!( + msg.contains("HAVING") && msg.contains("not yet implemented"), + "expected HAVING-specific message, got: {}", + msg + ); + } + other => panic!("expected Unsupported error, got {:?}", other), + } +} + +#[test] +fn reject_start_with_select_count() { + let (platform, state, version) = setup_platform(None, Network::Testnet, None); + let request = GetDocumentsRequestV1 { + data_contract_id: vec![0u8; 32], + document_type: "widget".to_string(), + r#where: Vec::new(), + order_by: Vec::new(), + limit: None, + start: Some(V1Start::StartAfter(vec![1u8; 32])), + prove: false, + select: V1Select::Count as i32, + group_by: Vec::new(), + having: Vec::new(), + }; + let result = platform + .query_documents_v1(request, &state, version) + .expect("query call should not error at the transport layer"); + assert!(!result.errors.is_empty(), "expected validation error"); + match &result.errors[0] { + QueryError::Query(QuerySyntaxError::Unsupported(msg)) => { + assert!( + msg.contains("start_after") && msg.contains("not yet implemented"), + "expected start_after-specific message, got: {}", + msg + ); + } + other => panic!("expected Unsupported error, got {:?}", other), + } +} + +mod ported_v0_count_tests { + //! Integration tests ported from the (now-removed) + //! `document_count_query::v0` test module — exercises every count + //! shape that the v0 endpoint exposed, now through the v1 + //! handler. Mechanical 1:1 translation: the request type changes + //! from `GetDocumentsCountRequestV0` to `GetDocumentsRequestV1` + //! with `select=COUNT` and the `return_distinct_counts_in_range` + //! flag mapped to an explicit `group_by`; the response pattern + //! changes from `GetDocumentsCountResponseV0`'s + //! `Counts(CountResults { … })` envelope to v1's nested + //! `Data(ResultData { variant: Counts(CountResults { … }) })`. + //! + //! Same fixtures + assertions as before — these tests are the + //! load-bearing coverage for the entire count-execution surface + //! and the port preserves them verbatim under the new wire shape. + + // `super` is the outer `tests` module (this file's top level); + // `super::super` is `v1/mod.rs`. Reach v1 items through the latter + // so the inner module sees `validate_and_route_for_tests`, + // `GetDocumentsRequestV1`, etc. directly. + use super::super::*; + use crate::query::tests::{setup_platform, store_data_contract, store_document}; + use dapi_grpc::platform::v0::get_documents_request::get_documents_request_v1::Select as V1Select; + use dpp::dashcore::Network; + use dpp::data_contract::document_type::random_document::CreateRandomDocument; + use dpp::document::DocumentV0Setters; + use dpp::tests::json_document::json_document_to_contract_with_ids; + use rand::rngs::StdRng; + use rand::SeedableRng; + + /// Builds an in-memory v12 contract with a `widget` document + /// type that has `documentsCountable: true` — the type's + /// primary-key tree becomes a CountTree, enabling the + /// unfiltered total-count fast path on both no-proof and prove + /// paths. + fn build_documents_countable_widget_contract() -> dpp::prelude::DataContract { + use dpp::data_contract::DataContractFactory; + use dpp::platform_value::platform_value; + + const PROTOCOL_VERSION_V12: u32 = 12; + let factory = + DataContractFactory::new(PROTOCOL_VERSION_V12).expect("expected to create factory"); + let document_schema = platform_value!({ + "type": "object", + "documentsCountable": true, + "properties": { + "color": {"type": "string", "position": 0, "maxLength": 32}, + }, + "additionalProperties": false, + }); + let schemas = platform_value!({ "widget": document_schema }); + factory + .create_with_value_config( + dpp::tests::utils::generate_random_identifier_struct(), + 0, + schemas, + None, + None, + ) + .expect("create contract") + .data_contract_owned() + } + + fn serialize_where_clauses_to_cbor(where_clauses: Vec) -> Vec { + use ciborium::value::Value as CborValue; + let cbor: CborValue = TryInto::::try_into(Value::Array(where_clauses)) + .expect("expected to convert where clauses to cbor value"); + let mut out = Vec::new(); + ciborium::ser::into_writer(&cbor, &mut out).expect("expected to serialize where clauses"); + out + } + + fn store_person_document( + platform: &crate::test::helpers::setup::TempPlatform, + data_contract: &dpp::prelude::DataContract, + id: [u8; 32], + first_name: &str, + last_name: &str, + age: u64, + platform_version: &PlatformVersion, + ) { + use dpp::document::{Document, DocumentV0}; + use std::collections::BTreeMap; + + let document_type = data_contract + .document_type_for_name("person") + .expect("expected document type"); + + let mut properties = BTreeMap::new(); + properties.insert("firstName".to_string(), Value::Text(first_name.to_string())); + properties.insert("lastName".to_string(), Value::Text(last_name.to_string())); + properties.insert("age".to_string(), Value::U64(age)); + + let document: Document = DocumentV0 { + id: Identifier::from(id), + owner_id: Identifier::from([0u8; 32]), + properties, + revision: None, + created_at: None, + updated_at: None, + transferred_at: None, + created_at_block_height: None, + updated_at_block_height: None, + transferred_at_block_height: None, + created_at_core_block_height: None, + updated_at_core_block_height: None, + transferred_at_core_block_height: None, + creator_id: None, + } + .into(); + + store_document( + platform, + data_contract, + document_type, + &document, + platform_version, + ); + } + + /// Build a `SELECT COUNT` v1 request with the given knobs. Keeps + /// each test's body focused on the per-test setup + assertion. + #[allow(clippy::too_many_arguments)] + fn count_v1_request( + data_contract_id: Vec, + document_type: &str, + where_bytes: Vec, + order_by_bytes: Vec, + group_by: Vec, + limit: Option, + prove: bool, + ) -> GetDocumentsRequestV1 { + GetDocumentsRequestV1 { + data_contract_id, + document_type: document_type.to_string(), + r#where: where_bytes, + order_by: order_by_bytes, + limit, + start: None, + prove, + select: V1Select::Count as i32, + group_by, + having: Vec::new(), + } + } + + /// Match the inner `Data(ResultData { variant: Counts(CountResults + /// { variant: AggregateCount(_) }) })` shape and return the count. + /// Panics on any other response shape. + fn unwrap_aggregate(response: GetDocumentsResponseV1) -> u64 { + match response.result { + Some(get_documents_response_v1::Result::Data(ResultData { + variant: + Some(result_data::Variant::Counts(CountResults { + variant: Some(count_results::Variant::AggregateCount(total)), + })), + })) => total, + other => panic!("expected aggregate count result, got {:?}", other), + } + } + + /// Match the inner `Data(ResultData { variant: Counts(CountResults + /// { variant: Entries(_) }) })` shape and return the entries. + fn unwrap_entries(response: GetDocumentsResponseV1) -> Vec { + match response.result { + Some(get_documents_response_v1::Result::Data(ResultData { + variant: + Some(result_data::Variant::Counts(CountResults { + variant: Some(count_results::Variant::Entries(entries)), + })), + })) => entries.entries, + other => panic!("expected per-key entries result, got {:?}", other), + } + } + + /// Unfiltered total count via the `documentsCountable: true` + /// fast path. Ported from v0-count's `test_documents_count_no_prove`. + #[test] + fn ported_documents_count_no_prove() { + let (platform, state, version) = setup_platform(None, Network::Testnet, None); + let platform_version = PlatformVersion::latest(); + + let contract = build_documents_countable_widget_contract(); + store_data_contract(&platform, &contract, version); + + let document_type = contract + .document_type_for_name("widget") + .expect("widget exists"); + + for i in 1..=5u8 { + let random_document = document_type + .random_document(Some(i as u64), platform_version) + .expect("expected to get random document"); + store_document( + &platform, + &contract, + document_type, + &random_document, + platform_version, + ); + } + + let request = count_v1_request( + contract.id().to_vec(), + "widget", + vec![], + Vec::new(), + /* group_by = */ Vec::new(), + /* limit = */ None, + /* prove = */ false, + ); + + let result = platform + .query_documents_v1(request, &state, version) + .expect("expected query to succeed"); + assert!(result.errors.is_empty(), "errors: {:?}", result.errors); + assert_eq!( + unwrap_aggregate(result.data.expect("data")), + 5, + "expected count of 5 documents" + ); + } + + /// Empty contract → aggregate 0. Ported from + /// `test_documents_count_empty_result`. + #[test] + fn ported_documents_count_empty_result() { + let (platform, state, version) = setup_platform(None, Network::Testnet, None); + + let contract = build_documents_countable_widget_contract(); + store_data_contract(&platform, &contract, version); + + let request = count_v1_request( + contract.id().to_vec(), + "widget", + vec![], + Vec::new(), + Vec::new(), + None, + false, + ); + let result = platform + .query_documents_v1(request, &state, version) + .expect("expected query to succeed"); + assert!(result.errors.is_empty(), "errors: {:?}", result.errors); + assert_eq!( + unwrap_aggregate(result.data.expect("data")), + 0, + "expected count of 0 documents" + ); + } + + /// `In` clause + per-In entries. The v0-count endpoint did this + /// implicitly (any In → PerInValue → entries); v1 makes the + /// grouping explicit via `group_by=["age"]`. Ported from + /// `test_documents_count_with_in_operator`. + #[test] + fn ported_documents_count_with_in_operator() { + let (platform, state, version) = setup_platform(None, Network::Testnet, None); + let platform_version = PlatformVersion::latest(); + + let data_contract = json_document_to_contract_with_ids( + "tests/supporting_files/contract/family/family-contract-countable.json", + None, + None, + false, + platform_version, + ) + .expect("expected to get json based contract"); + store_data_contract(&platform, &data_contract, version); + + for (id, name, age) in [ + ([1u8; 32], "Alice", 30u64), + ([2u8; 32], "Bob", 30), + ([3u8; 32], "Carol", 30), + ([4u8; 32], "Dave", 40), + ([5u8; 32], "Eve", 40), + ([6u8; 32], "Frank", 50), + ] { + store_person_document( + &platform, + &data_contract, + id, + name, + "Smith", + age, + platform_version, + ); + } + + let where_clauses = vec![Value::Array(vec![ + Value::Text("age".to_string()), + Value::Text("in".to_string()), + Value::Array(vec![Value::U64(30), Value::U64(40)]), + ])]; + + let request = count_v1_request( + data_contract.id().to_vec(), + "person", + serialize_where_clauses_to_cbor(where_clauses), + Vec::new(), + vec!["age".to_string()], + None, + false, + ); + + let result = platform + .query_documents_v1(request, &state, version) + .expect("expected query to succeed"); + assert!(result.errors.is_empty(), "errors: {:?}", result.errors); + let entries = unwrap_entries(result.data.expect("data")); + let total: u64 = entries.iter().map(|e| e.count).sum(); + assert_eq!(total, 5, "expected count of 5 (3 age=30 + 2 age=40)"); + } + + /// `In` clause + **empty** `group_by` (= aggregate). Drive's + /// `detect_mode` sees `In + no range + no prove` and routes to + /// `DocumentCountMode::PerInValue`, which emits + /// `DocumentCountResponse::Entries(Vec)`. The + /// v1 handler then folds those entries back into a single + /// `AggregateCount(total)` at the `mode.is_aggregate()` branch + /// of `dispatch_count_v1` (the `saturating_add` fold over + /// per-In counts). This is the only response-shape + /// transformation the v1 handler introduces, so it deserves a + /// dedicated regression to lock the wire contract: + /// + /// - Wire-visible shape MUST be `AggregateCount(_)`, not the + /// `Entries(_)` variant the drive executor emitted upstream. + /// A regression that forgets the `mode.is_aggregate()` branch + /// (or routes `select=COUNT, group_by=[]` differently in + /// `validate_and_route`) would silently leak per-In rows on + /// the wire — invisible to the documents-shape tests above. + /// - The folded total MUST equal the sum of per-In counts. A + /// regression that off-by-ones the fold, picks the wrong + /// accumulator, or silently picks a single branch's count + /// instead would still produce an `AggregateCount` of the + /// wrong magnitude. + /// + /// Pairs structurally with + /// [`ported_documents_count_with_in_operator`] above: same + /// fixture, same `where` clause, only `group_by` differs + /// (`["age"]` → wire `Entries`; `[]` → wire + /// `AggregateCount`). Together they pin both halves of the + /// `(group_by × PerInValue-execution)` matrix. + #[test] + fn documents_count_with_in_operator_and_empty_group_by_collapses_to_aggregate() { + let (platform, state, version) = setup_platform(None, Network::Testnet, None); + let platform_version = PlatformVersion::latest(); + + let data_contract = json_document_to_contract_with_ids( + "tests/supporting_files/contract/family/family-contract-countable.json", + None, + None, + false, + platform_version, + ) + .expect("expected to get json based contract"); + store_data_contract(&platform, &data_contract, version); + + // Same fixture rows as `ported_documents_count_with_in_operator` + // (3 × age=30, 2 × age=40, 1 × age=50). The In clause matches + // 3+2 = 5 rows; only age=50 sits outside the In window. + for (id, name, age) in [ + ([1u8; 32], "Alice", 30u64), + ([2u8; 32], "Bob", 30), + ([3u8; 32], "Carol", 30), + ([4u8; 32], "Dave", 40), + ([5u8; 32], "Eve", 40), + ([6u8; 32], "Frank", 50), + ] { + store_person_document( + &platform, + &data_contract, + id, + name, + "Smith", + age, + platform_version, + ); + } + + let where_clauses = vec![Value::Array(vec![ + Value::Text("age".to_string()), + Value::Text("in".to_string()), + Value::Array(vec![Value::U64(30), Value::U64(40)]), + ])]; + + let request = count_v1_request( + data_contract.id().to_vec(), + "person", + serialize_where_clauses_to_cbor(where_clauses), + Vec::new(), + /* group_by = */ Vec::new(), + /* limit = */ None, + /* prove = */ false, + ); + + let result = platform + .query_documents_v1(request, &state, version) + .expect("expected query to succeed"); + assert!(result.errors.is_empty(), "errors: {:?}", result.errors); + + // Load-bearing assertion #1: wire shape is the aggregate + // variant, NOT the entries variant. `unwrap_aggregate` + // panics if `result.variant` is `Entries(_)` — which is + // exactly the regression we're guarding against. + let total = unwrap_aggregate(result.data.expect("data")); + + // Load-bearing assertion #2: the folded total equals the + // sum of per-In counts (3 × age=30 + 2 × age=40 = 5). A + // wrong-accumulator regression that picks a single branch + // (e.g. returns 3 or 2 instead of 5) still produces an + // `AggregateCount` and would pass assertion #1 alone. + assert_eq!( + total, 5, + "expected aggregate count 5 (3 × age=30 + 2 × age=40); a value of 3 or 2 \ + indicates the per-In fold picks a single branch instead of summing" + ); + } + + /// Range without a `range_countable` index → picker rejection. + /// Ported from + /// `test_documents_count_range_without_range_countable_index_returns_clear_error`. + #[test] + fn ported_range_without_range_countable_index_returns_clear_error() { + let (platform, state, version) = setup_platform(None, Network::Testnet, None); + let platform_version = PlatformVersion::latest(); + + let data_contract = json_document_to_contract_with_ids( + "tests/supporting_files/contract/family/family-contract-countable.json", + None, + None, + false, + platform_version, + ) + .expect("expected to get json based contract"); + store_data_contract(&platform, &data_contract, version); + + let where_clauses = vec![Value::Array(vec![ + Value::Text("age".to_string()), + Value::Text(">".to_string()), + Value::U64(20), + ])]; + + let request = count_v1_request( + data_contract.id().to_vec(), + "person", + serialize_where_clauses_to_cbor(where_clauses), + Vec::new(), + Vec::new(), + None, + false, + ); + + let result = platform + .query_documents_v1(request, &state, version) + .expect("expected query to return validation error"); + assert!( + matches!( + result.errors.as_slice(), + [QueryError::InvalidArgument(msg)] if msg.contains("range_countable") + ) || matches!( + result.errors.as_slice(), + [QueryError::Query(QuerySyntaxError::WhereClauseOnNonIndexedProperty(msg))] + if msg.contains("range_countable") + ), + "expected range_countable-index rejection, got {:?}", + result.errors + ); + } + + /// `prove = true` + Equal-on-single-property-countable-index → + /// CountTree element proof. Ported from + /// `test_documents_count_with_prove_and_covering_equal`. + #[test] + fn ported_documents_count_with_prove_and_covering_equal() { + let (platform, state, version) = setup_platform(None, Network::Testnet, None); + let platform_version = PlatformVersion::latest(); + + let data_contract = json_document_to_contract_with_ids( + "tests/supporting_files/contract/family/family-contract-countable.json", + None, + None, + false, + platform_version, + ) + .expect("expected to get json based contract"); + store_data_contract(&platform, &data_contract, version); + + let document_type = data_contract + .document_type_for_name("person") + .expect("expected document type"); + + let mut std_rng = StdRng::seed_from_u64(500); + for first_name in ["Alice", "Alice", "Bob"] { + let mut doc = document_type + .random_document_with_rng(&mut std_rng, platform_version) + .expect("expected to get random document"); + let mut props = std::collections::BTreeMap::new(); + props.insert("firstName".to_string(), Value::Text(first_name.to_string())); + props.insert("lastName".to_string(), Value::Text("Smith".to_string())); + props.insert("age".to_string(), Value::U64(30)); + doc.set_properties(props); + store_document( + &platform, + &data_contract, + document_type, + &doc, + platform_version, + ); + } + + let where_clauses = vec![Value::Array(vec![ + Value::Text("firstName".to_string()), + Value::Text("==".to_string()), + Value::Text("Alice".to_string()), + ])]; + + let request = count_v1_request( + data_contract.id().to_vec(), + "person", + serialize_where_clauses_to_cbor(where_clauses), + Vec::new(), + Vec::new(), + None, + true, + ); + + let result = platform + .query_documents_v1(request, &state, version) + .expect("expected query to succeed"); + assert!(result.errors.is_empty(), "errors: {:?}", result.errors); + match result.data { + Some(GetDocumentsResponseV1 { + result: Some(get_documents_response_v1::Result::Proof(proof)), + metadata: Some(_), + }) => { + assert!( + !proof.grovedb_proof.is_empty(), + "expected non-empty grovedb proof bytes for covered prove count" + ); + } + other => panic!("expected Proof response, got {:?}", other), + } + } + + /// `prove = true` with no covering index → clear error. Ported + /// from `test_documents_count_prove_without_covering_index_returns_clear_error`. + #[test] + fn ported_prove_without_covering_index_returns_clear_error() { + let (platform, state, version) = setup_platform(None, Network::Testnet, None); + let platform_version = PlatformVersion::latest(); + + let data_contract = json_document_to_contract_with_ids( + "tests/supporting_files/contract/family/family-contract-countable.json", + None, + None, + false, + platform_version, + ) + .expect("expected to get json based contract"); + store_data_contract(&platform, &data_contract, version); + + let request = count_v1_request( + data_contract.id().to_vec(), + "person", + vec![], + Vec::new(), + Vec::new(), + None, + true, + ); + + let result = platform + .query_documents_v1(request, &state, version) + .expect("expected query to surface a validation error"); + assert!( + matches!( + result.errors.as_slice(), + [QueryError::Query( + QuerySyntaxError::WhereClauseOnNonIndexedProperty(msg), + )] if msg.contains("countable") + ), + "expected covering-index rejection, got {:?}", + result.errors + ); + } + + /// `prove = true` + `In` → CountTree element proof. Ported + /// from `test_documents_count_with_in_and_prove_returns_proof`. + /// v1 expresses the per-In emission explicitly via + /// `group_by=["age"]`; the underlying drive routing decision + /// (PointLookupProof) and emitted proof bytes are the same as + /// the v0-count test. + #[test] + fn ported_documents_count_with_in_and_prove_returns_proof() { + let (platform, state, version) = setup_platform(None, Network::Testnet, None); + let platform_version = PlatformVersion::latest(); + + let data_contract = json_document_to_contract_with_ids( + "tests/supporting_files/contract/family/family-contract-countable.json", + None, + None, + false, + platform_version, + ) + .expect("expected to get json based contract"); + store_data_contract(&platform, &data_contract, version); + + for (id, name, age) in [ + ([1u8; 32], "Alice", 30u64), + ([2u8; 32], "Bob", 30), + ([3u8; 32], "Carol", 30), + ([4u8; 32], "Dave", 40), + ([5u8; 32], "Eve", 40), + ([6u8; 32], "Frank", 50), + ] { + store_person_document( + &platform, + &data_contract, + id, + name, + "Smith", + age, + platform_version, + ); + } + + let where_clauses = vec![Value::Array(vec![ + Value::Text("age".to_string()), + Value::Text("in".to_string()), + Value::Array(vec![Value::U64(30), Value::U64(40)]), + ])]; + let order_by = vec![Value::Array(vec![ + Value::Text("age".to_string()), + Value::Text("asc".to_string()), + ])]; + + let request = count_v1_request( + data_contract.id().to_vec(), + "person", + serialize_where_clauses_to_cbor(where_clauses), + serialize_where_clauses_to_cbor(order_by), + vec!["age".to_string()], + None, + true, + ); + + let result = platform + .query_documents_v1(request, &state, version) + .expect("expected query to succeed"); + assert!(result.errors.is_empty(), "errors: {:?}", result.errors); + match result.data { + Some(GetDocumentsResponseV1 { + result: Some(get_documents_response_v1::Result::Proof(proof)), + metadata: Some(_), + }) => { + assert!( + !proof.grovedb_proof.is_empty(), + "expected non-empty grovedb proof bytes for In + prove count" + ); + } + other => panic!( + "expected Proof response from In + prove count, got {:?}", + other + ), + } + } + + /// Range count happy path — sum + distinct + limit + direction. + /// Ported from `test_documents_count_range_query_no_prove`. v1 + /// translates `return_distinct_counts_in_range=true` to + /// `group_by=["color"]` and the summed mode keeps `group_by=[]`. + #[test] + fn ported_documents_count_range_query_no_prove() { + use dpp::data_contract::DataContractFactory; + use dpp::platform_value::platform_value; + + const PROTOCOL_VERSION_V12: u32 = 12; + + let (platform, state, version) = setup_platform(None, Network::Testnet, None); + let platform_version = PlatformVersion::latest(); + + let factory = + DataContractFactory::new(PROTOCOL_VERSION_V12).expect("expected to create factory"); + let document_schema = platform_value!({ + "type": "object", + "properties": { + "color": {"type": "string", "position": 0, "maxLength": 32}, + }, + "indices": [{ + "name": "byColor", + "properties": [{"color": "asc"}], + "countable": "countable", + "rangeCountable": true, + }], + "additionalProperties": false, + }); + let schemas = platform_value!({ "widget": document_schema }); + let contract = factory + .create_with_value_config( + dpp::tests::utils::generate_random_identifier_struct(), + 0, + schemas, + None, + None, + ) + .expect("create contract") + .data_contract_owned(); + store_data_contract(&platform, &contract, version); + + let document_type = contract + .document_type_for_name("widget") + .expect("widget exists"); + + for (i, color) in ["red", "red", "blue", "green", "green", "green"] + .iter() + .enumerate() + { + let mut doc = document_type + .random_document(Some((i + 1) as u64), platform_version) + .expect("random doc"); + let mut props = std::collections::BTreeMap::new(); + props.insert("color".to_string(), Value::Text(color.to_string())); + doc.set_properties(props); + store_document(&platform, &contract, document_type, &doc, platform_version); + } + + let make_request = |group_by: Vec, limit: Option, ascending: Option| { + let where_clauses = vec![Value::Array(vec![ + Value::Text("color".to_string()), + Value::Text(">".to_string()), + Value::Text("blue".to_string()), + ])]; + let order_by_bytes = match ascending { + Some(asc) => serialize_where_clauses_to_cbor(vec![Value::Array(vec![ + Value::Text("color".to_string()), + Value::Text(if asc { "asc" } else { "desc" }.to_string()), + ])]), + None => Vec::new(), + }; + count_v1_request( + contract.id().to_vec(), + "widget", + serialize_where_clauses_to_cbor(where_clauses), + order_by_bytes, + group_by, + limit, + false, + ) + }; + + // Sum mode: green(3) + red(2) = 5. + let result = platform + .query_documents_v1(make_request(Vec::new(), None, None), &state, version) + .expect("query should succeed"); + assert!(result.errors.is_empty(), "errors: {:?}", result.errors); + assert_eq!(unwrap_aggregate(result.data.expect("data")), 5); + + // Distinct mode ascending: [(green, 3), (red, 2)]. + let result = platform + .query_documents_v1( + make_request(vec!["color".to_string()], None, Some(true)), + &state, + version, + ) + .expect("query should succeed"); + assert!(result.errors.is_empty(), "errors: {:?}", result.errors); + let entries = unwrap_entries(result.data.expect("data")); + assert_eq!(entries.len(), 2); + assert_eq!(entries[0].key, b"green".to_vec()); + assert_eq!(entries[0].count, 3); + assert_eq!(entries[1].key, b"red".to_vec()); + assert_eq!(entries[1].count, 2); + + // Distinct with limit=1. + let result = platform + .query_documents_v1( + make_request(vec!["color".to_string()], Some(1), Some(true)), + &state, + version, + ) + .expect("query should succeed"); + assert!(result.errors.is_empty()); + let entries = unwrap_entries(result.data.expect("data")); + assert_eq!(entries.len(), 1); + assert_eq!(entries[0].key, b"green".to_vec()); + + // Distinct descending: [(red, 2), (green, 3)]. + let result = platform + .query_documents_v1( + make_request(vec!["color".to_string()], None, Some(false)), + &state, + version, + ) + .expect("query should succeed"); + assert!(result.errors.is_empty()); + let entries = unwrap_entries(result.data.expect("data")); + assert_eq!(entries.len(), 2); + assert_eq!(entries[0].key, b"red".to_vec()); + assert_eq!(entries[1].key, b"green".to_vec()); + } + + /// `RangeDistinctProof` dispatch — `group_by=["color"]` + + /// `prove=true` + range clause. Ported from + /// `test_documents_count_range_with_prove_and_distinct_returns_proof`. + #[test] + fn ported_documents_count_range_with_prove_and_distinct_returns_proof() { + use dpp::data_contract::DataContractFactory; + use dpp::platform_value::platform_value; + + const PROTOCOL_VERSION_V12: u32 = 12; + + let (platform, state, version) = setup_platform(None, Network::Testnet, None); + + let factory = + DataContractFactory::new(PROTOCOL_VERSION_V12).expect("expected to create factory"); + let document_schema = platform_value!({ + "type": "object", + "properties": { + "color": {"type": "string", "position": 0, "maxLength": 32}, + }, + "indices": [{ + "name": "byColor", + "properties": [{"color": "asc"}], + "countable": "countable", + "rangeCountable": true, + }], + "additionalProperties": false, + }); + let schemas = platform_value!({ "widget": document_schema }); + let contract = factory + .create_with_value_config( + dpp::tests::utils::generate_random_identifier_struct(), + 0, + schemas, + None, + None, + ) + .expect("create contract") + .data_contract_owned(); + store_data_contract(&platform, &contract, version); + + let document_type = contract + .document_type_for_name("widget") + .expect("widget exists"); + let platform_version = PlatformVersion::latest(); + for (i, color) in ["red", "red", "green", "green", "green", "blue"] + .iter() + .enumerate() + { + let mut doc = document_type + .random_document(Some((i + 1) as u64), platform_version) + .expect("random doc"); + let mut props = std::collections::BTreeMap::new(); + props.insert("color".to_string(), Value::Text(color.to_string())); + doc.set_properties(props); + store_document(&platform, &contract, document_type, &doc, platform_version); + } + + let where_clauses = vec![Value::Array(vec![ + Value::Text("color".to_string()), + Value::Text(">".to_string()), + Value::Text("blue".to_string()), + ])]; + let request = count_v1_request( + contract.id().to_vec(), + "widget", + serialize_where_clauses_to_cbor(where_clauses), + Vec::new(), + vec!["color".to_string()], + None, + true, + ); + + let result = platform + .query_documents_v1(request, &state, version) + .expect("query should succeed"); + assert!( + result.errors.is_empty(), + "expected no validation errors, got {:?}", + result.errors + ); + match result.data { + Some(GetDocumentsResponseV1 { + result: Some(get_documents_response_v1::Result::Proof(proof)), + metadata: Some(_), + }) => { + assert!( + !proof.grovedb_proof.is_empty(), + "expected non-empty grovedb proof bytes for non-empty range result" + ); + } + other => panic!("expected Proof response, got {:?}", other), + } + } +} diff --git a/packages/rs-drive-abci/src/query/mod.rs b/packages/rs-drive-abci/src/query/mod.rs index 79ac258b28c..e3cc7911f1f 100644 --- a/packages/rs-drive-abci/src/query/mod.rs +++ b/packages/rs-drive-abci/src/query/mod.rs @@ -1,6 +1,5 @@ mod address_funds; mod data_contract_based_queries; -mod document_count_query; mod document_query; mod group_queries; mod identity_based_queries; diff --git a/packages/rs-drive-abci/src/query/service.rs b/packages/rs-drive-abci/src/query/service.rs index 14fa7c49974..5bf6259fa6d 100644 --- a/packages/rs-drive-abci/src/query/service.rs +++ b/packages/rs-drive-abci/src/query/service.rs @@ -22,14 +22,13 @@ use dapi_grpc::platform::v0::{ GetContestedResourcesRequest, GetContestedResourcesResponse, GetCurrentQuorumsInfoRequest, GetCurrentQuorumsInfoResponse, GetDataContractHistoryRequest, GetDataContractHistoryResponse, GetDataContractRequest, GetDataContractResponse, GetDataContractsRequest, - GetDataContractsResponse, GetDocumentsCountRequest, GetDocumentsCountResponse, - GetDocumentsRequest, GetDocumentsResponse, GetEpochsInfoRequest, GetEpochsInfoResponse, - GetEvonodesProposedEpochBlocksByIdsRequest, GetEvonodesProposedEpochBlocksByRangeRequest, - GetEvonodesProposedEpochBlocksResponse, GetFinalizedEpochInfosRequest, - GetFinalizedEpochInfosResponse, GetGroupActionSignersRequest, GetGroupActionSignersResponse, - GetGroupActionsRequest, GetGroupActionsResponse, GetGroupInfoRequest, GetGroupInfoResponse, - GetGroupInfosRequest, GetGroupInfosResponse, GetIdentitiesBalancesRequest, - GetIdentitiesBalancesResponse, GetIdentitiesContractKeysRequest, + GetDataContractsResponse, GetDocumentsRequest, GetDocumentsResponse, GetEpochsInfoRequest, + GetEpochsInfoResponse, GetEvonodesProposedEpochBlocksByIdsRequest, + GetEvonodesProposedEpochBlocksByRangeRequest, GetEvonodesProposedEpochBlocksResponse, + GetFinalizedEpochInfosRequest, GetFinalizedEpochInfosResponse, GetGroupActionSignersRequest, + GetGroupActionSignersResponse, GetGroupActionsRequest, GetGroupActionsResponse, + GetGroupInfoRequest, GetGroupInfoResponse, GetGroupInfosRequest, GetGroupInfosResponse, + GetIdentitiesBalancesRequest, GetIdentitiesBalancesResponse, GetIdentitiesContractKeysRequest, GetIdentitiesContractKeysResponse, GetIdentitiesTokenBalancesRequest, GetIdentitiesTokenBalancesResponse, GetIdentitiesTokenInfosRequest, GetIdentitiesTokenInfosResponse, GetIdentityBalanceAndRevisionRequest, @@ -406,18 +405,6 @@ impl PlatformService for QueryService { .await } - async fn get_documents_count( - &self, - request: Request, - ) -> Result, Status> { - self.handle_blocking_query( - request, - Platform::::query_documents_count, - "get_documents_count", - ) - .await - } - async fn get_identity_by_public_key_hash( &self, request: Request, diff --git a/packages/rs-drive-proof-verifier/src/proof/document_count.rs b/packages/rs-drive-proof-verifier/src/proof/document_count.rs index 13f104f1806..4fa1fc970a4 100644 --- a/packages/rs-drive-proof-verifier/src/proof/document_count.rs +++ b/packages/rs-drive-proof-verifier/src/proof/document_count.rs @@ -1,7 +1,7 @@ use crate::error::MapGroveDbError; use crate::verify::verify_tenderdash_proof; use crate::{ContextProvider, Error, FromProof}; -use dapi_grpc::platform::v0::{GetDocumentsCountResponse, Proof, ResponseMetadata}; +use dapi_grpc::platform::v0::{GetDocumentsResponse, Proof, ResponseMetadata}; use dapi_grpc::platform::VersionedGrpcResponse; use dpp::dashcore::Network; use dpp::version::PlatformVersion; @@ -17,7 +17,7 @@ where Q::Error: std::fmt::Display, { type Request = Q; - type Response = GetDocumentsCountResponse; + type Response = GetDocumentsResponse; fn maybe_from_proof_with_metadata<'a, I: Into, O: Into>( request: I, @@ -141,14 +141,30 @@ pub fn verify_distinct_count_proof( /// /// ## Entry shape /// -/// - **Equal-only, fully covered**: a single entry with empty `key` -/// and `count` equal to the covered branch's CountTree -/// `count_value`. -/// - **Equal prefix + `In` on last property**: one entry per In -/// value, `key = `, `count` equal to that In -/// value's CountTree `count_value`. Branches with zero documents -/// are omitted from the result (callers can detect "I asked for 3 -/// In values but got entries for 2" directly). +/// The verifier walks grovedb's +/// `(path, key, Option)` triples and emits one +/// [`SplitCountEntry`] per **present** queried key. The current +/// path-query shape does NOT set +/// `absence_proofs_for_non_existing_searched_keys: true`, so absent +/// branches are silently omitted from grovedb's elements stream +/// rather than surfaced as `(path, key, None)` triples. +/// +/// - **Equal-only, fully covered**: zero or one entry. One entry +/// with empty `key` and `count: Some(n)` if the covered branch +/// exists; no entries at all if the branch is absent. +/// - **Equal prefix + `In` on last property**: one entry per +/// **present** queried In value, with +/// `key = ` and `count: Some(n)`. Absent In +/// values are omitted from the returned list. Callers that need +/// to distinguish "verified with n docs" from "queried but +/// absent" diff their request's In array against the returned +/// entries by `key`. +/// +/// The `count: Option` field's `None` variant is reserved for a +/// future variant that flips `absence_proofs_for_non_existing_searched_keys` +/// — see [`SplitCountEntry::count`] and +/// [`DriveDocumentCountQuery::verify_point_lookup_count_proof`] for +/// the forward-compat path. /// /// ## Replaces materialize-and-count /// @@ -276,18 +292,18 @@ mod tests { let a = SplitCountEntry { in_key: Some(b"acme".to_vec()), key: b"red".to_vec(), - count: 42, + count: Some(42), }; let b = a.clone(); assert_eq!(a, b); assert_eq!(a.in_key.as_deref(), Some(b"acme".as_slice())); assert_eq!(a.key, b"red".to_vec()); - assert_eq!(a.count, 42); + assert_eq!(a.count, Some(42)); let flat = SplitCountEntry { in_key: None, key: b"green".to_vec(), - count: 7, + count: Some(7), }; assert!(flat.in_key.is_none()); @@ -302,7 +318,10 @@ mod tests { ..a.clone() }; assert_ne!(a, different_key); - let different_count = SplitCountEntry { count: 99, ..a }; + let different_count = SplitCountEntry { + count: Some(99), + ..a + }; assert_ne!(b, different_count); } diff --git a/packages/rs-drive-proof-verifier/src/proof/document_split_count.rs b/packages/rs-drive-proof-verifier/src/proof/document_split_count.rs index ef53b2dd15f..f9dfb55d8a0 100644 --- a/packages/rs-drive-proof-verifier/src/proof/document_split_count.rs +++ b/packages/rs-drive-proof-verifier/src/proof/document_split_count.rs @@ -1,5 +1,5 @@ use crate::{ContextProvider, Error, FromProof}; -use dapi_grpc::platform::v0::{GetDocumentsCountResponse, Proof, ResponseMetadata}; +use dapi_grpc::platform::v0::{GetDocumentsResponse, Proof, ResponseMetadata}; use dpp::dashcore::Network; use dpp::version::PlatformVersion; use drive::query::{DriveDocumentQuery, SplitCountEntry}; @@ -31,7 +31,7 @@ impl DocumentSplitCounts { pub fn into_flat_map(self) -> BTreeMap, u64> { let mut out: BTreeMap, u64> = BTreeMap::new(); for entry in self.0 { - *out.entry(entry.key).or_insert(0) += entry.count; + *out.entry(entry.key).or_insert(0) += entry.count.unwrap_or(0); } out } @@ -46,21 +46,23 @@ impl DocumentSplitCounts { /// Reject the generic [`FromProof`] entry point for [`DocumentSplitCounts`]. /// -/// `DocumentSplitCounts` is reached from rs-sdk via -/// `FromProof` (which routes to the count-tree -/// element proof / aggregate-count proof / distinct-count proof based -/// on the request shape — see -/// `rs-sdk/src/platform/documents/document_count_query.rs`). The -/// generic `FromProof` path doesn't carry enough information to -/// pick a proof shape, so it errors out explicitly. Calling this -/// directly is a programmer mistake. +/// `DocumentSplitCounts` is reached from rs-sdk via the +/// `FromProof` impl defined alongside the SDK's +/// `DocumentQuery` type (see +/// `rs-sdk/src/platform/documents/document_count.rs`), which +/// dispatches to the right proof shape (CountTree element / +/// aggregate-count / distinct-count) based on +/// `(group_by, where_clauses, prove)`. The generic +/// `FromProof>` path doesn't carry +/// enough information to pick a proof shape, so it errors out +/// explicitly — calling this impl directly is a programmer mistake. impl<'dq, Q> FromProof for DocumentSplitCounts where Q: TryInto> + Clone + 'dq, Q::Error: std::fmt::Display, { type Request = Q; - type Response = GetDocumentsCountResponse; + type Response = GetDocumentsResponse; fn maybe_from_proof_with_metadata<'a, I: Into, O: Into>( _request: I, @@ -74,9 +76,9 @@ where { Err(Error::RequestError { error: "DocumentSplitCounts can't be verified via the generic FromProof path; \ - use the rs-sdk Fetch impl on DocumentCountQuery, which routes to the \ - correct proof shape (CountTree element / aggregate / distinct) based \ - on the request" + call DocumentSplitCounts::fetch on a DocumentQuery with .with_select(Count), \ + which routes through the right proof shape (CountTree element / aggregate / \ + distinct) based on the request" .to_string(), }) } @@ -109,7 +111,11 @@ mod tests { SplitCountEntry { in_key: in_key.map(|s| s.to_vec()), key: key.to_vec(), - count, + // Test helper always builds verified entries; `None` + // entries (caller asked but verifier was silent) are + // tested via explicit struct construction at the SDK + // synthesis call site, not through this helper. + count: Some(count), } } diff --git a/packages/rs-drive/Cargo.toml b/packages/rs-drive/Cargo.toml index 62b6fc0c59f..e63bfb7d996 100644 --- a/packages/rs-drive/Cargo.toml +++ b/packages/rs-drive/Cargo.toml @@ -52,12 +52,12 @@ enum-map = { version = "2.0.3", optional = true } intmap = { version = "3.0.1", features = ["serde"], optional = true } chrono = { version = "0.4.35", optional = true } itertools = { version = "0.13", optional = true } -grovedb = { git = "https://github.com/dashpay/grovedb", rev = "a917d92d2477672eed73c4c08e53e93449a6a094", optional = true, default-features = false } -grovedb-costs = { git = "https://github.com/dashpay/grovedb", rev = "a917d92d2477672eed73c4c08e53e93449a6a094", optional = true } -grovedb-path = { git = "https://github.com/dashpay/grovedb", rev = "a917d92d2477672eed73c4c08e53e93449a6a094" } -grovedb-storage = { git = "https://github.com/dashpay/grovedb", rev = "a917d92d2477672eed73c4c08e53e93449a6a094", optional = true } -grovedb-version = { git = "https://github.com/dashpay/grovedb", rev = "a917d92d2477672eed73c4c08e53e93449a6a094" } -grovedb-epoch-based-storage-flags = { git = "https://github.com/dashpay/grovedb", rev = "a917d92d2477672eed73c4c08e53e93449a6a094" } +grovedb = { git = "https://github.com/dashpay/grovedb", rev = "7a649386ac8a06a608a614385a2333e03cd931c3", optional = true, default-features = false } +grovedb-costs = { git = "https://github.com/dashpay/grovedb", rev = "7a649386ac8a06a608a614385a2333e03cd931c3", optional = true } +grovedb-path = { git = "https://github.com/dashpay/grovedb", rev = "7a649386ac8a06a608a614385a2333e03cd931c3" } +grovedb-storage = { git = "https://github.com/dashpay/grovedb", rev = "7a649386ac8a06a608a614385a2333e03cd931c3", optional = true } +grovedb-version = { git = "https://github.com/dashpay/grovedb", rev = "7a649386ac8a06a608a614385a2333e03cd931c3" } +grovedb-epoch-based-storage-flags = { git = "https://github.com/dashpay/grovedb", rev = "7a649386ac8a06a608a614385a2333e03cd931c3" } [dev-dependencies] criterion = "0.5" @@ -84,6 +84,10 @@ assert_matches = "1.5.0" name = "benchmarks" harness = false +[[bench]] +name = "document_count_worst_case" +harness = false + [features] default = ["full", "verify", "fixtures-and-mocks", "cbor_query"] diff --git a/packages/rs-drive/benches/document_count_worst_case.rs b/packages/rs-drive/benches/document_count_worst_case.rs new file mode 100644 index 00000000000..0853ffef95f --- /dev/null +++ b/packages/rs-drive/benches/document_count_worst_case.rs @@ -0,0 +1,2159 @@ +//! Worst-case benchmarks for the document-count query paths introduced by +//! `GetDocumentsRequestV1`. +//! +//! The fixture intentionally uses Drive's normal contract application and +//! document insertion path so the resulting GroveDB contains the same primary +//! trees, countable index trees, and range-countable index trees as production. +//! +//! Environment knobs: +//! - `DASH_PLATFORM_COUNT_BENCH_ROWS`: row count to build; defaults to 2,000,000. +//! - `DASH_PLATFORM_COUNT_BENCH_DB`: fixture directory; defaults under `std::env::temp_dir()`. +//! - `DASH_PLATFORM_COUNT_BENCH_REBUILD=1`: remove and rebuild the fixture. +//! - `DASH_PLATFORM_COUNT_BENCH_BATCH_SIZE`: inserts per transaction; defaults to 10,000. + +use criterion::{black_box, criterion_group, criterion_main, BatchSize, Criterion}; +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::{DataContract, DataContractFactory}; +use dpp::document::{Document, DocumentV0}; +use dpp::identifier::Identifier; +use dpp::platform_value::{platform_value, Value}; +use dpp::version::PlatformVersion; +use drive::config::DriveConfig; +use drive::drive::Drive; +use drive::query::{ + CountMode, DocumentCountRequest, DocumentCountResponse, DriveDocumentCountQuery, WhereClause, + WhereOperator, +}; +use drive::util::object_size_info::DocumentInfo::DocumentRefInfo; +use drive::util::object_size_info::{DocumentAndContractInfo, OwnedDocumentInfo}; +use drive::util::storage_flags::StorageFlags; +use grovedb::operations::proof::GroveDBProof; +use grovedb::{GroveDb, PathQuery}; +use std::borrow::Cow; +use std::collections::BTreeMap; +use std::env; +use std::fs; +use std::path::PathBuf; +use std::time::Instant; + +const PROTOCOL_VERSION_V12: u32 = 12; +// Bumped when the on-disk fixture layout changes in a way that +// invalidates a cached `tmp/dash-platform-document-count-bench-v{N}-rows-…` +// directory. v2: countable-terminator value trees are now `CountTree` +// for any countability tier (not just `range_countable`), with +// continuations wrapped `NonCounted`. Old v1 caches were built under +// the previous layout and need to be rebuilt to verify proofs +// against the new code. +const FIXTURE_SCHEMA_VERSION: u32 = 2; +const DEFAULT_ROW_COUNT: u64 = 100_000; +const DEFAULT_BATCH_SIZE: u64 = 10_000; +const BRAND_COUNT: u64 = 100; +const DOCUMENT_TYPE_NAME: &str = "widget"; +const READY_MARKER: &str = ".document-count-worst-case-ready"; + +struct CountBenchFixture { + drive: Drive, + data_contract: DataContract, + drive_config: DriveConfig, + row_count: u64, + range_floor: String, +} + +impl CountBenchFixture { + fn load_or_create() -> Self { + let row_count = row_count(); + let fixture_path = fixture_path(row_count); + let rebuild = env_flag("DASH_PLATFORM_COUNT_BENCH_REBUILD"); + let ready_marker = fixture_path.join(READY_MARKER); + let expected_marker = fixture_marker(row_count); + + if rebuild && fixture_path.exists() { + fs::remove_dir_all(&fixture_path).expect("expected to remove old count bench fixture"); + } + + let data_contract = widget_contract(); + let drive_config = DriveConfig::default(); + + if ready_marker.exists() + && fs::read_to_string(&ready_marker) + .expect("expected to read count bench fixture marker") + == expected_marker + { + eprintln!( + "reusing document-count fixture at {} with {} rows", + fixture_path.display(), + row_count + ); + let (drive, _) = Drive::open(&fixture_path, Some(drive_config.clone())) + .expect("expected to open existing count bench fixture"); + return Self::new(drive, data_contract, drive_config, row_count); + } + + if fixture_path.exists() { + fs::remove_dir_all(&fixture_path) + .expect("expected to remove incomplete count bench fixture"); + } + fs::create_dir_all(&fixture_path).expect("expected to create count bench fixture dir"); + + eprintln!( + "building document-count fixture at {} with {} rows", + fixture_path.display(), + row_count + ); + + let started = Instant::now(); + let platform_version = PlatformVersion::latest(); + let (drive, _) = Drive::open(&fixture_path, Some(drive_config.clone())) + .expect("expected to open new count bench fixture"); + + drive + .create_initial_state_structure(None, platform_version) + .expect("expected to create initial state structure"); + drive + .apply_contract( + &data_contract, + BlockInfo::default(), + true, + StorageFlags::optional_default_as_cow(), + None, + platform_version, + ) + .expect("expected to apply count bench contract"); + + populate_fixture(&drive, &data_contract, row_count, platform_version); + fs::write(&ready_marker, expected_marker) + .expect("expected to mark count bench fixture ready"); + + eprintln!( + "built document-count fixture with {} rows in {:.2?}", + row_count, + started.elapsed() + ); + + Self::new(drive, data_contract, drive_config, row_count) + } + + fn new( + drive: Drive, + data_contract: DataContract, + drive_config: DriveConfig, + row_count: u64, + ) -> Self { + let color_count = color_count_for_rows(row_count); + let range_floor = color_label(color_count / 2); + + Self { + drive, + data_contract, + drive_config, + row_count, + range_floor, + } + } +} + +fn widget_contract() -> DataContract { + let factory = + DataContractFactory::new(PROTOCOL_VERSION_V12).expect("expected to create factory"); + let document_schema = platform_value!({ + "type": "object", + "documentsCountable": true, + "properties": { + "brand": {"type": "string", "position": 0, "maxLength": 32}, + "color": {"type": "string", "position": 1, "maxLength": 32}, + "serial": {"type": "integer", "position": 2} + }, + "required": ["brand", "color", "serial"], + "indices": [ + { + "name": "byBrand", + "properties": [{"brand": "asc"}], + "countable": "countable" + }, + { + "name": "byColor", + "properties": [{"color": "asc"}], + "countable": "countable", + "rangeCountable": true + }, + { + "name": "byBrandColor", + "properties": [{"brand": "asc"}, {"color": "asc"}], + "countable": "countable", + "rangeCountable": true + } + ], + "additionalProperties": false + }); + let schemas = platform_value!({ DOCUMENT_TYPE_NAME: document_schema }); + + factory + .create_with_value_config(Identifier::from([42u8; 32]), 0, schemas, None, None) + .expect("expected to create count bench data contract") + .data_contract_owned() +} + +fn populate_fixture( + drive: &Drive, + data_contract: &DataContract, + row_count: u64, + platform_version: &PlatformVersion, +) { + let document_type = data_contract + .document_type_for_name(DOCUMENT_TYPE_NAME) + .expect("expected widget document type"); + let batch_size = batch_size(); + let brands: Vec = (0..BRAND_COUNT).map(brand_label).collect(); + let colors: Vec = (0..color_count_for_rows(row_count)) + .map(color_label) + .collect(); + + let mut next_row = 0; + while next_row < row_count { + let end_row = (next_row + batch_size).min(row_count); + let transaction = drive.grove.start_transaction(); + + for row in next_row..end_row { + let brand = &brands[(row % BRAND_COUNT) as usize]; + let color = &colors[(row / BRAND_COUNT) as usize]; + insert_widget_document( + drive, + data_contract, + document_type, + row, + brand, + color, + Some(&transaction), + platform_version, + ); + } + + drive + .grove + .commit_transaction(transaction) + .value + .expect("expected count bench insert transaction to commit"); + + next_row = end_row; + if next_row == row_count || next_row % 100_000 == 0 { + eprintln!("inserted {next_row}/{row_count} count bench rows"); + } + } +} + +#[allow(clippy::too_many_arguments)] +fn insert_widget_document( + drive: &Drive, + data_contract: &DataContract, + document_type: dpp::data_contract::document_type::DocumentTypeRef, + row: u64, + brand: &str, + color: &str, + transaction: grovedb::TransactionArg, + platform_version: &PlatformVersion, +) { + let mut properties = BTreeMap::new(); + properties.insert("brand".to_string(), Value::Text(brand.to_string())); + properties.insert("color".to_string(), Value::Text(color.to_string())); + properties.insert("serial".to_string(), Value::U64(row)); + + let document: Document = DocumentV0 { + id: Identifier::from(document_id(row)), + owner_id: Identifier::from([7u8; 32]), + properties, + revision: None, + created_at: None, + updated_at: None, + transferred_at: None, + created_at_block_height: None, + updated_at_block_height: None, + transferred_at_block_height: None, + created_at_core_block_height: None, + updated_at_core_block_height: None, + transferred_at_core_block_height: None, + creator_id: None, + } + .into(); + + let storage_flags = Some(Cow::Owned(StorageFlags::SingleEpoch(0))); + drive + .add_document_for_contract( + DocumentAndContractInfo { + owned_document_info: OwnedDocumentInfo { + document_info: DocumentRefInfo((&document, storage_flags)), + owner_id: None, + }, + contract: data_contract, + document_type, + }, + false, + BlockInfo::default(), + true, + transaction, + platform_version, + None, + ) + .expect("expected to insert count bench document"); +} + +fn document_count_worst_case(c: &mut Criterion) { + let fixture = CountBenchFixture::load_or_create(); + let platform_version = PlatformVersion::latest(); + let brands = all_brand_values(); + let broad_range_floor = Value::Text(fixture.range_floor.clone()); + + // One-shot proof-size report. Criterion measures time, but for + // count-proof work the load-bearing number is bytes-per-proof — + // an optimization that shaves a merk layer (e.g. the + // rangeCountable terminator's `[0]` descent) drops proof size + // linearly with the number of resolved branches while leaving + // wall-clock per-proof time roughly unchanged on warm caches. + // Print sizes once at bench setup so reviewers can compare + // before/after numbers from the same fixture without parsing + // criterion's HTML output. + report_proof_sizes(&fixture, &brands, &broad_range_floor, platform_version); + + // Full `(group_by × where_shape)` outcome matrix at the drive + // layer. Surfaces which combinations: + // - the drive dispatcher accepts (vs rejects with a typed error) + // - succeed on the no-proof path + // - succeed on the prove path + // - what proof bytes the prove path emits + // + // Run once at bench setup so the matrix reflects the current + // optimization + dispatcher state without needing a separate + // integration test. + report_group_by_matrix(&fixture, platform_version); + + // Decoded display of every `group_by = []` proof: the path + // query that produced it (path, items, subquery) and the + // verified payload (root hash + count/elements). The path + // query is the prover-side spec and the verified payload is + // what `GroveDb::verify_query` / `verify_aggregate_count_query` + // reconstructs after walking the proof — together they make + // the proof's *meaning* legible without staring at hex. + display_proofs(&fixture, platform_version); + + // Decoded display of every `group_by` proof shape in the Count + // Index Group By Examples chapter (G3..G6). G1/G2 omitted — + // their bytes are identical to chapter 29's Q5/Q6. + display_group_by_proofs(&fixture, platform_version); + + // Empirical probe of the value-tree element type for the two + // single-property index terminators in the bench's contract + // (`byBrand` is just `countable`, `byColor` is `rangeCountable`). + // Surfaces the structural asymmetry that gates the + // rangeCountable optimization. + probe_value_tree_types(&fixture, platform_version); + + // Smoke test for grovedb PR #663's carrier-ACOR feature against + // this bench's widget fixture. Exercises the proof shape that + // would unblock chapter 30 G7 (`brand IN[...] AND color > floor` + // with `group_by = [brand]`) at the grovedb layer, before drive + // wires it through. + probe_carrier_acor(&fixture, platform_version); + + // Outer-Range carrier-ACOR feasibility probe — the natural + // extension of G7 from `outer In` to `outer Range`, with an + // explicit SizedQuery limit on the outer walk. Drive doesn't + // wire this through yet (mode_detection rejects 2 range clauses + // up front); this probe is a feasibility check at the grovedb + // layer. + probe_carrier_acor_range_outer(&fixture, platform_version); + + let mut group = c.benchmark_group("document_count_worst_case"); + group.sample_size(10); + group.throughput(criterion::Throughput::Elements(fixture.row_count)); + + group.bench_function("group_by_in_proof_100_count_tree_branches", |b| { + let raw_where = brand_in_where_value(brands.clone()); + b.iter_batched( + || { + count_request( + &fixture, + raw_where.clone(), + Value::Null, + CountMode::GroupByIn, + None, + true, + ) + }, + |request| match fixture + .drive + .execute_document_count_request(request, None, platform_version) + .expect("expected group_by In proof count request") + { + DocumentCountResponse::Proof(proof) => black_box(proof), + response => panic!("expected proof response, got {response:?}"), + }, + BatchSize::SmallInput, + ); + }); + + // Rangecountable-terminator variant of the In-grouped proof. The + // contract's `byColor` index is `rangeCountable: true`, so the + // covering value trees are themselves CountTrees and the + // point-lookup builder skips the `[0]` descent (see + // `point_lookup_count_path_query`'s "two terminator shapes" + // section). Pairs with `group_by_in_proof_100_count_tree_branches` + // (which targets the non-range_countable `byBrand` index) to + // surface the optimization's per-branch byte savings. + let colors = first_n_color_values(BRAND_COUNT); + group.bench_function("group_by_color_in_proof_100_rangecountable_branches", |b| { + let raw_where = color_in_where_value(colors.clone()); + b.iter_batched( + || { + count_request( + &fixture, + raw_where.clone(), + Value::Null, + CountMode::GroupByIn, + None, + true, + ) + }, + |request| match fixture + .drive + .execute_document_count_request(request, None, platform_version) + .expect("expected group_by color-In proof count request") + { + DocumentCountResponse::Proof(proof) => black_box(proof), + response => panic!("expected proof response, got {response:?}"), + }, + BatchSize::SmallInput, + ); + }); + + group.bench_function("aggregate_in_range_no_proof_100_range_counts", |b| { + let raw_where = in_and_range_where_value(brands.clone(), broad_range_floor.clone()); + b.iter_batched( + || { + count_request( + &fixture, + raw_where.clone(), + Value::Null, + CountMode::Aggregate, + None, + false, + ) + }, + |request| match fixture + .drive + .execute_document_count_request(request, None, platform_version) + .expect("expected aggregate In+range count request") + { + DocumentCountResponse::Aggregate(count) => black_box(count), + response => panic!("expected aggregate response, got {response:?}"), + }, + BatchSize::SmallInput, + ); + }); + + group.bench_function("group_by_compound_in_range_no_proof_limit_100", |b| { + let raw_where = in_and_range_where_value(brands.clone(), broad_range_floor.clone()); + b.iter_batched( + || { + count_request( + &fixture, + raw_where.clone(), + Value::Null, + CountMode::GroupByCompound, + Some(100), + false, + ) + }, + |request| match fixture + .drive + .execute_document_count_request(request, None, platform_version) + .expect("expected compound no-proof count request") + { + DocumentCountResponse::Entries(entries) => black_box(entries), + response => panic!("expected entries response, got {response:?}"), + }, + BatchSize::SmallInput, + ); + }); + + group.bench_function("group_by_compound_in_range_proof_limit_100", |b| { + let raw_where = in_and_range_where_value(brands.clone(), broad_range_floor.clone()); + b.iter_batched( + || { + count_request( + &fixture, + raw_where.clone(), + Value::Null, + CountMode::GroupByCompound, + Some(100), + true, + ) + }, + |request| match fixture + .drive + .execute_document_count_request(request, None, platform_version) + .expect("expected compound proof count request") + { + DocumentCountResponse::Proof(proof) => black_box(proof), + response => panic!("expected proof response, got {response:?}"), + }, + BatchSize::SmallInput, + ); + }); + + // Per-query timing for the 7 chapter queries (no group_by). Each + // case exercises the same proof shape documented in + // `book/src/drive/count-index-examples.md` so reviewers can quote + // wall-clock timings alongside the proof-size and complexity + // columns in the chapter's overview table. + let mid_brand = brand_label(BRAND_COUNT / 2); + let mid_color = color_label(color_count_for_rows(fixture.row_count) / 2); + let brands_2 = brands_n(2); + let colors_2 = first_n_color_values(2); + let clause = |field: &str, op: &str, value: Value| -> Value { + Value::Array(vec![ + Value::Text(field.to_string()), + Value::Text(op.to_string()), + value, + ]) + }; + + let chapter_queries: Vec<(&str, Value)> = vec![ + ("query_1_empty_total_count", Value::Null), + ( + "query_2_brand_eq", + Value::Array(vec![clause("brand", "==", Value::Text(mid_brand.clone()))]), + ), + ( + "query_3_color_eq", + Value::Array(vec![clause("color", "==", Value::Text(mid_color.clone()))]), + ), + ( + "query_4_brand_eq_and_color_eq", + Value::Array(vec![ + clause("brand", "==", Value::Text(mid_brand.clone())), + clause("color", "==", Value::Text(mid_color.clone())), + ]), + ), + ( + "query_5_brand_in_2", + Value::Array(vec![clause("brand", "in", Value::Array(brands_2.clone()))]), + ), + ( + "query_6_color_in_2", + Value::Array(vec![clause("color", "in", Value::Array(colors_2.clone()))]), + ), + ( + "query_7_color_gt_floor", + Value::Array(vec![clause("color", ">", broad_range_floor.clone())]), + ), + ( + "query_8_brand_eq_and_color_gt_floor", + Value::Array(vec![ + clause("brand", "==", Value::Text(mid_brand.clone())), + clause("color", ">", broad_range_floor.clone()), + ]), + ), + ]; + + for (name, raw_where) in chapter_queries { + group.bench_function(name, |b| { + b.iter_batched( + || { + count_request( + &fixture, + raw_where.clone(), + Value::Null, + CountMode::Aggregate, + None, + true, + ) + }, + |request| match fixture + .drive + .execute_document_count_request(request, None, platform_version) + .expect("expected proof response for chapter query") + { + DocumentCountResponse::Proof(proof) => black_box(proof), + response => panic!("expected proof response, got {response:?}"), + }, + BatchSize::SmallInput, + ); + }); + } + + // Per-query timing for the Count Index Group By Examples chapter + // (G1 through G6). Each case exercises one of the documented + // group_by shapes so the chapter's overview table can quote + // wall-clock timings alongside proof-size and complexity columns. + let brands_100 = brands_n(BRAND_COUNT); + let groupby_chapter_queries: Vec<(&str, Value, CountMode, Option)> = vec![ + ( + "query_g1_brand_in_grouped_by_brand", + Value::Array(vec![clause("brand", "in", Value::Array(brands_2.clone()))]), + CountMode::GroupByIn, + None, + ), + ( + "query_g2_color_in_grouped_by_color", + Value::Array(vec![clause("color", "in", Value::Array(colors_2.clone()))]), + CountMode::GroupByIn, + None, + ), + ( + "query_g3_brand_in_color_eq_grouped_by_brand", + Value::Array(vec![ + clause("brand", "in", Value::Array(brands_2.clone())), + clause("color", "==", Value::Text(mid_color.clone())), + ]), + CountMode::GroupByIn, + None, + ), + ( + "query_g4_color_gt_grouped_by_color", + Value::Array(vec![clause("color", ">", broad_range_floor.clone())]), + CountMode::GroupByRange, + None, + ), + ( + "query_g5_brand_in_color_gt_grouped_by_brand_color", + Value::Array(vec![ + clause("brand", "in", Value::Array(brands_2.clone())), + clause("color", ">", broad_range_floor.clone()), + ]), + CountMode::GroupByCompound, + None, + ), + ( + "query_g6_brand_in_100_grouped_by_brand", + Value::Array(vec![clause( + "brand", + "in", + Value::Array(brands_100.clone()), + )]), + CountMode::GroupByIn, + None, + ), + ( + "query_g7_brand_in_color_gt_grouped_by_brand", + Value::Array(vec![ + clause("brand", "in", Value::Array(brands_2.clone())), + clause("color", ">", broad_range_floor.clone()), + ]), + CountMode::GroupByIn, + None, + ), + ( + "query_g8_brand_gt_color_gt_grouped_by_brand", + Value::Array(vec![ + clause("brand", ">", Value::Text(brand_label(BRAND_COUNT / 2))), + clause("color", ">", broad_range_floor.clone()), + ]), + CountMode::GroupByRange, + // Range-outer carrier-aggregate enforces a fixed + // platform-wide outer-walk cap of + // `MAX_CARRIER_AGGREGATE_OUTER_RANGE_LIMIT` (10); the + // dispatcher rejects a caller-supplied `limit` on this + // shape, so pass `None` here. + None, + ), + ]; + + for (name, raw_where, mode, limit) in groupby_chapter_queries { + group.bench_function(name, |b| { + b.iter_batched( + || count_request(&fixture, raw_where.clone(), Value::Null, mode, limit, true), + |request| match fixture + .drive + .execute_document_count_request(request, None, platform_version) + .expect("expected proof response for group_by chapter query") + { + DocumentCountResponse::Proof(proof) => black_box(proof), + response => panic!("expected proof response, got {response:?}"), + }, + BatchSize::SmallInput, + ); + }); + } + + group.finish(); +} + +/// Run each proof-emitting shape once and print the resulting +/// `Vec` length. No timing — Criterion handles that — but byte +/// size is the actual win for the rangeCountable optimization, and +/// the only way to surface it from the same fixture without ad-hoc +/// instrumentation. +fn report_proof_sizes( + fixture: &CountBenchFixture, + brands: &[Value], + broad_range_floor: &Value, + platform_version: &PlatformVersion, +) { + let colors_100 = first_n_color_values(BRAND_COUNT); + let cases: [(&str, Value, Value, CountMode, Option); 3] = [ + // Non-rangeCountable `byBrand` In-grouped proof — control. + ( + "group_by_in_proof_100_count_tree_branches", + brand_in_where_value(brands.to_vec()), + Value::Null, + CountMode::GroupByIn, + None, + ), + // RangeCountable `byColor` In-grouped proof — the shape the + // optimization targets. Outer Keys resolve directly to the + // value-tree CountTrees (no `[0]` descent), so this proof is + // strictly smaller than the non-range_countable variant + // above on the same fixture. + ( + "group_by_color_in_proof_100_rangecountable_branches", + color_in_where_value(colors_100), + Value::Null, + CountMode::GroupByIn, + None, + ), + ( + "group_by_compound_in_range_proof_limit_100", + in_and_range_where_value(brands.to_vec(), broad_range_floor.clone()), + Value::Null, + CountMode::GroupByCompound, + Some(100), + ), + ]; + + for (name, raw_where, raw_order_by, mode, limit) in cases { + let request = count_request(fixture, raw_where, raw_order_by, mode, limit, true); + match fixture + .drive + .execute_document_count_request(request, None, platform_version) + .expect("expected proof response for proof-size report") + { + DocumentCountResponse::Proof(proof) => { + eprintln!( + "[proof-size] rows={} {}: {} bytes", + fixture.row_count, + name, + proof.len() + ); + } + other => panic!("expected Proof response for {name}, got {other:?}"), + } + } +} + +/// Run every `(group_by × where_shape)` combination of interest +/// through the drive count dispatcher and report whether each works +/// on the no-proof and prove paths. +/// +/// **Drive vs. platform layer.** This is the drive-level dispatcher +/// (`Drive::execute_document_count_request`); the platform-level +/// handler (`drive-abci::query_documents_v1` → +/// `validate_and_route`) layers additional validation on top +/// (HAVING rejection; the `group_by` field-name vs `In`/range +/// where-clause alignment check; per-mode `limit` rejection). +/// Where the platform layer rejects a combination the drive layer +/// would technically accept, that's flagged in the `[matrix]` +/// output's annotations so the table the user sees reflects the +/// full request lifecycle. +/// +/// Output is `[matrix] {key} = {result}` lines so callers can grep +/// them out of the bench's stderr stream. +fn report_group_by_matrix(fixture: &CountBenchFixture, platform_version: &PlatformVersion) { + let brands_2: Vec = brands_n(2); + let colors_2: Vec = first_n_color_values(2); + let mid_brand = brand_label(BRAND_COUNT / 2); + let mid_color = color_label(color_count_for_rows(fixture.row_count) / 2); + let range_floor = Value::Text(fixture.range_floor.clone()); + + // Compact builder for where-clause `Value::Array`s. Each inner + // array is `[field, op, value]` — the wire shape the drive + // dispatcher parses via `parse_count_where_value`. + let clause = |field: &str, op: &str, value: Value| -> Value { + Value::Array(vec![ + Value::Text(field.to_string()), + Value::Text(op.to_string()), + value, + ]) + }; + let where_empty = || Value::Null; + let where_brand_in = + || Value::Array(vec![clause("brand", "in", Value::Array(brands_2.clone()))]); + let where_color_in = + || Value::Array(vec![clause("color", "in", Value::Array(colors_2.clone()))]); + let where_brand_eq = + || Value::Array(vec![clause("brand", "==", Value::Text(mid_brand.clone()))]); + let where_color_eq = + || Value::Array(vec![clause("color", "==", Value::Text(mid_color.clone()))]); + let where_brand_eq_color_eq = || { + Value::Array(vec![ + clause("brand", "==", Value::Text(mid_brand.clone())), + clause("color", "==", Value::Text(mid_color.clone())), + ]) + }; + let where_color_gt = || Value::Array(vec![clause("color", ">", range_floor.clone())]); + let where_brand_in_color_gt = || { + Value::Array(vec![ + clause("brand", "in", Value::Array(brands_2.clone())), + clause("color", ">", range_floor.clone()), + ]) + }; + let where_brand_in_color_eq = || { + Value::Array(vec![ + clause("brand", "in", Value::Array(brands_2.clone())), + clause("color", "==", Value::Text(mid_color.clone())), + ]) + }; + let where_brand_eq_color_gt = || { + Value::Array(vec![ + clause("brand", "==", Value::Text(mid_brand.clone())), + clause("color", ">", range_floor.clone()), + ]) + }; + let brand_floor = Value::Text(brand_label(BRAND_COUNT / 2)); + let where_brand_gt_color_gt = || { + Value::Array(vec![ + clause("brand", ">", brand_floor.clone()), + clause("color", ">", range_floor.clone()), + ]) + }; + + // (label, group_by-as-the-caller-would-spell-it, where description, + // raw where Value, CountMode used by drive, limit override, + // platform-allowed annotation). + // + // `platform_allowed` is the verdict from `validate_and_route` (the + // platform-layer handler in `drive-abci`); annotated here from + // direct reading of `dispatch_count_v1` since the bench can't + // import drive-abci. Verified against the existing v1 handler + // tests in `packages/rs-drive-abci/src/query/document_query/v1/tests.rs` + // (the `reject_*` / `accept_*_routes_to_*` family). + struct MatrixCase { + label: &'static str, + platform_allowed: &'static str, + raw_where: Value, + mode: CountMode, + limit: Option, + } + + let cases: Vec = vec![ + // ── group_by = [] (Aggregate) ────────────────────────────── + MatrixCase { + label: "[] / where=(empty)", + platform_allowed: "yes (documentsCountable fast path)", + raw_where: where_empty(), + mode: CountMode::Aggregate, + limit: None, + }, + MatrixCase { + label: "[] / where=brand==X", + platform_allowed: "yes", + raw_where: where_brand_eq(), + mode: CountMode::Aggregate, + limit: None, + }, + MatrixCase { + label: "[] / where=color==X", + platform_allowed: "yes", + raw_where: where_color_eq(), + mode: CountMode::Aggregate, + limit: None, + }, + MatrixCase { + label: "[] / where=brand==X AND color==Y", + platform_allowed: "yes", + raw_where: where_brand_eq_color_eq(), + mode: CountMode::Aggregate, + limit: None, + }, + MatrixCase { + label: "[] / where=brand IN[2]", + platform_allowed: "yes (per-In aggregate fan-out)", + raw_where: where_brand_in(), + mode: CountMode::Aggregate, + limit: None, + }, + MatrixCase { + label: "[] / where=color IN[2]", + platform_allowed: "yes (per-In aggregate fan-out)", + raw_where: where_color_in(), + mode: CountMode::Aggregate, + limit: None, + }, + MatrixCase { + label: "[] / where=color > floor", + platform_allowed: "yes (AggregateCountOnRange)", + raw_where: where_color_gt(), + mode: CountMode::Aggregate, + limit: None, + }, + MatrixCase { + label: "[] / where=brand==X AND color > floor", + platform_allowed: "yes (AggregateCountOnRange on byBrandColor terminator)", + raw_where: where_brand_eq_color_gt(), + mode: CountMode::Aggregate, + limit: None, + }, + MatrixCase { + label: "[] / where=brand IN[2] AND color > floor", + platform_allowed: "no-proof: yes / prove: no (aggregate proof can't fork)", + raw_where: where_brand_in_color_gt(), + mode: CountMode::Aggregate, + limit: None, + }, + // ── group_by = [color] (single-field) ────────────────────── + MatrixCase { + label: "[color] / where=color IN[2]", + platform_allowed: "yes (GroupByIn)", + raw_where: where_color_in(), + mode: CountMode::GroupByIn, + limit: None, + }, + MatrixCase { + label: "[color] / where=color > floor", + platform_allowed: "yes (GroupByRange — distinct-range walk)", + raw_where: where_color_gt(), + mode: CountMode::GroupByRange, + limit: None, + }, + MatrixCase { + label: "[color] / where=color==X", + platform_allowed: "no — `color` is constrained by `==`, not `In` or range", + raw_where: where_color_eq(), + mode: CountMode::GroupByIn, + limit: None, + }, + MatrixCase { + label: "[color] / where=brand IN[2] AND color > floor", + platform_allowed: "no — single-field GROUP BY with both `In` and range", + raw_where: where_brand_in_color_gt(), + mode: CountMode::GroupByRange, + limit: None, + }, + // ── group_by = [brand] (single-field) ────────────────────── + MatrixCase { + label: "[brand] / where=brand IN[2]", + platform_allowed: "yes (GroupByIn — non-rangeCountable byBrand)", + raw_where: where_brand_in(), + mode: CountMode::GroupByIn, + limit: None, + }, + MatrixCase { + label: "[brand] / where=brand IN[2] AND color==Y", + platform_allowed: "yes (GroupByIn — compound covers byBrandColor)", + raw_where: where_brand_in_color_eq(), + mode: CountMode::GroupByIn, + limit: None, + }, + MatrixCase { + label: "[brand] / where=brand IN[2] AND color > floor", + platform_allowed: "yes (RangeAggregateCarrierProof — carrier ACOR per In branch)", + raw_where: where_brand_in_color_gt(), + mode: CountMode::GroupByIn, + limit: None, + }, + MatrixCase { + label: "[brand] / where=brand > floor AND color > floor", + platform_allowed: + "yes (RangeAggregateCarrierProof — carrier ACOR; platform-max outer limit = 10)", + raw_where: where_brand_gt_color_gt(), + mode: CountMode::GroupByRange, + limit: None, + }, + MatrixCase { + label: "[brand] / where=brand==X", + platform_allowed: "no — `brand` is `==`, not `In` or range", + raw_where: where_brand_eq(), + mode: CountMode::GroupByIn, + limit: None, + }, + // ── group_by = [brand, color] (two-field compound) ───────── + MatrixCase { + label: "[brand, color] / where=brand IN[2] AND color > floor", + platform_allowed: "yes (GroupByCompound — `(In, range)` shape)", + raw_where: where_brand_in_color_gt(), + mode: CountMode::GroupByCompound, + limit: Some(100), + }, + MatrixCase { + label: "[brand, color] / where=brand IN[2] AND color==Y", + platform_allowed: "no — `color` must be range, not `==`", + raw_where: where_brand_in_color_eq(), + mode: CountMode::GroupByCompound, + limit: Some(100), + }, + // ── group_by = [color, brand] (reversed compound) ────────── + MatrixCase { + label: "[color, brand] / where=color IN[2] AND brand > X", + platform_allowed: "no — no rangeCountable index has `brand` as terminator", + // brand > X would need a covering rangeCountable index + // with brand as the terminator. The contract has none, so + // the picker errors at drive level too. + raw_where: Value::Array(vec![ + clause("color", "in", Value::Array(colors_2.clone())), + clause("brand", ">", Value::Text(mid_brand.clone())), + ]), + mode: CountMode::GroupByCompound, + limit: Some(100), + }, + ]; + + for case in &cases { + let noproof_result = drive_count_outcome( + fixture, + case.raw_where.clone(), + case.mode, + case.limit, + false, + platform_version, + ); + let prove_result = drive_count_outcome( + fixture, + case.raw_where.clone(), + case.mode, + case.limit, + true, + platform_version, + ); + eprintln!( + "[matrix] {label}\n no-proof: {np}\n prove: {pr}\n platform: {pa}", + label = case.label, + np = noproof_result, + pr = prove_result, + pa = case.platform_allowed, + ); + } +} + +/// Dump the actual grovedb proof bytes (hex) for every +/// `group_by = []` (Aggregate) prove case. Each proof's byte layout +/// is determined by which grovedb primitive the drive dispatcher +/// routes to: +/// +/// - `(empty)` → primary-key CountTree proof at the doctype's `[0]` +/// child (`documentsCountable: true` fast path; the proof is +/// merk-path to a single CountTree element). +/// - `field == X` → `point_lookup_count_path_query` against the +/// covering countable index; the proof is a merk-path to either +/// `[..., last_value, 0]` (normal countable) or `[..., last_value]` +/// (rangeCountable, post-optimization). +/// - `field IN [...]` → same `point_lookup_count_path_query` shape +/// but with one outer `Key` per In value, so the proof carries +/// one merk-path per resolved branch. +/// - `range_field > floor` → `aggregate_count_path_query` against +/// the rangeCountable terminator's property-name `ProvableCountTree`; +/// the proof is an `AggregateCountOnRange` primitive that signs +/// a single u64. +/// +/// Hex is emitted 64 hex chars per line (32 bytes per row) so the +/// output is grep-able and the rows align with merk-tree node +/// boundaries on most layouts. +/// Probe what's *actually* stored at `widget/brand/brand_050` and at +/// `widget/color/color_00000500` so a reviewer can confirm by reading +/// the live fixture which element types the two indexes produce. +/// +/// This is the empirical answer to "why can't `byBrand` use the same +/// `path=[..., "brand"], Key("brand_050")` shape as `byColor`?". The +/// shape only works when the resolved element is itself a count-bearing +/// tree — for byBrand (just `countable`, not `rangeCountable`) the +/// value tree is `Element::Tree` (a `NormalTree`), and +/// `NormalTree::count_value_or_default()` returns `1`, not the doc +/// count. The optimization is structurally gated on the index's +/// `range_countable` flag for this exact reason. +fn probe_value_tree_types(fixture: &CountBenchFixture, _platform_version: &PlatformVersion) { + use drive::drive::RootTree; + use grovedb_path::SubtreePath; + + let contract_id = fixture.data_contract.id().to_buffer(); + let cases: [(&'static str, &'static str, &'static str); 2] = [ + ("byBrand", "brand", "brand_050"), + ("byColor", "color", "color_00000500"), + ]; + let grove_version = &PlatformVersion::latest().drive.grove_version; + + for (label, prop, val) in cases { + let parent: Vec<&[u8]> = vec![ + &[RootTree::DataContractDocuments as u8], + &contract_id, + &[1u8], + DOCUMENT_TYPE_NAME.as_bytes(), + prop.as_bytes(), + ]; + let key = val.as_bytes(); + match fixture + .drive + .grove + .get(SubtreePath::from(parent.as_slice()), key, None, grove_version) + .unwrap() + { + Ok(elem) => eprintln!( + "[probe] {label}: widget/{prop}/{val} → {} {{ count_value_or_default: {}, debug: {:?} }}", + element_variant_name(&elem), + elem.count_value_or_default(), + elem + ), + Err(e) => eprintln!("[probe] {label}: widget/{prop}/{val} → grove.get error: {e:?}"), + } + } + + // Probe the CHILDREN of each value tree to see how each one + // contributes to the parent's count_value_or_default. The + // byBrand value tree has children: + // - `[0]` (the ref-bucket CountTree where byBrand's + // references live) + // - `color` (the byBrandColor continuation's property-name + // tree) + // Are either of them wrapped in `Element::NonCounted(_)`? That + // determines whether a hypothetical "value tree is always a + // CountTree" rule would yield the correct count. + let child_probes: [(&'static str, &'static str, &'static str, &'static [u8]); 4] = [ + ("byBrand /[0] ref-bucket", "brand", "brand_050", &[0u8]), + ( + "byBrand /color continuation", + "brand", + "brand_050", + b"color", + ), + ("byColor /[0] ref-bucket", "color", "color_00000500", &[0u8]), + ( + "byColor /brand continuation", + "color", + "color_00000500", + b"brand", + ), + ]; + for (label, prop, val, child) in child_probes { + let parent_owned: Vec> = vec![ + vec![RootTree::DataContractDocuments as u8], + contract_id.to_vec(), + vec![1u8], + DOCUMENT_TYPE_NAME.as_bytes().to_vec(), + prop.as_bytes().to_vec(), + val.as_bytes().to_vec(), + ]; + let parent_refs: Vec<&[u8]> = parent_owned.iter().map(|v| v.as_slice()).collect(); + match fixture + .drive + .grove + .get( + SubtreePath::from(parent_refs.as_slice()), + child, + None, + grove_version, + ) + .unwrap() + { + Ok(elem) => eprintln!( + "[probe-child] {label} (child_key={}): {} {{ count_value_or_default: {}, debug: {:?} }}", + display_segment(child), + element_variant_name(&elem), + elem.count_value_or_default(), + elem + ), + Err(e) => eprintln!( + "[probe-child] {label} (child_key={}): grove.get error: {e:?}", + display_segment(child) + ), + } + } +} + +/// Smoke test for the carrier-ACOR feature shipped in +/// [grovedb PR #663](https://github.com/dashpay/grovedb/pull/663). +/// +/// Exercises the new `Query::set_subquery(Query::new_aggregate_count_on_range(...))` +/// composition against this bench's widget fixture: builds a `PathQuery` rooted +/// at `widget/brand` with two outer `In` keys (brand_000 + brand_001) and an +/// `AggregateCountOnRange` subquery on each brand's `color` subtree +/// (`color > "color_00000500"`). +/// +/// This is the proof shape that would unblock chapter 30 G7 — `brand IN[...] AND +/// color > floor` grouped by `[brand]` — once drive wires it through. The probe +/// runs three separate operations against grovedb to confirm round-trip parity: +/// +/// 1. **No-proof:** `query_aggregate_count_per_key` reads the raw counts. +/// 2. **Prove:** `prove_query` emits the carrier proof bytes. +/// 3. **Verify:** `verify_aggregate_count_query_per_key` reconstructs the +/// counts from the proof and confirms the root hash matches the parent +/// grovedb state. +/// +/// Expected payload for this fixture (1 doc per `(brand, color)` pair, 1 000 +/// colors per brand, range `color > "color_00000500"`): +/// +/// ```text +/// [("brand_000", 499), ("brand_001", 499)] +/// ``` +/// +/// Printed under `[carrier-acor]` so reviewers can grep deterministically. +fn probe_carrier_acor(fixture: &CountBenchFixture, platform_version: &PlatformVersion) { + use dpp::data_contract::document_type::methods::DocumentTypeV0Methods; + use drive::drive::RootTree; + use grovedb::{Query, QueryItem, SizedQuery}; + + let grove_version = &platform_version.drive.grove_version; + let contract_id = fixture.data_contract.id().to_buffer(); + let document_type = fixture + .data_contract + .document_type_for_name(DOCUMENT_TYPE_NAME) + .expect("widget doc type"); + + // Serialize the In keys (brand_000, brand_001) the same way drive's + // index machinery would so the keys round-trip against the on-disk + // byBrand subtree. + let brand_keys: Vec> = (0..2) + .map(|i| { + document_type + .serialize_value_for_key("brand", &Value::Text(brand_label(i)), platform_version) + .expect("expected to serialize brand") + }) + .collect(); + + // Serialize the range floor (color_00000500) for the inner ACOR item. + let range_floor_key = document_type + .serialize_value_for_key( + "color", + &Value::Text(fixture.range_floor.clone()), + platform_version, + ) + .expect("expected to serialize range floor"); + + // Build the carrier query — outer Keys for the brands, subquery_path + // descending into each brand's `color` subtree, subquery as the + // ACOR over `color > range_floor`. Insert via `insert_key` so the + // multi-key walker sees the keys in lex-ascending order (grovedb + // PR #663's invariant). + let mut carrier: Query = Query::new(); + for k in &brand_keys { + carrier.insert_key(k.clone()); + } + carrier.set_subquery_path(vec![b"color".to_vec()]); + carrier.set_subquery(Query::new_aggregate_count_on_range(QueryItem::RangeAfter( + range_floor_key.., + ))); + + let path: Vec> = vec![ + vec![RootTree::DataContractDocuments as u8], + contract_id.to_vec(), + vec![1u8], + DOCUMENT_TYPE_NAME.as_bytes().to_vec(), + b"brand".to_vec(), + ]; + let path_query = PathQuery::new(path, SizedQuery::new(carrier, None, None)); + + eprintln!( + "[carrier-acor] probing: widget/brand IN [brand_000, brand_001] subquery_path=color subquery=AggregateCountOnRange(RangeAfter(color_00000500..))" + ); + + // 1. No-proof: raw query. + match fixture + .drive + .grove + .query_aggregate_count_per_key(&path_query, None, grove_version) + .unwrap() + { + Ok(entries) => { + eprintln!("[carrier-acor] no-proof entries ({}):", entries.len()); + for (k, c) in &entries { + eprintln!("[carrier-acor] ({}, {})", display_segment(k), c); + } + } + Err(e) => eprintln!("[carrier-acor] no-proof error: {e:?}"), + } + + // 2. Prove: get the carrier-ACOR proof bytes. + let proof = match fixture + .drive + .grove + .prove_query(&path_query, None, grove_version) + .unwrap() + { + Ok(p) => { + eprintln!("[carrier-acor] proof bytes: {} B", p.len()); + p + } + Err(e) => { + eprintln!("[carrier-acor] prove_query error: {e:?}"); + return; + } + }; + + // 3. Verify the proof and confirm we get the same per-key counts back. + match GroveDb::verify_aggregate_count_query_per_key(&proof, &path_query, grove_version) { + Ok((root, entries)) => { + eprintln!("[carrier-acor] verified root_hash: 0x{}", hex_bytes(&root)); + eprintln!("[carrier-acor] verified entries ({}):", entries.len()); + for (k, c) in &entries { + eprintln!("[carrier-acor] ({}, {})", display_segment(k), c); + } + } + Err(e) => eprintln!("[carrier-acor] verify error: {e:?}"), + } +} + +/// Companion to [`probe_carrier_acor`] that exercises the +/// *outer-Range* variant of grovedb's carrier-ACOR feature +/// ([PR #663](https://github.com/dashpay/grovedb/pull/663)'s +/// `validate_carrier_aggregate_count_accepts_range_outer_items`). +/// +/// Constructs a carrier PathQuery whose outer dimension walks a +/// **range** of In-property values (brand `> "brand_050"`) capped +/// at 20 results, with the same per-brand ACOR subquery over +/// `color > "color_00000500"`. Prints the per-brand aggregate +/// counts under `[carrier-acor-range]` so reviewers can grep +/// deterministically. +/// +/// Expected output for this fixture (1 doc per `(brand, color)` +/// pair, 100 brands, 1 000 colors per brand, limit 20): +/// 20 entries for `brand_051` … `brand_070`, each carrying +/// `count = 499` (every brand has 499 colors `> "color_00000500"`). +/// +/// This is the proof shape that would unblock "Q8 with a range +/// outer + ACOR inner, limit 20" — the natural extension of G7 +/// from `outer In` to `outer Range`. Drive doesn't wire this +/// through yet; this probe is a feasibility check against the +/// existing grovedb plumbing. +fn probe_carrier_acor_range_outer(fixture: &CountBenchFixture, platform_version: &PlatformVersion) { + use dpp::data_contract::document_type::methods::DocumentTypeV0Methods; + use drive::drive::RootTree; + use grovedb::{Query, QueryItem, SizedQuery}; + + let grove_version = &platform_version.drive.grove_version; + let contract_id = fixture.data_contract.id().to_buffer(); + let document_type = fixture + .data_contract + .document_type_for_name(DOCUMENT_TYPE_NAME) + .expect("widget doc type"); + + // Serialize the range floor for the OUTER dimension (brand > "brand_050"). + let brand_floor_key = document_type + .serialize_value_for_key( + "brand", + &Value::Text(brand_label(BRAND_COUNT / 2)), + platform_version, + ) + .expect("expected to serialize outer brand floor"); + // Serialize the range floor for the INNER ACOR (color > "color_00000500"). + let color_floor_key = document_type + .serialize_value_for_key( + "color", + &Value::Text(fixture.range_floor.clone()), + platform_version, + ) + .expect("expected to serialize inner color floor"); + + let mut carrier: Query = Query::new(); + carrier + .items + .push(QueryItem::RangeAfter(brand_floor_key.clone()..)); + carrier.set_subquery_path(vec![b"color".to_vec()]); + carrier.set_subquery(Query::new_aggregate_count_on_range(QueryItem::RangeAfter( + color_floor_key.., + ))); + + let path: Vec> = vec![ + vec![RootTree::DataContractDocuments as u8], + contract_id.to_vec(), + vec![1u8], + DOCUMENT_TYPE_NAME.as_bytes().to_vec(), + b"brand".to_vec(), + ]; + // `SizedQuery::limit` on carrier-ACOR is now permitted per + // [grovedb PR #664](https://github.com/dashpay/grovedb/pull/664) + // (the follow-up to PR #663 that split the leaf-strict vs + // carrier-permissive validators on `SizedQuery::limit` / + // `SizedQuery::offset`). The limit caps the number of outer-key + // matches the carrier walks — each matched outer key still + // produces a complete leaf-ACOR `u64`. The probe matches the + // platform-wide cap defined at + // `MAX_CARRIER_AGGREGATE_OUTER_RANGE_LIMIT` (10), which the drive + // dispatcher enforces on the G8 shape. + let outer_limit: u16 = 10; + let path_query = PathQuery::new(path, SizedQuery::new(carrier, Some(outer_limit), None)); + + eprintln!( + "[carrier-acor-range] probing: widget/brand RangeAfter(brand_050..) limit={outer_limit} \ + subquery_path=color subquery=AggregateCountOnRange(RangeAfter(color_00000500..))" + ); + + // 1. No-proof. + match fixture + .drive + .grove + .query_aggregate_count_per_key(&path_query, None, grove_version) + .unwrap() + { + Ok(entries) => { + eprintln!("[carrier-acor-range] no-proof entries ({}):", entries.len()); + for (k, c) in &entries { + eprintln!("[carrier-acor-range] ({}, {})", display_segment(k), c); + } + } + Err(e) => eprintln!("[carrier-acor-range] no-proof error: {e:?}"), + } + + // 2. Prove. + let proof = match fixture + .drive + .grove + .prove_query(&path_query, None, grove_version) + .unwrap() + { + Ok(p) => { + eprintln!("[carrier-acor-range] proof bytes: {} B", p.len()); + p + } + Err(e) => { + eprintln!("[carrier-acor-range] prove_query error: {e:?}"); + return; + } + }; + + // 3. Verify. + match GroveDb::verify_aggregate_count_query_per_key(&proof, &path_query, grove_version) { + Ok((root, entries)) => { + eprintln!( + "[carrier-acor-range] verified root_hash: 0x{}", + hex_bytes(&root) + ); + eprintln!("[carrier-acor-range] verified entries ({}):", entries.len()); + for (k, c) in &entries { + eprintln!("[carrier-acor-range] ({}, {})", display_segment(k), c); + } + } + Err(e) => eprintln!("[carrier-acor-range] verify error: {e:?}"), + } +} + +fn element_variant_name(e: &grovedb::Element) -> &'static str { + use grovedb::Element; + match e { + Element::CountTree(_, _, _) => "CountTree", + Element::ProvableCountTree(_, _, _) => "ProvableCountTree", + Element::SumTree(_, _, _) => "SumTree", + Element::CountSumTree(_, _, _, _) => "CountSumTree", + Element::ProvableCountSumTree(_, _, _, _) => "ProvableCountSumTree", + Element::Tree(_, _) => "Tree (NormalTree)", + Element::Item(_, _) => "Item", + Element::Reference(_, _, _) => "Reference", + _ => "(other-variant)", + } +} + +/// Decoded display of every `group_by = []` proof shape. +/// +/// For each case, this: +/// 1. Re-runs the drive dispatcher to get the proof bytes. +/// 2. Reconstructs the **same `PathQuery`** the prover used (by +/// calling the matching builder on `DriveDocumentCountQuery` — +/// the single source of truth shared by prover + verifier). +/// 3. Runs the appropriate grovedb verifier +/// (`verify_query` for point-lookup / primary-key proofs, +/// `verify_aggregate_count_query` for the range-aggregate +/// primitive) and prints the verified payload. +/// +/// The output is structured so a reader can correlate each +/// proof's size with the path-query shape AND the merk elements +/// the proof signs, without parsing raw merk-proof bytes. +fn display_proofs(fixture: &CountBenchFixture, platform_version: &PlatformVersion) { + let document_type = fixture + .data_contract + .document_type_for_name(DOCUMENT_TYPE_NAME) + .expect("widget doc type"); + let contract_id = fixture.data_contract.id().to_buffer(); + let brands_2 = brands_n(2); + let colors_2 = first_n_color_values(2); + let mid_brand = brand_label(BRAND_COUNT / 2); + let mid_color = color_label(color_count_for_rows(fixture.row_count) / 2); + let range_floor = Value::Text(fixture.range_floor.clone()); + + // Helper: wire-shaped where Value the dispatcher CBOR-decodes. + let clause = |field: &str, op: &str, value: Value| -> Value { + Value::Array(vec![ + Value::Text(field.to_string()), + Value::Text(op.to_string()), + value, + ]) + }; + + // Each case carries: + // - `label`: how it appears in the table + // - `raw_where`: wire-shaped where value passed to the dispatcher + // - `structured`: structured WhereClauses the verifier-side path + // query builder consumes (mirrors what `parse_count_where_value` + // would produce on the dispatcher side) + // - `shape`: which verifier primitive applies + enum Shape { + PrimaryKey, + PointLookup, + AggregateRange, + } + + struct DisplayCase { + label: &'static str, + raw_where: Value, + structured: Vec, + shape: Shape, + } + + let cases: Vec = vec![ + DisplayCase { + label: "[] / where=(empty)", + raw_where: Value::Null, + structured: vec![], + shape: Shape::PrimaryKey, + }, + DisplayCase { + label: "[] / where=brand==X", + raw_where: Value::Array(vec![clause("brand", "==", Value::Text(mid_brand.clone()))]), + structured: vec![WhereClause { + field: "brand".to_string(), + operator: WhereOperator::Equal, + value: Value::Text(mid_brand.clone()), + }], + shape: Shape::PointLookup, + }, + DisplayCase { + label: "[] / where=color==X", + raw_where: Value::Array(vec![clause("color", "==", Value::Text(mid_color.clone()))]), + structured: vec![WhereClause { + field: "color".to_string(), + operator: WhereOperator::Equal, + value: Value::Text(mid_color.clone()), + }], + shape: Shape::PointLookup, + }, + DisplayCase { + label: "[] / where=brand==X AND color==Y", + raw_where: Value::Array(vec![ + clause("brand", "==", Value::Text(mid_brand.clone())), + clause("color", "==", Value::Text(mid_color.clone())), + ]), + structured: vec![ + WhereClause { + field: "brand".to_string(), + operator: WhereOperator::Equal, + value: Value::Text(mid_brand.clone()), + }, + WhereClause { + field: "color".to_string(), + operator: WhereOperator::Equal, + value: Value::Text(mid_color.clone()), + }, + ], + shape: Shape::PointLookup, + }, + DisplayCase { + label: "[] / where=brand IN[2]", + raw_where: Value::Array(vec![clause("brand", "in", Value::Array(brands_2.clone()))]), + structured: vec![WhereClause { + field: "brand".to_string(), + operator: WhereOperator::In, + value: Value::Array(brands_2.clone()), + }], + shape: Shape::PointLookup, + }, + DisplayCase { + label: "[] / where=color IN[2]", + raw_where: Value::Array(vec![clause("color", "in", Value::Array(colors_2.clone()))]), + structured: vec![WhereClause { + field: "color".to_string(), + operator: WhereOperator::In, + value: Value::Array(colors_2.clone()), + }], + shape: Shape::PointLookup, + }, + DisplayCase { + label: "[] / where=color > floor", + raw_where: Value::Array(vec![clause("color", ">", range_floor.clone())]), + structured: vec![WhereClause { + field: "color".to_string(), + operator: WhereOperator::GreaterThan, + value: range_floor.clone(), + }], + shape: Shape::AggregateRange, + }, + DisplayCase { + label: "[] / where=brand==X AND color > floor", + raw_where: Value::Array(vec![ + clause("brand", "==", Value::Text(mid_brand.clone())), + clause("color", ">", range_floor.clone()), + ]), + structured: vec![ + WhereClause { + field: "brand".to_string(), + operator: WhereOperator::Equal, + value: Value::Text(mid_brand.clone()), + }, + WhereClause { + field: "color".to_string(), + operator: WhereOperator::GreaterThan, + value: range_floor.clone(), + }, + ], + shape: Shape::AggregateRange, + }, + ]; + + for case in cases { + // 1. Get proof bytes via the drive dispatcher (the same code + // path the bench measures). + let request = count_request( + fixture, + case.raw_where, + Value::Null, + CountMode::Aggregate, + None, + true, + ); + let proof = + match fixture + .drive + .execute_document_count_request(request, None, platform_version) + { + Ok(DocumentCountResponse::Proof(p)) => p, + other => { + eprintln!( + "[proof] {label} → unexpected non-Proof response: {other:?}", + label = case.label + ); + continue; + } + }; + + // 2. Reconstruct the path query the prover used so we can + // verify with the same spec. + let path_query: PathQuery = match case.shape { + Shape::PrimaryKey => DriveDocumentCountQuery::primary_key_count_tree_path_query( + contract_id, + DOCUMENT_TYPE_NAME, + ), + Shape::PointLookup => { + let index = DriveDocumentCountQuery::find_countable_index_for_where_clauses( + document_type.indexes(), + &case.structured, + ) + .expect("countable picker must find a covering index for the display case"); + let query = DriveDocumentCountQuery { + document_type, + contract_id, + document_type_name: DOCUMENT_TYPE_NAME.to_string(), + index, + where_clauses: case.structured.clone(), + }; + query + .point_lookup_count_path_query(platform_version) + .expect("point-lookup builder must accept the display case's shape") + } + Shape::AggregateRange => { + let index = DriveDocumentCountQuery::find_range_countable_index_for_where_clauses( + document_type.indexes(), + &case.structured, + ) + .expect("range_countable picker must find a covering index"); + let query = DriveDocumentCountQuery { + document_type, + contract_id, + document_type_name: DOCUMENT_TYPE_NAME.to_string(), + index, + where_clauses: case.structured.clone(), + }; + query + .aggregate_count_path_query(platform_version) + .expect("aggregate-range builder must accept the display case's shape") + } + }; + + eprintln!( + "[proof] {label} ({sz} bytes)", + label = case.label, + sz = proof.len() + ); + + // 3. Print the path-query spec. + eprintln!("[proof] path:"); + for seg in &path_query.path { + eprintln!("[proof] {}", display_segment(seg)); + } + eprintln!( + "[proof] query items: {}", + display_query_items(&path_query.query.query.items) + ); + let sb = &path_query.query.query.default_subquery_branch; + if let Some(sqp) = sb.subquery_path.as_ref() { + let pretty: Vec = sqp.iter().map(|s| display_segment(s)).collect(); + eprintln!("[proof] subquery_path: [{}]", pretty.join(", ")); + } + if let Some(sq) = sb.subquery.as_ref() { + eprintln!( + "[proof] subquery items: {}", + display_query_items(&sq.items) + ); + } + + // 4. Verify + print the structured payload. + match case.shape { + Shape::AggregateRange => { + match GroveDb::verify_aggregate_count_query( + &proof, + &path_query, + &platform_version.drive.grove_version, + ) { + Ok((root, count)) => { + eprintln!("[proof] verified:"); + eprintln!("[proof] root_hash: 0x{}", hex_bytes(&root)); + eprintln!("[proof] count: {count}"); + } + Err(e) => eprintln!("[proof] verify error: {e:?}"), + } + } + Shape::PrimaryKey | Shape::PointLookup => { + match GroveDb::verify_query( + &proof, + &path_query, + &platform_version.drive.grove_version, + ) { + Ok((root, elements)) => { + eprintln!("[proof] verified:"); + eprintln!("[proof] root_hash: 0x{}", hex_bytes(&root)); + eprintln!("[proof] elements ({}):", elements.len()); + for (path, key, elem) in elements { + let path_pretty: Vec = + path.iter().map(|s| display_segment(s)).collect(); + eprintln!("[proof] path: [{}]", path_pretty.join(", ")); + eprintln!("[proof] key: {}", display_segment(&key)); + eprintln!("[proof] element: {}", display_element(elem.as_ref())); + } + } + Err(e) => eprintln!("[proof] verify error: {e:?}"), + } + } + } + + // 5. Decode the proof bytes into the structured + // `GroveDBProof` AST and print its Display — the same + // rendering dash-evo-tool's "JSON" Proof Log mode uses + // (see `src/ui/tools/proof_log_screen.rs` for the + // reference implementation). This view shows the layered + // merk-proof structure inside the bytes — each layer's + // merk ops (Push/Parent/Child + hashes) plus the + // lower-layers map to descend into. The bincode config + // must match what grovedb's PathQuery proofs are + // serialized with on the wire (big-endian, no length + // limit) or `decode_from_slice` returns `Err`. + let bincode_config = bincode::config::standard() + .with_big_endian() + .with_no_limit(); + match bincode::decode_from_slice::(&proof, bincode_config) { + Ok((grovedb_proof, _)) => { + eprintln!("[proof] proof-display:"); + for line in format!("{}", grovedb_proof).lines() { + eprintln!("[proof] {line}"); + } + } + Err(e) => eprintln!("[proof] proof-display decode error: {e:?}"), + } + } +} + +/// Companion to `display_proofs` for the Count Index Group By +/// Examples chapter (G1..G6). Captures the structured proof bytes +/// the dispatcher emits for each `group_by` shape, decodes them +/// through `GroveDBProof::Display`, and tags the output with a +/// `[gproof]` prefix so the chapter's regex extraction stays +/// unambiguous. +/// +/// G1 and G2 are intentionally omitted: their proof bytes are +/// byte-identical to chapter 29's Q5 / Q6 (a property the dispatcher +/// preserves because `CountMode::GroupByIn` over a single `In` clause +/// resolves to the same `point_lookup_count_path_query` as +/// `CountMode::Aggregate` does — the SDK just zips the elements with +/// the In values instead of summing). The chapter references the +/// existing Q5 / Q6 displays rather than emitting duplicate bytes. +fn display_group_by_proofs(fixture: &CountBenchFixture, platform_version: &PlatformVersion) { + let mid_brand = brand_label(BRAND_COUNT / 2); + let mid_color = color_label(color_count_for_rows(fixture.row_count) / 2); + let brands_2 = brands_n(2); + let brands_100 = brands_n(BRAND_COUNT); + let range_floor = Value::Text(fixture.range_floor.clone()); + + let clause = |field: &str, op: &str, value: Value| -> Value { + Value::Array(vec![ + Value::Text(field.to_string()), + Value::Text(op.to_string()), + value, + ]) + }; + + let cases: Vec<(&str, Value, CountMode, Option)> = vec![ + ( + "G3 [brand] / where=brand IN[2] AND color==Y", + Value::Array(vec![ + clause("brand", "in", Value::Array(brands_2.clone())), + clause("color", "==", Value::Text(mid_color.clone())), + ]), + CountMode::GroupByIn, + None, + ), + ( + "G4 [color] / where=color > floor", + Value::Array(vec![clause("color", ">", range_floor.clone())]), + CountMode::GroupByRange, + None, + ), + ( + "G5 [brand, color] / where=brand IN[2] AND color > floor", + Value::Array(vec![ + clause("brand", "in", Value::Array(brands_2.clone())), + clause("color", ">", range_floor.clone()), + ]), + CountMode::GroupByCompound, + None, + ), + ( + "G6 [brand] / where=brand IN[100]", + Value::Array(vec![clause( + "brand", + "in", + Value::Array(brands_100.clone()), + )]), + CountMode::GroupByIn, + None, + ), + ( + "G7 [brand] / where=brand IN[2] AND color > floor", + Value::Array(vec![ + clause("brand", "in", Value::Array(brands_2.clone())), + clause("color", ">", range_floor.clone()), + ]), + CountMode::GroupByIn, + None, + ), + ( + "G8 [brand] / where=brand > floor AND color > floor", + Value::Array(vec![ + clause("brand", ">", Value::Text(brand_label(BRAND_COUNT / 2))), + clause("color", ">", range_floor.clone()), + ]), + CountMode::GroupByRange, + None, + ), + ]; + + let _ = mid_brand; + let bincode_config = bincode::config::standard() + .with_big_endian() + .with_no_limit(); + + for (label, raw_where, mode, limit) in cases { + let request = count_request(fixture, raw_where, Value::Null, mode, limit, true); + let proof = + match fixture + .drive + .execute_document_count_request(request, None, platform_version) + { + Ok(DocumentCountResponse::Proof(p)) => p, + other => { + eprintln!("[gproof] {label} → unexpected non-Proof response: {other:?}"); + continue; + } + }; + + eprintln!("[gproof] {label} ({sz} bytes)", sz = proof.len()); + + match bincode::decode_from_slice::(&proof, bincode_config) { + Ok((grovedb_proof, _)) => { + eprintln!("[gproof] proof-display:"); + for line in format!("{grovedb_proof}").lines() { + eprintln!("[gproof] {line}"); + } + } + Err(e) => eprintln!("[gproof] proof-display decode error: {e:?}"), + } + } +} + +/// Pretty-print a path or key segment: quoted UTF-8 if printable +/// ASCII, hex otherwise. Long byte strings are truncated with a +/// length suffix so the output stays scannable. +fn display_segment(bytes: &[u8]) -> String { + if let Ok(s) = std::str::from_utf8(bytes) { + if !s.is_empty() && s.chars().all(|c| c.is_ascii_graphic() || c == ' ') { + return format!("{:?}", s); + } + } + if bytes.is_empty() { + return "(empty)".to_string(); + } + if bytes.len() <= 16 { + return format!("0x{}", hex_bytes(bytes)); + } + let prefix = hex_bytes(&bytes[..8]); + format!("0x{prefix}...({} bytes)", bytes.len()) +} + +/// Pretty-print a `Vec` showing each `Key`/`Range` etc. +/// with byte segments decoded the same way as `display_segment`. +fn display_query_items(items: &[grovedb::QueryItem]) -> String { + use grovedb::QueryItem; + let pieces: Vec = items + .iter() + .map(|item| match item { + QueryItem::Key(k) => format!("Key({})", display_segment(k)), + QueryItem::Range(r) => format!( + "Range({}..{})", + display_segment(&r.start), + display_segment(&r.end) + ), + QueryItem::RangeInclusive(r) => format!( + "RangeInclusive({}..={})", + display_segment(r.start()), + display_segment(r.end()) + ), + QueryItem::RangeFull(_) => "RangeFull(..)".to_string(), + QueryItem::RangeFrom(r) => format!("RangeFrom({}..)", display_segment(&r.start)), + QueryItem::RangeTo(r) => format!("RangeTo(..{})", display_segment(&r.end)), + QueryItem::RangeToInclusive(r) => { + format!("RangeToInclusive(..={})", display_segment(&r.end)) + } + QueryItem::RangeAfter(r) => format!("RangeAfter({}..)", display_segment(&r.start)), + QueryItem::RangeAfterTo(r) => format!( + "RangeAfterTo({}..{})", + display_segment(&r.start), + display_segment(&r.end) + ), + QueryItem::RangeAfterToInclusive(r) => format!( + "RangeAfterToInclusive({}..={})", + display_segment(r.start()), + display_segment(r.end()) + ), + QueryItem::AggregateCountOnRange(inner) => format!( + "AggregateCountOnRange({})", + display_query_items(std::slice::from_ref(inner)) + ), + }) + .collect(); + format!("[{}]", pieces.join(", ")) +} + +/// Pretty-print a verified grovedb `Element`. +/// +/// Distinguishes every count-bearing variant explicitly +/// (`CountTree` / `ProvableCountTree` / `CountSumTree` / +/// `ProvableCountSumTree` / `SumTree`) so a reader can tell which +/// tree shape signed the count without re-inspecting the bench +/// fixture's `primary_key_tree_type` plumbing. Also emits the +/// element's full `Debug` representation under `[proof] debug:` +/// so the variant tag (e.g. `CountTree(None, 100000, None)` vs. +/// `ProvableCountTree(None, 100000, None)`) is unambiguous on +/// inspection — the variant choice drives whether the parent +/// `ProvableCountTree`/`CountTree` boundary signs the count and +/// matters for which verifier primitive applies upstream. +fn display_element(elem: Option<&grovedb::Element>) -> String { + use grovedb::Element; + match elem { + None => "None (absent)".to_string(), + Some(e) => { + let count = e.count_value_or_default(); + let kind = match e { + Element::CountTree(_, _, _) => "CountTree", + Element::ProvableCountTree(_, _, _) => "ProvableCountTree", + Element::SumTree(_, _, _) => "SumTree", + Element::CountSumTree(_, _, _, _) => "CountSumTree", + Element::ProvableCountSumTree(_, _, _, _) => "ProvableCountSumTree", + Element::Tree(_, _) => "Tree", + Element::Item(_, _) => "Item", + Element::Reference(_, _, _) => "Reference", + _ => "(other-variant)", + }; + format!( + "{kind} {{ count_value_or_default: {count}, debug: {:?} }}", + e + ) + } + } +} + +/// Compact hex helper used by `display_segment` / `display_proofs`. +fn hex_bytes(bytes: &[u8]) -> String { + bytes.iter().map(|b| format!("{:02x}", b)).collect() +} + +/// Convenience helper for the matrix runner: run one count request +/// through the drive dispatcher and format the outcome as a short +/// string (success → describing the response shape and size; error +/// → the truncated error message). Keeps `report_group_by_matrix`'s +/// per-case body readable. +fn drive_count_outcome( + fixture: &CountBenchFixture, + raw_where: Value, + mode: CountMode, + limit: Option, + prove: bool, + platform_version: &PlatformVersion, +) -> String { + let request = count_request(fixture, raw_where, Value::Null, mode, limit, prove); + match fixture + .drive + .execute_document_count_request(request, None, platform_version) + { + Ok(DocumentCountResponse::Aggregate(c)) => format!("Aggregate({c})"), + Ok(DocumentCountResponse::Entries(entries)) => { + let summed: u64 = entries.iter().filter_map(|e| e.count).sum(); + format!("Entries(len={}, sum={})", entries.len(), summed) + } + Ok(DocumentCountResponse::Proof(p)) => format!("Proof({} bytes)", p.len()), + Err(e) => { + let msg = e.to_string(); + // Truncate to keep the matrix readable; the operator + // gist is preserved. + let trimmed = msg + .lines() + .next() + .unwrap_or(&msg) + .chars() + .take(120) + .collect::(); + format!("Err({trimmed})") + } + } +} + +/// First N brands by label — convenience for matrix cases that need +/// a small In array (2-3 brands) rather than the full 100 used by +/// the criterion benches. +fn brands_n(n: u64) -> Vec { + (0..n).map(|b| Value::Text(brand_label(b))).collect() +} + +fn count_request<'a>( + fixture: &'a CountBenchFixture, + raw_where_value: Value, + raw_order_by_value: Value, + mode: CountMode, + limit: Option, + prove: bool, +) -> DocumentCountRequest<'a> { + let document_type = fixture + .data_contract + .document_type_for_name(DOCUMENT_TYPE_NAME) + .expect("expected widget document type"); + + DocumentCountRequest { + contract: &fixture.data_contract, + document_type, + raw_where_value, + raw_order_by_value, + mode, + limit, + prove, + drive_config: &fixture.drive_config, + } +} + +fn brand_in_where_value(brands: Vec) -> Value { + Value::Array(vec![Value::Array(vec![ + Value::Text("brand".to_string()), + Value::Text("in".to_string()), + Value::Array(brands), + ])]) +} + +fn color_in_where_value(colors: Vec) -> Value { + Value::Array(vec![Value::Array(vec![ + Value::Text("color".to_string()), + Value::Text("in".to_string()), + Value::Array(colors), + ])]) +} + +/// First N colors in lex order — same naming convention as +/// `populate_fixture` (`color_NNNNNNNN`), which guarantees these +/// values exist in the fixture so the proof actually resolves +/// 100 present branches (not absent ones, which would be omitted +/// from the proof's emitted-elements stream and shrink the proof +/// trivially). +fn first_n_color_values(n: u64) -> Vec { + (0..n) + .map(|color| Value::Text(color_label(color))) + .collect() +} + +fn in_and_range_where_value(brands: Vec, range_floor: Value) -> Value { + Value::Array(vec![ + Value::Array(vec![ + Value::Text("brand".to_string()), + Value::Text("in".to_string()), + Value::Array(brands), + ]), + Value::Array(vec![ + Value::Text("color".to_string()), + Value::Text(">".to_string()), + range_floor, + ]), + ]) +} + +fn all_brand_values() -> Vec { + (0..BRAND_COUNT) + .map(|brand| Value::Text(brand_label(brand))) + .collect() +} + +fn brand_label(brand: u64) -> String { + format!("brand_{brand:03}") +} + +fn color_label(color: u64) -> String { + format!("color_{color:08}") +} + +fn color_count_for_rows(row_count: u64) -> u64 { + row_count.div_ceil(BRAND_COUNT).max(1) +} + +fn document_id(row: u64) -> [u8; 32] { + let mut id = [0u8; 32]; + let document_number = row + 1; + id[..8].copy_from_slice(&document_number.to_be_bytes()); + id[8..16].copy_from_slice(&(!document_number).to_be_bytes()); + id +} + +fn row_count() -> u64 { + env_u64("DASH_PLATFORM_COUNT_BENCH_ROWS").unwrap_or(DEFAULT_ROW_COUNT) +} + +fn batch_size() -> u64 { + env_u64("DASH_PLATFORM_COUNT_BENCH_BATCH_SIZE").unwrap_or(DEFAULT_BATCH_SIZE) +} + +fn env_u64(name: &str) -> Option { + env::var(name) + .ok() + .map(|value| { + value + .parse::() + .unwrap_or_else(|_| panic!("{name} must be a positive integer, got {value}")) + }) + .filter(|value| *value > 0) +} + +fn env_flag(name: &str) -> bool { + matches!(env::var(name).as_deref(), Ok("1") | Ok("true") | Ok("TRUE")) +} + +fn fixture_path(row_count: u64) -> PathBuf { + if let Ok(path) = env::var("DASH_PLATFORM_COUNT_BENCH_DB") { + return PathBuf::from(path); + } + + env::temp_dir().join(format!( + "dash-platform-document-count-bench-v{FIXTURE_SCHEMA_VERSION}-rows-{row_count}" + )) +} + +fn fixture_marker(row_count: u64) -> String { + format!("schema_version={FIXTURE_SCHEMA_VERSION}\nrows={row_count}\nbrands={BRAND_COUNT}\n") +} + +criterion_group!(count_query_worst_cases, document_count_worst_case); +criterion_main!(count_query_worst_cases); diff --git a/packages/rs-drive/src/drive/contract/insert/insert_contract/v0/mod.rs b/packages/rs-drive/src/drive/contract/insert/insert_contract/v0/mod.rs index f9ce615801d..cf55b2c65c4 100644 --- a/packages/rs-drive/src/drive/contract/insert/insert_contract/v0/mod.rs +++ b/packages/rs-drive/src/drive/contract/insert/insert_contract/v0/mod.rs @@ -1583,7 +1583,8 @@ mod range_countable_index_e2e_tests { assert_eq!(summed.len(), 1); assert!(summed[0].key.is_empty(), "summed entry has empty key"); assert_eq!( - summed[0].count, 5, + summed[0].count, + Some(5), "color > 'blue' should sum to 3 (green) + 2 (red) = 5" ); @@ -1604,9 +1605,9 @@ mod range_countable_index_e2e_tests { .expect("range count should succeed"); assert_eq!(split.len(), 2); assert_eq!(split[0].key, b"green".to_vec()); - assert_eq!(split[0].count, 3); + assert_eq!(split[0].count, Some(3)); assert_eq!(split[1].key, b"red".to_vec()); - assert_eq!(split[1].count, 2); + assert_eq!(split[1].count, Some(2)); // distinct=true with limit=1: only the first entry. let limited = query @@ -1762,9 +1763,9 @@ mod range_countable_index_e2e_tests { .expect("range count should succeed"); assert_eq!(split.len(), 2); assert_eq!(split[0].key, b"bbb".to_vec()); - assert_eq!(split[0].count, 1); + assert_eq!(split[0].count, Some(1)); assert_eq!(split[1].key, b"ccc".to_vec()); - assert_eq!(split[1].count, 1); + assert_eq!(split[1].count, Some(1)); } /// `execute_aggregate_count_with_proof` should produce a grovedb @@ -2030,13 +2031,13 @@ mod range_countable_index_e2e_tests { ); assert_eq!(split[0].in_key.as_deref(), Some(b"acme".as_slice())); assert_eq!(split[0].key, b"red".to_vec()); - assert_eq!(split[0].count, 3); + assert_eq!(split[0].count, Some(3)); assert_eq!(split[1].in_key.as_deref(), Some(b"contoso".as_slice())); assert_eq!(split[1].key, b"green".to_vec()); - assert_eq!(split[1].count, 1); + assert_eq!(split[1].count, Some(1)); assert_eq!(split[2].in_key.as_deref(), Some(b"contoso".as_slice())); assert_eq!(split[2].key, b"red".to_vec()); - assert_eq!(split[2].count, 2); + assert_eq!(split[2].count, Some(2)); // Client-side merge over `key` recovers the flat histogram: // green: 1 @@ -2045,7 +2046,7 @@ mod range_countable_index_e2e_tests { split .iter() .fold(std::collections::BTreeMap::new(), |mut m, e| { - *m.entry(e.key.clone()).or_insert(0) += e.count; + *m.entry(e.key.clone()).or_insert(0) += e.count.unwrap_or(0); m }); assert_eq!(merged.get(b"green".as_slice()), Some(&1)); @@ -2070,7 +2071,7 @@ mod range_countable_index_e2e_tests { "summed mode always emits a single in_key=None, key=empty entry" ); assert!(summed[0].key.is_empty()); - assert_eq!(summed[0].count, 6); + assert_eq!(summed[0].count, Some(6)); } /// `StartsWith "r"` is encoded as `Range(serialize("r").. @@ -2174,7 +2175,8 @@ mod range_countable_index_e2e_tests { assert_eq!(summed.len(), 1, "summed mode → one entry"); assert!(summed[0].key.is_empty(), "summed entry has empty key"); assert_eq!( - summed[0].count, 6, + summed[0].count, + Some(6), "color startsWith 'r' should sum to 2 (red) + 3 (rose) + 1 (ruby) = 6" ); @@ -2198,11 +2200,11 @@ mod range_countable_index_e2e_tests { "distinct mode → one entry per matching color" ); assert_eq!(split[0].key, b"red".to_vec()); - assert_eq!(split[0].count, 2); + assert_eq!(split[0].count, Some(2)); assert_eq!(split[1].key, b"rose".to_vec()); - assert_eq!(split[1].count, 3); + assert_eq!(split[1].count, Some(3)); assert_eq!(split[2].key, b"ruby".to_vec()); - assert_eq!(split[2].count, 1); + assert_eq!(split[2].count, Some(1)); // Mode 3: prove aggregate. Verifies via // `GroveDb::verify_aggregate_count_query` against the path @@ -2321,7 +2323,8 @@ mod range_countable_index_e2e_tests { .expect("empty startsWith prefix should succeed (matches empty-string sentinel only)"); assert_eq!(result.len(), 1, "summed mode → one entry"); assert_eq!( - result[0].count, 0, + result[0].count, + Some(0), "no docs have color = empty-string sentinel" ); } @@ -3192,9 +3195,11 @@ mod range_countable_index_e2e_tests { expected_letter ); assert_eq!( - entry.count, expected_count, + entry.count, + Some(expected_count), "lot '{}' should have {} cars", - expected_letter, expected_count + expected_letter, + expected_count ); } @@ -3202,7 +3207,7 @@ mod range_countable_index_e2e_tests { // aggregate (348). Different code path, same answer — the // distinct walk and the merk-level aggregate are obligated // to agree. - let total: u64 = entries.iter().map(|e| e.count).sum(); + let total: u64 = entries.iter().map(|e| e.count.unwrap_or(0)).sum(); assert_eq!( total, 348, "sum of per-lot counts must equal the aggregate (3+4+...+26 = 348)" @@ -3950,7 +3955,7 @@ mod range_countable_index_e2e_tests { document_type, raw_where_value: where_clause_value, raw_order_by_value: dpp::platform_value::Value::Null, - return_distinct_counts_in_range: true, + mode: crate::query::CountMode::GroupByRange, limit: Some(too_large), prove: true, drive_config: &drive_config, diff --git a/packages/rs-drive/src/drive/document/insert/add_indices_for_index_level_for_contract_operations/mod.rs b/packages/rs-drive/src/drive/document/insert/add_indices_for_index_level_for_contract_operations/mod.rs index f991021d422..b5887735dac 100644 --- a/packages/rs-drive/src/drive/document/insert/add_indices_for_index_level_for_contract_operations/mod.rs +++ b/packages/rs-drive/src/drive/document/insert/add_indices_for_index_level_for_contract_operations/mod.rs @@ -19,9 +19,12 @@ use std::collections::HashMap; impl Drive { /// Adds indices for an index level and recurses. /// - /// `parent_value_tree_is_range_countable` reflects whether the value - /// tree at `index_path_info` is a `CountTree`. See the v0 doc for why - /// this matters for `Element::NonCounted` wrapping. + /// `parent_value_tree_is_count_tree` reflects whether the value tree + /// at `index_path_info` is a `CountTree` (because the IndexLevel that + /// produced it is a countable terminator). See the v0 doc for the + /// full Element::NonCounted-wrapping rationale and the + /// `countable.is_countable()` gating that distinguishes terminators + /// from pure prefix levels. #[allow(clippy::too_many_arguments)] pub(crate) fn add_indices_for_index_level_for_contract_operations( &self, @@ -30,7 +33,7 @@ impl Drive { index_level: &IndexLevel, any_fields_null: bool, all_fields_null: bool, - parent_value_tree_is_range_countable: bool, + parent_value_tree_is_count_tree: bool, previous_batch_operations: &mut Option<&mut Vec>, storage_flags: &Option<&StorageFlags>, estimated_costs_only_with_layer_info: &mut Option< @@ -54,7 +57,7 @@ impl Drive { index_level, any_fields_null, all_fields_null, - parent_value_tree_is_range_countable, + parent_value_tree_is_count_tree, previous_batch_operations, storage_flags, estimated_costs_only_with_layer_info, diff --git a/packages/rs-drive/src/drive/document/insert/add_indices_for_index_level_for_contract_operations/v0/mod.rs b/packages/rs-drive/src/drive/document/insert/add_indices_for_index_level_for_contract_operations/v0/mod.rs index 32325bccaca..4d366635928 100644 --- a/packages/rs-drive/src/drive/document/insert/add_indices_for_index_level_for_contract_operations/v0/mod.rs +++ b/packages/rs-drive/src/drive/document/insert/add_indices_for_index_level_for_contract_operations/v0/mod.rs @@ -20,9 +20,10 @@ use std::collections::HashMap; impl Drive { /// Adds indices for an index level and recurses. /// - /// `parent_value_tree_is_range_countable` reflects whether the value tree - /// at `index_path_info` is a `CountTree` (because the IndexLevel that - /// produced it is a range-countable terminator). When true, every + /// `parent_value_tree_is_count_tree` reflects whether the value tree at + /// `index_path_info` is a `CountTree` (because the `IndexLevel` that + /// produced it is a countable terminator — i.e. `index.countable` is + /// `Countable` or `CountableAllowingOffset`). When true, every /// continuation property-name tree we insert here as a child of that /// `CountTree` is wrapped with `Element::NonCounted` so its storage /// stays addressable but it contributes 0 to the parent count's @@ -30,6 +31,28 @@ impl Drive { /// `NormalTree` child) — or worse, their own count_value (a /// `ProvableCountTree` child in nested-range_countable layouts) — and /// double-count documents. + /// + /// ## Why "countable" gates the value-tree type, not "range_countable" + /// + /// The value tree's purpose is to carry a per-value doc count for fast + /// point-lookup count proofs (no need to descend one more layer to a + /// `[0]`-child CountTree). That benefit applies to **every** countable + /// terminator — `range_countable: true` is only needed to *also* upgrade + /// the property-name tree to `ProvableCountTree` for + /// `AggregateCountOnRange` queries. Gating the value tree on + /// `countable.is_countable()` rather than `range_countable` lets + /// plain-countable indexes (e.g. `byBrand`) emit the same compact + /// point-lookup proof shape as rangeCountable ones, without paying the + /// `ProvableCountTree` cost at the property-name level. + /// + /// Continuation wrapping under the new rule: when the parent value tree + /// is a `CountTree` (now true for every countable terminator, not just + /// rangeCountable), every child continuation property-name tree gets + /// `Element::NonCounted`-wrapped so the parent's count_value equals + /// exactly the doc count from the `[0]` ref-bucket. Without the wrap, + /// each continuation would contribute its own `count_value_or_default` + /// (1 for `NormalTree`, > 0 for `ProvableCountTree`) and the parent + /// would over-count. #[inline] #[allow(clippy::too_many_arguments)] pub(super) fn add_indices_for_index_level_for_contract_operations_v0( @@ -39,7 +62,7 @@ impl Drive { index_level: &IndexLevel, mut any_fields_null: bool, mut all_fields_null: bool, - parent_value_tree_is_range_countable: bool, + parent_value_tree_is_count_tree: bool, previous_batch_operations: &mut Option<&mut Vec>, storage_flags: &Option<&StorageFlags>, estimated_costs_only_with_layer_info: &mut Option< @@ -71,9 +94,9 @@ impl Drive { let sub_level_index_count = index_level.sub_levels().len() as u32; // The current level (the value tree at index_path_info) is a CountTree - // when `parent_value_tree_is_range_countable`; otherwise NormalTree. + // when `parent_value_tree_is_count_tree`; otherwise NormalTree. // This shows up in the layer info for the layer we're walking through. - let current_layer_tree_type = if parent_value_tree_is_range_countable { + let current_layer_tree_type = if parent_value_tree_is_count_tree { TreeType::CountTree } else { TreeType::NormalTree @@ -97,8 +120,26 @@ impl Drive { // fourth we need to store a reference to the document for each index for (name, sub_level) in index_level.sub_levels() { - let sub_level_range_countable = sub_level - .has_index_with_type() + // Two separate flags, deliberately kept distinct: + // + // - `sub_level_is_countable_terminator`: the sub_level has an + // index AND that index is countable (any tier). Drives the + // value-tree type and the NonCounted wrapping decision. + // Pure prefix levels (no index at this sub_level) leave this + // `false` so their value trees stay `NormalTree` — there's + // nothing to count at a prefix-only level. + // - `sub_level_range_countable`: a stronger flag — the sub_level + // is countable AND opts into range-aggregate support. Drives + // the property-name tree's upgrade from `NormalTree` to + // `ProvableCountTree` (the type `AggregateCountOnRange` walks + // over). Implied by `sub_level_is_countable_terminator` per + // `Index::range_countable`'s docstring: `range_countable: true` + // requires `countable: Countable | CountableAllowingOffset`. + let sub_level_index_info = sub_level.has_index_with_type(); + let sub_level_is_countable_terminator = sub_level_index_info + .map(|info| info.countable.is_countable()) + .unwrap_or(false); + let sub_level_range_countable = sub_level_index_info .map(|info| info.range_countable) .unwrap_or(false); @@ -106,6 +147,8 @@ impl Drive { // index sub_level is a range_countable terminator we need a // `ProvableCountTree` so range queries over the property's // distinct values can use grovedb's `AggregateCountOnRange`. + // Plain countable terminators keep `NormalTree` — they don't + // need the per-node count aggregation for range support. let property_name_tree_type = if sub_level_range_countable { TreeType::ProvableCountTree } else { @@ -114,10 +157,22 @@ impl Drive { // The value tree (one per distinct property value, hosting the // `[0]` reference subtree + sibling continuations) becomes a - // `CountTree` when its sub_level is range_countable, so the - // parent property-name `ProvableCountTree`'s aggregate sums - // per-value counts cleanly. - let value_tree_type = if sub_level_range_countable { + // `CountTree` at any countable terminator — not just + // `range_countable` ones. This shortens the point-lookup count + // proof by one merk layer per resolved branch (the `[0]` child + // doesn't need to be descended; the value tree's own + // `count_value_or_default()` IS the per-branch doc count, with + // sibling continuations wrapped `NonCounted` to keep the count + // honest — see `wrap_property_name_tree_non_counted` below). + // + // For non-terminator (pure prefix) levels — e.g. `brand` in a + // contract that has only `[brand, color]` and no standalone + // `[brand]` index — `sub_level_is_countable_terminator` is + // `false` and the value tree stays `NormalTree`. There's + // nothing to count at a prefix level, and the brand-value + // walks descend into the `color` sub-level which then carries + // its own (potentially count-flavored) tree. + let value_tree_type = if sub_level_is_countable_terminator { TreeType::CountTree } else { TreeType::NormalTree @@ -128,7 +183,7 @@ impl Drive { // CountTree. NonCounted-wrapping is independent of // `property_name_tree_type` — it only affects the *parent's* // count aggregation, not the wrapped element's internals. - let wrap_property_name_tree_non_counted = parent_value_tree_is_range_countable; + let wrap_property_name_tree_non_counted = parent_value_tree_is_count_tree; let property_name_apply_type = if estimated_costs_only_with_layer_info.is_none() { BatchInsertTreeApplyType::StatefulBatchInsertTree @@ -253,13 +308,20 @@ impl Drive { sub_level_index_path_info.push(document_index_field)?; // Iteration 1. the index path is now something likeDataContracts/ContractID/Documents(1)/$ownerId//toUserId// // Iteration 2. the index path is now something likeDataContracts/ContractID/Documents(1)/$ownerId//toUserId//accountReference/ + // Propagate the new `parent_value_tree_is_count_tree` flag + // forward — it tracks whether the value tree we just wrote + // (the one the sub-level will recurse INTO) is a `CountTree`. + // That's now driven by `sub_level_is_countable_terminator` + // (any countable tier), not just `range_countable`. Drives + // the next level's continuation `NonCounted`-wrapping + // decision. self.add_indices_for_index_level_for_contract_operations_v0( document_and_contract_info, sub_level_index_path_info, sub_level, any_fields_null, all_fields_null, - sub_level_range_countable, + sub_level_is_countable_terminator, previous_batch_operations, storage_flags, estimated_costs_only_with_layer_info, diff --git a/packages/rs-drive/src/drive/document/insert/add_indices_for_top_index_level_for_contract_operations/v0/mod.rs b/packages/rs-drive/src/drive/document/insert/add_indices_for_top_index_level_for_contract_operations/v0/mod.rs index 2e03e90b3d0..495b836828f 100644 --- a/packages/rs-drive/src/drive/document/insert/add_indices_for_top_index_level_for_contract_operations/v0/mod.rs +++ b/packages/rs-drive/src/drive/document/insert/add_indices_for_top_index_level_for_contract_operations/v0/mod.rs @@ -89,13 +89,31 @@ impl Drive { // next we need to store a reference to the document for each index for (name, sub_level) in index_level.sub_levels() { - // If `sub_level` terminates a `range_countable` index, the - // top-level property-name tree (created at contract setup) is a - // `ProvableCountTree` and each value tree under it must be a - // `CountTree` so the parent's aggregate sums per-value counts - // cleanly. Otherwise both stay `NormalTree`. - let sub_level_range_countable = sub_level - .has_index_with_type() + // Two flags split on the same `sub_level.has_index_with_type()` + // result: + // + // - `sub_level_is_countable_terminator` — sub_level has any + // countable index. Drives the value-tree type: each value + // tree becomes a `CountTree` whose `count_value_or_default()` + // IS the per-value doc count. This is what shrinks the + // point-lookup count proof by one merk layer (no `[0]` + // descent needed; see + // `point_lookup_count_path_query`'s rangeCountable-shape + // docstring). + // - `sub_level_range_countable` — sub_level opts into + // `AggregateCountOnRange`. Drives the property-name tree's + // upgrade from `NormalTree` to `ProvableCountTree`. Implies + // `is_countable` per the invariant on `Index::range_countable`. + // + // Pure prefix sub-levels (no index here, only further nesting) + // leave both flags `false` — both property-name and value tree + // stay `NormalTree`, since there's no count surface to + // materialize at a prefix level. + let sub_level_index_info = sub_level.has_index_with_type(); + let sub_level_is_countable_terminator = sub_level_index_info + .map(|info| info.countable.is_countable()) + .unwrap_or(false); + let sub_level_range_countable = sub_level_index_info .map(|info| info.range_countable) .unwrap_or(false); let property_name_tree_type = if sub_level_range_countable { @@ -103,7 +121,7 @@ impl Drive { } else { TreeType::NormalTree }; - let value_tree_type = if sub_level_range_countable { + let value_tree_type = if sub_level_is_countable_terminator { TreeType::CountTree } else { TreeType::NormalTree @@ -203,13 +221,18 @@ impl Drive { index_path_info.push(document_top_field)?; // the index path is now something likeDataContracts/ContractID/Documents(1)/$ownerId/ + // Propagate `parent_value_tree_is_count_tree` to the recursive + // level: the value tree we just inserted at the top level + // becomes a `CountTree` iff its sub_level terminates a + // countable index. The recursive level uses this to decide + // whether to NonCounted-wrap its own continuation children. self.add_indices_for_index_level_for_contract_operations( document_and_contract_info, index_path_info, sub_level, any_fields_null, all_fields_null, - sub_level_range_countable, + sub_level_is_countable_terminator, previous_batch_operations, &storage_flags, estimated_costs_only_with_layer_info, diff --git a/packages/rs-drive/src/error/query.rs b/packages/rs-drive/src/error/query.rs index 1166638edb4..4f292067d55 100644 --- a/packages/rs-drive/src/error/query.rs +++ b/packages/rs-drive/src/error/query.rs @@ -77,7 +77,7 @@ pub enum QuerySyntaxError { InvalidParameter(String), /// Query invalid format for where clause error #[error("query invalid format for where clause error: {0}")] - InvalidFormatWhereClause(&'static str), + InvalidFormatWhereClause(String), /// Conflicting conditions error #[error("conflicting conditions error: {0}")] diff --git a/packages/rs-drive/src/query/drive_document_count_query/drive_dispatcher.rs b/packages/rs-drive/src/query/drive_document_count_query/drive_dispatcher.rs index a558eaa6be7..aecfc68a460 100644 --- a/packages/rs-drive/src/query/drive_document_count_query/drive_dispatcher.rs +++ b/packages/rs-drive/src/query/drive_document_count_query/drive_dispatcher.rs @@ -1,27 +1,21 @@ -//! Drive-level dispatcher for the unified `GetDocumentsCount` request. +//! Top-level dispatcher for the unified `GetDocumentsCount` request. //! -//! Two layers live here: +//! Owns the whole pipeline: CBOR-decode → mode detection → +//! per-mode executor (see [`super::executors`]) → response +//! wrapping. The drive-abci handler builds a +//! [`DocumentCountRequest`] and calls +//! [`Drive::execute_document_count_request`]; everything past +//! contract lookup lives in drive. //! -//! 1. **Per-mode `impl Drive` executors** — `execute_document_count_*` -//! methods that pick a covering index for their specific mode and -//! run the matching `DriveDocumentCountQuery::*` executor. Each -//! one collapses index-picking + executor invocation into a single -//! call so the dispatcher's match arms stay one line per mode. +//! Both `DocumentCountRequest` and `DocumentCountResponse` are +//! the ABI for this dispatcher — they're public so drive-abci can +//! name the input/output types without reaching into the +//! executor surface. //! -//! 2. **Top-level `execute_document_count_request`** that owns the -//! whole pipeline: mode detection → per-mode executor → response -//! wrapping. The drive-abci handler just builds a -//! [`DocumentCountRequest`] and calls this; everything past CBOR -//! decode + contract lookup lives in drive. -//! -//! Both `DocumentCountRequest` and `DocumentCountResponse` are the -//! abi for this dispatcher; they're public so drive-abci can name -//! the input/output types without reaching into the executor surface. -//! -//! Whole module is gated `feature = "server"` via the parent's +//! Module is gated `feature = "server"` via the parent's //! `pub mod drive_dispatcher;` declaration. -use super::super::conditions::{WhereClause, WhereOperator}; +use super::super::conditions::WhereClause; use super::super::ordering::OrderClause; use super::execute_range_count::RangeCountOptions; use super::{DocumentCountMode, DriveDocumentCountQuery, SplitCountEntry}; @@ -33,452 +27,12 @@ use dpp::data_contract::document_type::DocumentTypeRef; use dpp::version::PlatformVersion; use grovedb::TransactionArg; -impl Drive { - //! Per-mode count-query executors. Each method: - //! 1. Picks the right covering index for its mode (returns - //! `Error::Query(QuerySyntaxError::WhereClauseOnNonIndexedProperty)` - //! if no index covers the where clauses). - //! 2. Builds the appropriate `DriveDocumentCountQuery` / - //! `DriveDocumentQuery`. - //! 3. Runs the right executor (`execute_no_proof`, - //! `execute_range_count_no_proof`, - //! `execute_aggregate_count_with_proof`, or - //! `execute_with_proof`). - //! 4. Returns either `Vec` (no-proof modes) - //! or `Vec` proof bytes (proof modes). - //! - //! Each per-mode executor is its own narrow contract — splitting - //! along mode boundaries keeps the dispatcher arms one line each - //! and lets each executor's index-picking + clause-handling logic - //! stay close to the executor it feeds. - - /// Total count for the given where clauses against an exactly- - /// covering countable index, OR — when the where clauses are - /// empty and the document type has `documents_countable: true` — - /// the type's primary-key CountTree (O(1) read at the doctype - /// tree's root). - /// - /// Single summed entry with empty key. Used by - /// [`DocumentCountMode::Total`] dispatch. - pub fn execute_document_count_total_no_proof( - &self, - contract_id: [u8; 32], - document_type: DocumentTypeRef, - document_type_name: String, - where_clauses: Vec, - transaction: TransactionArg, - platform_version: &PlatformVersion, - ) -> Result, Error> { - use dpp::data_contract::document_type::accessors::{ - DocumentTypeV0Getters, DocumentTypeV2Getters, - }; - - // Fast path: unfiltered total count on a `documents_countable: - // true` document type reads the primary-key CountTree directly - // (O(1)). No index needed — the doctype tree itself carries - // the count. - if where_clauses.is_empty() && document_type.documents_countable() { - let count = self.read_primary_key_count_tree( - &contract_id, - &document_type_name, - transaction, - platform_version, - )?; - return Ok(vec![SplitCountEntry { - in_key: None, - key: vec![], - count, - }]); - } - - let index = DriveDocumentCountQuery::find_countable_index_for_where_clauses( - document_type.indexes(), - &where_clauses, - ) - .ok_or_else(|| { - Error::Query(QuerySyntaxError::WhereClauseOnNonIndexedProperty( - "count query requires a `countable: true` index whose properties \ - exactly match the where clause fields, or `documentsCountable: \ - true` on the document type for unfiltered total counts" - .to_string(), - )) - })?; - let count_query = DriveDocumentCountQuery { - document_type, - contract_id, - document_type_name, - index, - where_clauses, - }; - count_query.execute_no_proof(self, transaction, platform_version) - } - - /// Reads the document-type primary-key tree's `CountTree` element - /// (`[contract_doc, contract_id, [1], doctype, 0]`) and returns - /// `count_value_or_default()`. Used by the `documents_countable: - /// true` fast path on the total-count flows (both no-proof and - /// prove builder). - /// - /// Returns 0 when the element doesn't exist (e.g. fresh contract - /// with no documents inserted). Caller is responsible for ensuring - /// `documents_countable` is set on the document type before - /// calling — without it the element at `[..., doctype, 0]` is a - /// regular `NormalTree` and `count_value_or_default()` returns 0 - /// regardless of how many documents the type actually has. - fn read_primary_key_count_tree( - &self, - contract_id: &[u8; 32], - document_type_name: &str, - transaction: TransactionArg, - platform_version: &PlatformVersion, - ) -> Result { - let drive_version = &platform_version.drive; - let path = [ - &[crate::drive::RootTree::DataContractDocuments as u8] as &[u8], - contract_id, - &[1u8], - document_type_name.as_bytes(), - ]; - let mut drive_operations = vec![]; - let element = self.grove_get_raw_optional( - grovedb_path::SubtreePath::from(path.as_slice()), - &[0], - crate::util::grove_operations::DirectQueryType::StatefulDirectQuery, - transaction, - &mut drive_operations, - drive_version, - )?; - Ok(element.map_or(0, |e| e.count_value_or_default())) - } - - /// Per-`In`-value entries: cartesian-fork the single `In` clause - /// into one Equal-on-each-value sub-query, run each, emit a - /// `(serialized_value, count)` entry. Used by - /// [`DocumentCountMode::PerInValue`] dispatch. - /// - /// `options` (limit / order / distinct) applies to the returned - /// entry list — split-mode pagination per the proto contract on - /// `GetDocumentsCountRequestV0.{order_by, limit}` (the dispatcher - /// derives `RangeCountOptions.order_by_ascending` from the first - /// `order_by` clause's direction; empty `order_by` → ascending). - /// The `distinct` flag has no effect here (PerInValue is always - /// per-value); it's accepted for symmetry with the range-mode - /// executor. - /// - /// Caller has already verified via [`DriveDocumentCountQuery::detect_mode`] - /// that exactly one `In` clause is present in `where_clauses`. - #[allow(clippy::too_many_arguments)] - pub fn execute_document_count_per_in_value_no_proof( - &self, - contract_id: [u8; 32], - document_type: DocumentTypeRef, - document_type_name: String, - where_clauses: Vec, - options: RangeCountOptions, - transaction: TransactionArg, - platform_version: &PlatformVersion, - ) -> Result, Error> { - let in_clause = where_clauses - .iter() - .find(|wc| wc.operator == WhereOperator::In) - .ok_or_else(|| { - Error::Query(QuerySyntaxError::InvalidWhereClauseComponents( - "execute_document_count_per_in_value_no_proof requires exactly one `in` clause", - )) - })? - .clone(); - // `in_values()` enforces non-empty, ≤100, no-duplicates — the - // same shape validation `WhereClause::from_clause` would have - // applied on the regular query path. Without it the executor - // below performs one GroveDB walk per value with no input cap, - // which lets a single 64 MiB gRPC request schedule arbitrarily - // many backend reads (request-amplification DoS). Inheriting - // the existing 100-cap is the same defensive bound the other - // `In` consumers (mod.rs:1246, conditions.rs:852) use. - let in_values = in_clause.in_values().into_data_with_error()??; - - let other_clauses: Vec = where_clauses - .iter() - .filter(|wc| wc.operator != WhereOperator::In) - .cloned() - .collect(); - - // Aggregate first into a key-ordered map (dedupes duplicate - // `In` values via the same canonical-byte rule as the range - // walker uses; BTreeMap ordering matches `RangeCountOptions`'s - // ascending convention). Order, cursor, and limit get applied - // after. - use dpp::data_contract::document_type::methods::DocumentTypeV0Methods; - let mut merged: std::collections::BTreeMap, u64> = - std::collections::BTreeMap::new(); - for value in in_values.iter() { - let key_bytes = document_type.serialize_value_for_key( - in_clause.field.as_str(), - value, - platform_version, - )?; - if merged.contains_key(&key_bytes) { - // Duplicate `In` values resolve to the same indexed path, - // so the count is the same — no need to re-query. - continue; - } - - let mut clauses_for_value = other_clauses.clone(); - clauses_for_value.push(WhereClause { - field: in_clause.field.clone(), - operator: WhereOperator::Equal, - value: value.clone(), - }); - - let index = DriveDocumentCountQuery::find_countable_index_for_where_clauses( - document_type.indexes(), - &clauses_for_value, - ) - .ok_or_else(|| { - Error::Query(QuerySyntaxError::WhereClauseOnNonIndexedProperty( - "count query requires a countable index on the document type that \ - matches the where clause properties" - .to_string(), - )) - })?; - - let count_query = DriveDocumentCountQuery { - document_type, - contract_id, - document_type_name: document_type_name.clone(), - index, - where_clauses: clauses_for_value, - }; - let results = count_query.execute_no_proof(self, transaction, platform_version)?; - let count = results.first().map_or(0, |entry| entry.count); - merged.insert(key_bytes, count); - } - - // Apply order, then cursor, then limit — same shape as the - // range walker. BTreeMap iteration is already ascending; flip - // the vec if descending was requested. - // - // PerInValue mode splits by the `In` dimension itself, so - // the In value goes in `key` (the split-key field) and - // `in_key` is `None`. The `in_key` field is reserved for - // compound queries where the `In` is on a prefix property - // distinct from the value being counted. - let mut entries: Vec = merged - .into_iter() - .map(|(key, count)| SplitCountEntry { - in_key: None, - key, - count, - }) - .collect(); - if !options.order_by_ascending { - entries.reverse(); - } - // For pagination, callers chunk the `In` array client-side - // (the values are caller-supplied to begin with); no - // server-side cursor is needed or supported. - if let Some(limit) = options.limit { - entries.truncate(limit as usize); - } - Ok(entries) - } - - /// Range-count walk against a `range_countable` index. Returns a - /// summed entry or per-distinct-value entries depending on - /// `options.distinct`. Used by [`DocumentCountMode::RangeNoProof`] - /// dispatch. - #[allow(clippy::too_many_arguments)] - pub fn execute_document_count_range_no_proof( - &self, - contract_id: [u8; 32], - document_type: DocumentTypeRef, - document_type_name: String, - where_clauses: Vec, - options: RangeCountOptions, - transaction: TransactionArg, - platform_version: &PlatformVersion, - ) -> Result, Error> { - let index = DriveDocumentCountQuery::find_range_countable_index_for_where_clauses( - document_type.indexes(), - &where_clauses, - ) - .ok_or_else(|| { - Error::Query(QuerySyntaxError::WhereClauseOnNonIndexedProperty( - "range count requires a `range_countable: true` index whose last \ - property matches the range field, with all other clauses covering \ - its prefix as `==` matches" - .to_string(), - )) - })?; - let count_query = DriveDocumentCountQuery { - document_type, - contract_id, - document_type_name, - index, - where_clauses, - }; - count_query.execute_range_count_no_proof(self, &options, transaction, platform_version) - } - - /// Range-count proof via grovedb's `AggregateCountOnRange`. Returns - /// proof bytes that the client verifies via - /// `GroveDb::verify_aggregate_count_query`. Used by - /// [`DocumentCountMode::RangeProof`] dispatch. - pub fn execute_document_count_range_proof( - &self, - contract_id: [u8; 32], - document_type: DocumentTypeRef, - document_type_name: String, - where_clauses: Vec, - transaction: TransactionArg, - platform_version: &PlatformVersion, - ) -> Result, Error> { - let index = DriveDocumentCountQuery::find_range_countable_index_for_where_clauses( - document_type.indexes(), - &where_clauses, - ) - .ok_or_else(|| { - Error::Query(QuerySyntaxError::WhereClauseOnNonIndexedProperty( - "range count requires a `range_countable: true` index whose last \ - property matches the range field" - .to_string(), - )) - })?; - let count_query = DriveDocumentCountQuery { - document_type, - contract_id, - document_type_name, - index, - where_clauses, - }; - count_query.execute_aggregate_count_with_proof(self, transaction, platform_version) - } - - /// Distinct-counts-with-proof companion to - /// [`Self::execute_document_count_range_proof`]. Returns proof - /// bytes that the client verifies via - /// [`drive_proof_verifier::verify_distinct_count_proof`], yielding - /// a `BTreeMap, u64>` keyed by serialized property value. - /// Used by [`DocumentCountMode::RangeDistinctProof`] dispatch. - /// - /// `limit` caps the number of distinct in-range values the proof - /// covers — the dispatcher pre-validates `limit ≤ max_query_limit` - /// so client-side proof reconstruction can use the exact same - /// value without divergence. The SDK reads it back off the - /// request when building the verifier's `PathQuery`. - #[allow(clippy::too_many_arguments)] - pub fn execute_document_count_range_distinct_proof( - &self, - contract_id: [u8; 32], - document_type: DocumentTypeRef, - document_type_name: String, - where_clauses: Vec, - limit: u16, - left_to_right: bool, - transaction: TransactionArg, - platform_version: &PlatformVersion, - ) -> Result, Error> { - let index = DriveDocumentCountQuery::find_range_countable_index_for_where_clauses( - document_type.indexes(), - &where_clauses, - ) - .ok_or_else(|| { - Error::Query(QuerySyntaxError::WhereClauseOnNonIndexedProperty( - "range count requires a `range_countable: true` index whose last \ - property matches the range field" - .to_string(), - )) - })?; - let count_query = DriveDocumentCountQuery { - document_type, - contract_id, - document_type_name, - index, - where_clauses, - }; - count_query.execute_distinct_count_with_proof( - self, - limit, - left_to_right, - transaction, - platform_version, - ) - } - - /// Point-lookup count proof against a `countable: true` index for - /// `prove = true` Equal/`In` count queries, OR — when the where - /// clauses are empty and the document type has - /// `documents_countable: true` — a proof of the type's primary-key - /// CountTree (one merk path proof, O(log n) bytes). - /// - /// In both cases the SDK-side verifier extracts each verified - /// CountTree element's `count_value` directly, no document - /// materialization. - /// - /// Mirrors the no-proof `Total` / `PerInValue` modes' rejection - /// contract: if no `countable: true` index exactly covers the - /// where clauses (and the documents_countable fast path doesn't - /// apply), rejects with `WhereClauseOnNonIndexedProperty`. Same - /// contract on both prove and no-proof paths — no silent fallback. - /// - /// Used by [`DocumentCountMode::PointLookupProof`] dispatch. - pub fn execute_document_count_point_lookup_proof( - &self, - contract_id: [u8; 32], - document_type: DocumentTypeRef, - document_type_name: String, - where_clauses: Vec, - transaction: TransactionArg, - platform_version: &PlatformVersion, - ) -> Result, Error> { - use dpp::data_contract::document_type::accessors::DocumentTypeV2Getters; - - // Fast path: unfiltered prove count on a `documents_countable: - // true` document type proves the primary-key CountTree - // element directly. Same path-query shape as the index-based - // case, just rooted at `[..., doctype]` instead of inside an - // index. - if where_clauses.is_empty() && document_type.documents_countable() { - let path_query = DriveDocumentCountQuery::primary_key_count_tree_path_query( - contract_id, - &document_type_name, - ); - let proof = self - .grove - .get_proved_path_query( - &path_query, - None, - transaction, - &platform_version.drive.grove_version, - ) - .unwrap() - .map_err(|e| Error::GroveDB(Box::new(e)))?; - return Ok(proof); - } - - let index = DriveDocumentCountQuery::find_countable_index_for_where_clauses( - document_type.indexes(), - &where_clauses, - ) - .ok_or_else(|| { - Error::Query(QuerySyntaxError::WhereClauseOnNonIndexedProperty( - "prove count requires a `countable: true` index whose properties \ - exactly match the where clause fields, or `documentsCountable: \ - true` on the document type for unfiltered total counts — same \ - requirement as the no-proof path" - .to_string(), - )) - })?; - let count_query = DriveDocumentCountQuery { - document_type, - contract_id, - document_type_name, - index, - where_clauses, - }; - count_query.execute_point_lookup_count_with_proof(self, transaction, platform_version) - } -} +// `impl Drive { ... per-mode executors ... }` lives in +// [`super::executors`] — it's a deliberate physical split between +// "dispatcher routes" (this file) and "executors execute" (sibling). +// All per-mode executor methods this file calls +// (`execute_document_count_total_no_proof` etc.) are reachable via +// the shared `Drive` type from there. /// All inputs required for the unified document-count entry point /// [`Drive::execute_document_count_request`]. Built by the gRPC @@ -521,8 +75,15 @@ pub struct DocumentCountRequest<'a> { /// "ascending" for split-mode response ordering when no clauses /// are present. pub raw_order_by_value: dpp::platform_value::Value, - /// `return_distinct_counts_in_range` flag from the request. - pub return_distinct_counts_in_range: bool, + /// SQL-shaped output mode — the caller's `(select, group_by)` + /// contract resolved into one of four shapes (Aggregate, + /// GroupByIn, GroupByRange, GroupByCompound). The dispatcher + /// uses this to distinguish e.g. "aggregate count with In + /// fan-out" (which does NOT accept `limit`) from "per-In-value + /// entries" (which does) — they're otherwise indistinguishable + /// from the where clauses alone. See [`CountMode`] for the + /// per-variant where-clause and `limit` invariants. + pub mode: super::CountMode, /// Limit cap from the request. Callers SHOULD pre-clamp against /// their server-side `max_query_limit` policy, but Drive also /// enforces a defense-in-depth clamp before forwarding to the @@ -544,11 +105,12 @@ pub struct DocumentCountRequest<'a> { /// no-proof responses) plus the outer `Proof` arm: /// /// - `Aggregate(u64)` — total-count modes (`Total` and -/// `RangeNoProof` with `return_distinct_counts_in_range = false`). -/// The abci handler maps this to `CountResults.aggregate_count`. +/// `RangeNoProof` under [`super::CountMode::Aggregate`]). The abci +/// handler maps this to `CountResults.aggregate_count`. /// - `Entries(Vec)` — per-key modes (`PerInValue` -/// and `RangeNoProof` with `return_distinct_counts_in_range = -/// true`). The abci handler maps this to `CountResults.entries`. +/// and `RangeNoProof` under [`super::CountMode::GroupByRange`] / +/// [`super::CountMode::GroupByCompound`]). The abci handler maps +/// this to `CountResults.entries`. /// - `Proof(Vec)` — grovedb proof bytes the client verifies via /// either `verify_aggregate_count_query` (for `RangeProof`), /// `verify_distinct_count_proof` (for `RangeDistinctProof`), or @@ -619,13 +181,13 @@ fn where_clauses_from_value(value: &dpp::platform_value::Value) -> Result Err(Error::Query(QuerySyntaxError::InvalidFormatWhereClause( - "where clause must be an array", + "where clause must be an array".to_string(), ))), }) .collect::, _>>()?, _ => { return Err(Error::Query(QuerySyntaxError::InvalidFormatWhereClause( - "where clause must be an array", + "where clause must be an array".to_string(), ))); } }; @@ -634,7 +196,23 @@ fn where_clauses_from_value(value: &dpp::platform_value::Value) -> Result {} + Err(Error::Query(QuerySyntaxError::MultipleRangeClauses(_))) => {} + Err(e) => return Err(e), + } Ok(clauses) } @@ -658,17 +236,17 @@ fn order_clauses_from_value(value: &dpp::platform_value::Value) -> Result Err(Error::Query(QuerySyntaxError::InvalidFormatWhereClause( - "order_by clause must be an array", + "order_by clause must be an array".to_string(), ))), }) .collect(), _ => Err(Error::Query(QuerySyntaxError::InvalidFormatWhereClause( - "order_by clause must be an array", + "order_by clause must be an array".to_string(), ))), } } @@ -719,11 +297,8 @@ impl Drive { // flat `Total` paths don't read it. let order_by_ascending = order_clauses.first().map(|c| c.ascending).unwrap_or(true); - let mode = DriveDocumentCountQuery::detect_mode( - &where_clauses, - request.return_distinct_counts_in_range, - request.prove, - )?; + let mode = + DriveDocumentCountQuery::detect_mode(&where_clauses, request.mode, request.prove)?; let contract_id = request.contract.id_ref().to_buffer(); let document_type_name = request.document_type.name().to_string(); @@ -743,21 +318,16 @@ impl Drive { transaction, platform_version, )?; - let total = entries.first().map(|e| e.count).unwrap_or(0); + let total = entries.first().and_then(|e| e.count).unwrap_or(0); Ok(DocumentCountResponse::Aggregate(total)) } DocumentCountMode::PerInValue => { - // Per-`In`-value → entries. The proto contract on - // `GetDocumentsCountRequestV0.{order_by, limit}` - // applies; clamp `limit` defensively (the abci handler - // passes raw, see `DocumentCountRequest::limit` doc). - let effective_limit = request - .limit - .unwrap_or(request.drive_config.default_query_limit as u32) - .min(request.drive_config.max_query_limit as u32); + // |In| ≤ 100 is the structural bound; failsafe cap + // keeps behavior independent of `default_query_limit`. + // See [`super::MAX_LIMIT_AS_FAILSAFE`]. let options = RangeCountOptions { distinct: false, // ignored by PerInValue executor - limit: Some(effective_limit), + limit: Some(super::MAX_LIMIT_AS_FAILSAFE), order_by_ascending, }; Ok(DocumentCountResponse::Entries( @@ -773,16 +343,20 @@ impl Drive { )) } DocumentCountMode::RangeNoProof => { - // Range no-proof → either aggregate (sum) or entries - // (per-distinct-value), based on - // `return_distinct_counts_in_range`. Clamp limit - // defense-in-depth. - let effective_limit = request - .limit - .unwrap_or(request.drive_config.default_query_limit as u32) - .min(request.drive_config.max_query_limit as u32); + // Aggregate → failsafe cap (per-In fan-out bounded by + // |In| ≤ 100); distinct walk → caller's limit with + // `default_query_limit` fallback since range is + // genuinely unbounded. + let effective_limit = if request.mode.is_aggregate() { + super::MAX_LIMIT_AS_FAILSAFE + } else { + request + .limit + .unwrap_or(request.drive_config.default_query_limit as u32) + .min(request.drive_config.max_query_limit as u32) + }; let options = RangeCountOptions { - distinct: request.return_distinct_counts_in_range, + distinct: request.mode.requires_distinct_walk(), limit: Some(effective_limit), order_by_ascending, }; @@ -795,14 +369,15 @@ impl Drive { transaction, platform_version, )?; - if request.return_distinct_counts_in_range { - Ok(DocumentCountResponse::Entries(entries)) - } else { - // !distinct: executor returns a single empty-key - // entry containing the sum (or empty vec if the - // path doesn't exist). Collapse to `Aggregate`. - let total = entries.first().map(|e| e.count).unwrap_or(0); + if request.mode.is_aggregate() { + // Aggregate mode: executor returns a single + // empty-key entry containing the sum (or empty + // vec if the path doesn't exist). Collapse to + // `Aggregate`. + let total = entries.first().and_then(|e| e.count).unwrap_or(0); Ok(DocumentCountResponse::Aggregate(total)) + } else { + Ok(DocumentCountResponse::Entries(entries)) } } DocumentCountMode::RangeProof => Ok(DocumentCountResponse::Proof( @@ -850,8 +425,8 @@ impl Drive { if effective_limit > request.drive_config.max_query_limit as u32 { return Err(Error::Query(QuerySyntaxError::InvalidLimit(format!( "limit {} exceeds max_query_limit {} on the prove + \ - return_distinct_counts_in_range path; reduce the requested \ - limit or use prove = false", + distinct-walk path (GROUP BY a range field); reduce the \ + requested limit or use prove = false", effective_limit, request.drive_config.max_query_limit )))); } @@ -859,10 +434,9 @@ impl Drive { // Default to ascending if the request didn't specify // — matches the no-proof default. The verifier reads // the same field to reconstruct the matching path - // query (see SDK's - // `FromProof` for - // `DocumentSplitCounts`); both sides MUST land on the - // same `left_to_right` value or the merk-root + // query (see SDK's `FromProof` impl + // for `DocumentSplitCounts`); both sides MUST land + // on the same `left_to_right` value or the merk-root // recomputation fails. let left_to_right = order_by_ascending; Ok(DocumentCountResponse::Proof( @@ -888,6 +462,87 @@ impl Drive { platform_version, )?, )), + DocumentCountMode::RangeAggregateCarrierProof => { + // Validate-don't-clamp limit policy on the prove path + // (same rationale as `RangeDistinctProof` above): the + // verifier reconstructs the SizedQuery's `limit` byte- + // identically, so silent clamping would invisibly + // break verification. + // + // Two shape-dependent rules apply here: + // + // - **In-outer carrier (G7):** the caller's `|In|` + // already bounds the result. `SizedQuery::limit` + // stays `None`; if the caller passed a non-`None` + // `limit`, reject — there's no use case for a sub- + // `|In|` limit on this path, and accepting it would + // silently change which In-branches appear in the + // proof. + // + // - **Range-outer carrier (G8):** the platform + // enforces a max outer-walk cap of + // [`super::MAX_CARRIER_AGGREGATE_OUTER_RANGE_LIMIT`] + // on how many outer-range matches the carrier walks. + // Caller may pass a smaller `limit` to truncate the + // walk further; passing a larger one is rejected. + // If the caller passes `None`, the platform default + // (the cap itself) is used. + let has_outer_range = where_clauses + .iter() + .filter(|wc| DriveDocumentCountQuery::is_range_operator(wc.operator)) + .count() + == 2; + let effective_limit = if has_outer_range { + match request.limit { + None => Some(super::MAX_CARRIER_AGGREGATE_OUTER_RANGE_LIMIT), + Some(n) => { + if n > super::MAX_CARRIER_AGGREGATE_OUTER_RANGE_LIMIT as u32 { + return Err(Error::Query(QuerySyntaxError::InvalidLimit(format!( + "carrier-aggregate range-outer queries (e.g. \ + `outer_range_field > X AND inner_acor_field > \ + Y` with `group_by = [outer_range_field]`) cap \ + the outer walk at {} entries (compile-time \ + constant `MAX_CARRIER_AGGREGATE_OUTER_RANGE_LIMIT`); \ + got limit = {}. Pass a value ≤ {} or omit \ + `limit` to use the default.", + super::MAX_CARRIER_AGGREGATE_OUTER_RANGE_LIMIT, + n, + super::MAX_CARRIER_AGGREGATE_OUTER_RANGE_LIMIT, + )))); + } + if n == 0 { + return Err(Error::Query(QuerySyntaxError::InvalidLimit( + "carrier-aggregate range-outer queries require limit \ + ≥ 1; got limit = 0" + .to_string(), + ))); + } + Some(n as u16) + } + } + } else { + if let Some(n) = request.limit { + return Err(Error::Query(QuerySyntaxError::InvalidLimit(format!( + "carrier-aggregate In-outer queries (e.g. `outer_in_field IN \ + [...] AND inner_acor_field > Y` with `group_by = \ + [outer_in_field]`) don't accept `limit` — the In array's \ + length already bounds the result. Got limit = {n}.", + )))); + } + None + }; + Ok(DocumentCountResponse::Proof( + self.execute_document_count_range_aggregate_carrier_proof( + contract_id, + request.document_type, + document_type_name, + where_clauses, + effective_limit, + transaction, + platform_version, + )?, + )) + } } } } diff --git a/packages/rs-drive/src/query/drive_document_count_query/execute_point_lookup.rs b/packages/rs-drive/src/query/drive_document_count_query/execute_point_lookup.rs index a67a44b1b61..739a30b88ef 100644 --- a/packages/rs-drive/src/query/drive_document_count_query/execute_point_lookup.rs +++ b/packages/rs-drive/src/query/drive_document_count_query/execute_point_lookup.rs @@ -21,6 +21,7 @@ use crate::error::Error; use dpp::version::PlatformVersion; use grovedb::query_result_type::{QueryResultElement, QueryResultType}; use grovedb::TransactionArg; +use grovedb_costs::CostContext; impl DriveDocumentCountQuery<'_> { /// Executes the count query without generating a proof. @@ -83,7 +84,11 @@ impl DriveDocumentCountQuery<'_> { Ok(vec![SplitCountEntry { in_key: None, key: vec![], - count, + // Point-lookup executor summed verified CountTree + // counts to produce this; the count is explicit, hence + // `Some(_)` (possibly `Some(0)` if every covered branch + // was empty or absent). + count: Some(count), }]) } @@ -103,10 +108,11 @@ impl DriveDocumentCountQuery<'_> { /// for the exhaustive contract. /// /// Proof size is O(k × log n) where k is the number of covered - /// (Equal/In) branches and n is the tree depth: one merk path proof - /// per CountTree element, not per matching document. Replaces the - /// pre-this-PR materialize-and-count proof which scaled with - /// matching docs and was capped at `u16::MAX`. + /// (Equal/In) branches and n is the tree depth: one merk path + /// proof per CountTree element, not per matching document. + /// Avoids the materialize-and-count alternative used by the + /// regular document-query path, which scales with the number + /// of matching docs and is capped at `u16::MAX`. pub fn execute_point_lookup_count_with_proof( &self, drive: &Drive, @@ -115,11 +121,20 @@ impl DriveDocumentCountQuery<'_> { ) -> Result, Error> { let drive_version = &platform_version.drive; let path_query = self.point_lookup_count_path_query(platform_version)?; - let proof = drive - .grove - .get_proved_path_query(&path_query, None, transaction, &drive_version.grove_version) - .unwrap() - .map_err(|e| Error::GroveDB(Box::new(e)))?; + // Destructure the `CostContext` explicitly rather than calling + // `.unwrap()` on it: `CostContext::unwrap` is infallible (it just + // drops the cost field), but the visual pattern collides with + // `Option/Result::unwrap` and makes review noisier. Cost is + // discarded here because the per-mode dispatcher in + // `drive_dispatcher` wraps these executors with its own fee + // accounting. + let CostContext { value, cost: _ } = drive.grove.get_proved_path_query( + &path_query, + None, + transaction, + &drive_version.grove_version, + ); + let proof = value.map_err(|e| Error::GroveDB(Box::new(e)))?; Ok(proof) } } diff --git a/packages/rs-drive/src/query/drive_document_count_query/execute_range_count.rs b/packages/rs-drive/src/query/drive_document_count_query/execute_range_count.rs index ad98c7216c1..41be393b0ac 100644 --- a/packages/rs-drive/src/query/drive_document_count_query/execute_range_count.rs +++ b/packages/rs-drive/src/query/drive_document_count_query/execute_range_count.rs @@ -26,6 +26,7 @@ use dpp::data_contract::document_type::methods::DocumentTypeV0Methods; use dpp::version::PlatformVersion; use grovedb::query_result_type::QueryResultType; use grovedb::TransactionArg; +use grovedb_costs::CostContext; /// Pagination + ordering knobs for `execute_range_count_no_proof`. /// @@ -202,34 +203,45 @@ impl DriveDocumentCountQuery<'_> { }; let path_query = per_value_query.aggregate_count_path_query(platform_version)?; - let count = drive - .grove - .query_aggregate_count( - &path_query, - transaction, - &drive_version.grove_version, - ) - .unwrap() - .map_err(|e| Error::GroveDB(Box::new(e)))?; + // Destructure the `CostContext` explicitly rather than + // calling `.unwrap()` on it: `CostContext::unwrap` is + // infallible (it just drops the cost field), but the + // visual pattern collides with `Option/Result::unwrap` + // and makes review noisier. Cost is discarded here + // because the per-mode dispatcher in `drive_dispatcher` + // wraps these executors with its own fee accounting — + // see the module-level docstring. + let CostContext { value, cost: _ } = drive.grove.query_aggregate_count( + &path_query, + transaction, + &drive_version.grove_version, + ); + let count = value.map_err(|e| Error::GroveDB(Box::new(e)))?; total = total.saturating_add(count); } return Ok(vec![SplitCountEntry { in_key: None, key: Vec::new(), - count: total, + // Range-summed total derived from the executor's + // per-In aggregate fan-out — verified count. + count: Some(total), }]); } // Flat summed (no In on prefix): single aggregate read. let path_query = self.aggregate_count_path_query(platform_version)?; - let count = drive - .grove - .query_aggregate_count(&path_query, transaction, &drive_version.grove_version) - .unwrap() - .map_err(|e| Error::GroveDB(Box::new(e)))?; + // See In-fan-out branch above for the destructure rationale. + let CostContext { value, cost: _ } = drive.grove.query_aggregate_count( + &path_query, + transaction, + &drive_version.grove_version, + ); + let count = value.map_err(|e| Error::GroveDB(Box::new(e)))?; return Ok(vec![SplitCountEntry { in_key: None, key: Vec::new(), - count, + // Single `AggregateCountOnRange` read — explicit + // verified count. + count: Some(count), }]); } @@ -306,7 +318,13 @@ impl DriveDocumentCountQuery<'_> { } else { None }; - entries.push(SplitCountEntry { in_key, key, count }); + // Distinct-walk emits one entry per distinct value + // with its verified count; always `Some(_)`. + entries.push(SplitCountEntry { + in_key, + key, + count: Some(count), + }); } // Distinct mode: grovedb already emitted entries in the @@ -346,11 +364,15 @@ impl DriveDocumentCountQuery<'_> { ) -> Result, Error> { let drive_version = &platform_version.drive; let path_query = self.aggregate_count_path_query(platform_version)?; - let proof = drive - .grove - .get_proved_path_query(&path_query, None, transaction, &drive_version.grove_version) - .unwrap() - .map_err(|e| Error::GroveDB(Box::new(e)))?; + // Destructure rather than `.unwrap()` — see the In fan-out branch + // in `execute_range_count_no_proof` for rationale. + let CostContext { value, cost: _ } = drive.grove.get_proved_path_query( + &path_query, + None, + transaction, + &drive_version.grove_version, + ); + let proof = value.map_err(|e| Error::GroveDB(Box::new(e)))?; Ok(proof) } @@ -387,11 +409,63 @@ impl DriveDocumentCountQuery<'_> { let drive_version = &platform_version.drive; let path_query = self.distinct_count_path_query(Some(limit), left_to_right, platform_version)?; - let proof = drive - .grove - .get_proved_path_query(&path_query, None, transaction, &drive_version.grove_version) - .unwrap() - .map_err(|e| Error::GroveDB(Box::new(e)))?; + // Destructure rather than `.unwrap()` — see the In fan-out branch + // in `execute_range_count_no_proof` for rationale. + let CostContext { value, cost: _ } = drive.grove.get_proved_path_query( + &path_query, + None, + transaction, + &drive_version.grove_version, + ); + let proof = value.map_err(|e| Error::GroveDB(Box::new(e)))?; + Ok(proof) + } + + /// Generates a grovedb **carrier** `AggregateCountOnRange` proof + /// for `In + range` queries with `group_by = [in_field]`. The + /// proof commits one aggregate count per resolved In branch + /// via grovedb's carrier-subquery composition + /// ([PR #663](https://github.com/dashpay/grovedb/pull/663)). + /// + /// Path query: see + /// [`Self::carrier_aggregate_count_path_query`]. + /// + /// Trade-off vs. the alternative + /// [`Self::execute_distinct_count_with_proof`] + /// (`GroupByCompound` shape): + /// - **This** (carrier-ACOR): O(|In| · (log B + log C')) proof + /// bytes. One commit per merk-tree boundary node per In + /// branch — preserves the per-branch aggregate granularity + /// that `group_by = [in_field, range_field]` can't express + /// (the compound shape commits per-distinct-value-pair + /// entries). + /// - **Alternative** (distinct compound): O(|In| · R · log C') + /// where R is distinct in-range values per branch. Carries + /// strictly more information (one `(in_key, range_key)` + /// pair per resolved doc) at substantially larger bytes. + /// + /// Verified client-side via + /// [`grovedb::GroveDb::verify_aggregate_count_query_per_key`], + /// which returns `(RootHash, Vec<(Vec, u64)>)`. + pub fn execute_carrier_aggregate_count_with_proof( + &self, + drive: &Drive, + limit: Option, + transaction: TransactionArg, + platform_version: &PlatformVersion, + ) -> Result, Error> { + let drive_version = &platform_version.drive; + let path_query = self.carrier_aggregate_count_path_query(limit, platform_version)?; + // Same destructure pattern as the sibling aggregate / distinct + // executors. `get_proved_path_query` returns `CostContext`; + // ignoring the cost field is the same pattern those use today. + let CostContext { value, cost: _ } = drive.grove.get_proved_path_query( + &path_query, + None, + transaction, + &drive_version.grove_version, + ); + let proof = value.map_err(|e| Error::GroveDB(Box::new(e)))?; Ok(proof) } } diff --git a/packages/rs-drive/src/query/drive_document_count_query/executors/mod.rs b/packages/rs-drive/src/query/drive_document_count_query/executors/mod.rs new file mode 100644 index 00000000000..4a524b9a1b0 --- /dev/null +++ b/packages/rs-drive/src/query/drive_document_count_query/executors/mod.rs @@ -0,0 +1,33 @@ +//! Per-mode count-query executors on `impl Drive`. One file per +//! [`super::DocumentCountMode`] variant — the dispatcher +//! ([`super::drive_dispatcher`]) calls into the right one based +//! on the detected mode. +//! +//! Each executor: +//! +//! 1. Picks the right covering index for its mode (returns +//! `Error::Query(QuerySyntaxError::WhereClauseOnNonIndexedProperty)` +//! if no index covers the where clauses). +//! 2. Builds the appropriate `DriveDocumentCountQuery`. +//! 3. Runs the matching method on it (`execute_no_proof`, +//! `execute_range_count_no_proof`, +//! `execute_aggregate_count_with_proof`, +//! `execute_distinct_count_with_proof`, or +//! `execute_point_lookup_count_with_proof`). +//! 4. Returns `Vec` (no-proof modes) or +//! `Vec` proof bytes (proof modes). +//! +//! Splitting along mode boundaries — one file per mode — keeps +//! each executor's index-picking + clause-handling logic local +//! and lets the dispatcher's match arms stay one line each. No +//! re-exports are needed: each file adds methods directly to +//! `impl Drive`, so callers (the dispatcher) just see them on +//! the `Drive` type. + +pub mod per_in_value; +pub mod point_lookup_proof; +pub mod range_aggregate_carrier_proof; +pub mod range_distinct_proof; +pub mod range_no_proof; +pub mod range_proof; +pub mod total; diff --git a/packages/rs-drive/src/query/drive_document_count_query/executors/per_in_value.rs b/packages/rs-drive/src/query/drive_document_count_query/executors/per_in_value.rs new file mode 100644 index 00000000000..5c9778d1efe --- /dev/null +++ b/packages/rs-drive/src/query/drive_document_count_query/executors/per_in_value.rs @@ -0,0 +1,158 @@ +//! Per-`In`-value executor for +//! [`super::super::DocumentCountMode::PerInValue`] dispatch — +//! `prove = false` count queries with exactly one `In` clause and +//! no range clause. + +use super::super::super::conditions::{WhereClause, WhereOperator}; +use super::super::execute_range_count::RangeCountOptions; +use super::super::{DriveDocumentCountQuery, SplitCountEntry}; +use crate::drive::Drive; +use crate::error::query::QuerySyntaxError; +use crate::error::Error; +use dpp::data_contract::document_type::DocumentTypeRef; +use dpp::version::PlatformVersion; +use grovedb::TransactionArg; + +impl Drive { + /// Per-`In`-value entries: cartesian-fork the single `In` + /// clause into one Equal-on-each-value sub-query, run each, + /// emit a `(serialized_value, count)` entry. + /// + /// `options` (limit / order / distinct) applies to the + /// returned entry list — split-mode pagination per the proto + /// contract on `GetDocumentsCountRequestV0.{order_by, limit}` + /// (the dispatcher derives `RangeCountOptions.order_by_ascending` + /// from the first `order_by` clause's direction; empty + /// `order_by` → ascending). The `distinct` flag has no effect + /// here (PerInValue is always per-value); it's accepted for + /// symmetry with the range-mode executor. + /// + /// Caller has already verified via + /// [`DriveDocumentCountQuery::detect_mode`] that exactly one + /// `In` clause is present in `where_clauses`. + #[allow(clippy::too_many_arguments)] + pub fn execute_document_count_per_in_value_no_proof( + &self, + contract_id: [u8; 32], + document_type: DocumentTypeRef, + document_type_name: String, + where_clauses: Vec, + options: RangeCountOptions, + transaction: TransactionArg, + platform_version: &PlatformVersion, + ) -> Result, Error> { + let in_clause = where_clauses + .iter() + .find(|wc| wc.operator == WhereOperator::In) + .ok_or_else(|| { + Error::Query(QuerySyntaxError::InvalidWhereClauseComponents( + "execute_document_count_per_in_value_no_proof requires exactly one `in` clause", + )) + })? + .clone(); + // `in_values()` enforces non-empty, ≤100, no-duplicates — the + // same shape validation `WhereClause::from_clause` would have + // applied on the regular query path. Without it the executor + // below performs one GroveDB walk per value with no input cap, + // which lets a single 64 MiB gRPC request schedule arbitrarily + // many backend reads (request-amplification DoS). Inheriting + // the existing 100-cap is the same defensive bound the other + // `In` consumers (mod.rs:1246, conditions.rs:852) use. + let in_values = in_clause.in_values().into_data_with_error()??; + + let other_clauses: Vec = where_clauses + .iter() + .filter(|wc| wc.operator != WhereOperator::In) + .cloned() + .collect(); + + // Aggregate first into a key-ordered map (dedupes duplicate + // `In` values via the same canonical-byte rule as the range + // walker uses; BTreeMap ordering matches `RangeCountOptions`'s + // ascending convention). Order, cursor, and limit get applied + // after. + use dpp::data_contract::document_type::accessors::DocumentTypeV0Getters; + use dpp::data_contract::document_type::methods::DocumentTypeV0Methods; + let mut merged: std::collections::BTreeMap, u64> = + std::collections::BTreeMap::new(); + for value in in_values.iter() { + let key_bytes = document_type.serialize_value_for_key( + in_clause.field.as_str(), + value, + platform_version, + )?; + if merged.contains_key(&key_bytes) { + // Duplicate `In` values resolve to the same indexed path, + // so the count is the same — no need to re-query. + continue; + } + + let mut clauses_for_value = other_clauses.clone(); + clauses_for_value.push(WhereClause { + field: in_clause.field.clone(), + operator: WhereOperator::Equal, + value: value.clone(), + }); + + let index = DriveDocumentCountQuery::find_countable_index_for_where_clauses( + document_type.indexes(), + &clauses_for_value, + ) + .ok_or_else(|| { + Error::Query(QuerySyntaxError::WhereClauseOnNonIndexedProperty( + "count query requires a countable index on the document type that \ + matches the where clause properties" + .to_string(), + )) + })?; + + let count_query = DriveDocumentCountQuery { + document_type, + contract_id, + document_type_name: document_type_name.clone(), + index, + where_clauses: clauses_for_value, + }; + let results = count_query.execute_no_proof(self, transaction, platform_version)?; + // Per-In fan-out: each sub-query returns one entry with + // its branch count (or empty if the branch doesn't exist + // in the index). Treat missing-entry as 0 here — the + // no-proof path is enumerating known-In values and a + // missing entry means "no docs at this value" which the + // executor verified. + let count = results.first().and_then(|entry| entry.count).unwrap_or(0); + merged.insert(key_bytes, count); + } + + // Apply order, then cursor, then limit — same shape as the + // range walker. BTreeMap iteration is already ascending; flip + // the vec if descending was requested. + // + // PerInValue mode splits by the `In` dimension itself, so + // the In value goes in `key` (the split-key field) and + // `in_key` is `None`. The `in_key` field is reserved for + // compound queries where the `In` is on a prefix property + // distinct from the value being counted. + let mut entries: Vec = merged + .into_iter() + .map(|(key, count)| SplitCountEntry { + in_key: None, + key, + // The no-proof per-In fan-out enumerates the caller's + // In array and produces an explicit count per branch + // (zero or otherwise) — always `Some(_)`. + count: Some(count), + }) + .collect(); + if !options.order_by_ascending { + entries.reverse(); + } + // For pagination, callers chunk the `In` array client-side + // (the values are caller-supplied to begin with); no + // server-side cursor is needed or supported. + if let Some(limit) = options.limit { + entries.truncate(limit as usize); + } + Ok(entries) + } +} diff --git a/packages/rs-drive/src/query/drive_document_count_query/executors/point_lookup_proof.rs b/packages/rs-drive/src/query/drive_document_count_query/executors/point_lookup_proof.rs new file mode 100644 index 00000000000..a483f1343d1 --- /dev/null +++ b/packages/rs-drive/src/query/drive_document_count_query/executors/point_lookup_proof.rs @@ -0,0 +1,91 @@ +//! Point-lookup count proof executor for +//! [`super::super::DocumentCountMode::PointLookupProof`] +//! dispatch — `prove = true` count queries with no range clause +//! (Equal/`In` against a `countable: true` index, OR the +//! `documents_countable: true` fast path on empty where). + +use super::super::super::conditions::WhereClause; +use super::super::DriveDocumentCountQuery; +use crate::drive::Drive; +use crate::error::query::QuerySyntaxError; +use crate::error::Error; +use dpp::data_contract::document_type::accessors::DocumentTypeV0Getters; +use dpp::data_contract::document_type::DocumentTypeRef; +use dpp::version::PlatformVersion; +use grovedb::TransactionArg; + +impl Drive { + /// Point-lookup count proof against a `countable: true` + /// index for `prove = true` Equal/`In` count queries, OR — + /// when the where clauses are empty and the document type + /// has `documents_countable: true` — a proof of the type's + /// primary-key CountTree (one merk path proof, O(log n) + /// bytes). + /// + /// In both cases the SDK-side verifier extracts each verified + /// CountTree element's `count_value` directly, no document + /// materialization. + /// + /// Mirrors the no-proof `Total` / `PerInValue` modes' + /// rejection contract: if no `countable: true` index exactly + /// covers the where clauses (and the documents_countable + /// fast path doesn't apply), rejects with + /// `WhereClauseOnNonIndexedProperty`. Same contract on both + /// prove and no-proof paths — no silent fallback. + pub fn execute_document_count_point_lookup_proof( + &self, + contract_id: [u8; 32], + document_type: DocumentTypeRef, + document_type_name: String, + where_clauses: Vec, + transaction: TransactionArg, + platform_version: &PlatformVersion, + ) -> Result, Error> { + use dpp::data_contract::document_type::accessors::DocumentTypeV2Getters; + + // Fast path: unfiltered prove count on a + // `documents_countable: true` document type proves the + // primary-key CountTree element directly. Same path-query + // shape as the index-based case, just rooted at + // `[..., doctype]` instead of inside an index. + if where_clauses.is_empty() && document_type.documents_countable() { + let path_query = DriveDocumentCountQuery::primary_key_count_tree_path_query( + contract_id, + &document_type_name, + ); + let proof = self + .grove + .get_proved_path_query( + &path_query, + None, + transaction, + &platform_version.drive.grove_version, + ) + .unwrap() + .map_err(|e| Error::GroveDB(Box::new(e)))?; + return Ok(proof); + } + + let index = DriveDocumentCountQuery::find_countable_index_for_where_clauses( + document_type.indexes(), + &where_clauses, + ) + .ok_or_else(|| { + Error::Query(QuerySyntaxError::WhereClauseOnNonIndexedProperty( + "prove count requires a `countable: true` index whose properties \ + exactly match the where clause fields, or `documentsCountable: \ + true` on the document type for unfiltered total counts — same \ + requirement as the no-proof path" + .to_string(), + )) + })?; + let count_query = DriveDocumentCountQuery { + document_type, + contract_id, + document_type_name, + index, + where_clauses, + }; + count_query.execute_point_lookup_count_with_proof(self, transaction, platform_version) + } +} diff --git a/packages/rs-drive/src/query/drive_document_count_query/executors/range_aggregate_carrier_proof.rs b/packages/rs-drive/src/query/drive_document_count_query/executors/range_aggregate_carrier_proof.rs new file mode 100644 index 00000000000..4b43b7cc2bf --- /dev/null +++ b/packages/rs-drive/src/query/drive_document_count_query/executors/range_aggregate_carrier_proof.rs @@ -0,0 +1,88 @@ +//! Carrier-ACOR proof executor for +//! [`super::super::DocumentCountMode::RangeAggregateCarrierProof`] +//! dispatch — `prove = true` count queries where the caller asks +//! for one aggregate per outer-key branch via +//! `group_by = [outer_field]`. The outer dimension is either: +//! +//! - An `In` clause on the index's first property (G7 shape — +//! `brand IN[...] AND color > floor`). One Key per In value. +//! - A range clause on the index's first property (G8 shape — +//! `brand > X AND color > floor`, optional `limit`). Single +//! QueryItem bounding the outer walk; `SizedQuery::limit` caps +//! how many outer matches the carrier walks before stopping. +//! +//! Uses grovedb's carrier-subquery composition introduced in +//! [PR #663](https://github.com/dashpay/grovedb/pull/663) and +//! extended in [PR #664](https://github.com/dashpay/grovedb/pull/664) +//! (the latter relaxed the `SizedQuery::limit` rejection for +//! carriers, which is what unblocks the G8 outer-range shape with +//! a useful upper bound). Returns proof bytes that the client +//! verifies via +//! [`grovedb::GroveDb::verify_aggregate_count_query_per_key`], +//! producing `Vec<(outer_key, u64)>` — same per-key aggregate +//! semantics as the no-proof per-In fan-out, just verifiable. + +use super::super::super::conditions::WhereClause; +use super::super::DriveDocumentCountQuery; +use crate::drive::Drive; +use crate::error::query::QuerySyntaxError; +use crate::error::Error; +use dpp::data_contract::document_type::accessors::DocumentTypeV0Getters; +use dpp::data_contract::document_type::DocumentTypeRef; +use dpp::version::PlatformVersion; +use grovedb::TransactionArg; + +impl Drive { + /// Carrier-ACOR proof for `(In OR outer Range) + inner range` + /// with `group_by = [outer_field]`. Returns proof bytes that + /// the client verifies via + /// [`grovedb::GroveDb::verify_aggregate_count_query_per_key`]. + /// + /// `limit` caps the outer walk for the Range-outer (G8) shape; + /// for the In-outer (G7) shape the `|In|` array already bounds + /// the result and `limit` is typically `None`. + /// + /// Sibling executors (`range_distinct_proof`, `range_no_proof`, + /// `per_in_value`) use the same `#[allow]` here — the 8-arg + /// boundary (contract id, doc type, doc type name, where clauses, + /// limit, transaction, platform version) is the established + /// executor signature; refactoring it into a struct would just + /// move the same fields one indirection away. + #[allow(clippy::too_many_arguments)] + pub fn execute_document_count_range_aggregate_carrier_proof( + &self, + contract_id: [u8; 32], + document_type: DocumentTypeRef, + document_type_name: String, + where_clauses: Vec, + limit: Option, + transaction: TransactionArg, + platform_version: &PlatformVersion, + ) -> Result, Error> { + let index = DriveDocumentCountQuery::find_range_countable_index_for_where_clauses( + document_type.indexes(), + &where_clauses, + ) + .ok_or_else(|| { + Error::Query(QuerySyntaxError::WhereClauseOnNonIndexedProperty( + "carrier-aggregate count requires a `range_countable: true` index whose first \ + property carries the outer In or range clause and whose last property \ + carries the inner ACOR range clause" + .to_string(), + )) + })?; + let count_query = DriveDocumentCountQuery { + document_type, + contract_id, + document_type_name, + index, + where_clauses, + }; + count_query.execute_carrier_aggregate_count_with_proof( + self, + limit, + transaction, + platform_version, + ) + } +} diff --git a/packages/rs-drive/src/query/drive_document_count_query/executors/range_distinct_proof.rs b/packages/rs-drive/src/query/drive_document_count_query/executors/range_distinct_proof.rs new file mode 100644 index 00000000000..3a340a22454 --- /dev/null +++ b/packages/rs-drive/src/query/drive_document_count_query/executors/range_distinct_proof.rs @@ -0,0 +1,70 @@ +//! Distinct-range-count proof executor for +//! [`super::super::DocumentCountMode::RangeDistinctProof`] +//! dispatch — `prove = true` count queries with a range clause +//! and non-empty `group_by`. Emits per-distinct-value `KVCount` +//! ops the client verifies via +//! [`drive_proof_verifier::verify_distinct_count_proof`]. + +use super::super::super::conditions::WhereClause; +use super::super::DriveDocumentCountQuery; +use crate::drive::Drive; +use crate::error::query::QuerySyntaxError; +use crate::error::Error; +use dpp::data_contract::document_type::accessors::DocumentTypeV0Getters; +use dpp::data_contract::document_type::DocumentTypeRef; +use dpp::version::PlatformVersion; +use grovedb::TransactionArg; + +impl Drive { + /// Distinct-counts-with-proof companion to + /// [`Self::execute_document_count_range_proof`]. Returns + /// proof bytes that the client verifies via + /// [`drive_proof_verifier::verify_distinct_count_proof`], + /// yielding a `BTreeMap, u64>` keyed by serialized + /// property value. + /// + /// `limit` caps the number of distinct in-range values the + /// proof covers — the dispatcher pre-validates + /// `limit ≤ max_query_limit` so client-side proof + /// reconstruction can use the exact same value without + /// divergence. The SDK reads it back off the request when + /// building the verifier's `PathQuery`. + #[allow(clippy::too_many_arguments)] + pub fn execute_document_count_range_distinct_proof( + &self, + contract_id: [u8; 32], + document_type: DocumentTypeRef, + document_type_name: String, + where_clauses: Vec, + limit: u16, + left_to_right: bool, + transaction: TransactionArg, + platform_version: &PlatformVersion, + ) -> Result, Error> { + let index = DriveDocumentCountQuery::find_range_countable_index_for_where_clauses( + document_type.indexes(), + &where_clauses, + ) + .ok_or_else(|| { + Error::Query(QuerySyntaxError::WhereClauseOnNonIndexedProperty( + "range count requires a `range_countable: true` index whose last \ + property matches the range field" + .to_string(), + )) + })?; + let count_query = DriveDocumentCountQuery { + document_type, + contract_id, + document_type_name, + index, + where_clauses, + }; + count_query.execute_distinct_count_with_proof( + self, + limit, + left_to_right, + transaction, + platform_version, + ) + } +} diff --git a/packages/rs-drive/src/query/drive_document_count_query/executors/range_no_proof.rs b/packages/rs-drive/src/query/drive_document_count_query/executors/range_no_proof.rs new file mode 100644 index 00000000000..4b2e677daf7 --- /dev/null +++ b/packages/rs-drive/src/query/drive_document_count_query/executors/range_no_proof.rs @@ -0,0 +1,54 @@ +//! Range-count executor for +//! [`super::super::DocumentCountMode::RangeNoProof`] dispatch — +//! `prove = false` count queries with a range clause. Returns a +//! summed entry when `options.distinct = false` or per-distinct- +//! value entries when `options.distinct = true`. + +use super::super::super::conditions::WhereClause; +use super::super::execute_range_count::RangeCountOptions; +use super::super::{DriveDocumentCountQuery, SplitCountEntry}; +use crate::drive::Drive; +use crate::error::query::QuerySyntaxError; +use crate::error::Error; +use dpp::data_contract::document_type::accessors::DocumentTypeV0Getters; +use dpp::data_contract::document_type::DocumentTypeRef; +use dpp::version::PlatformVersion; +use grovedb::TransactionArg; + +impl Drive { + /// Range-count walk against a `range_countable` index. + /// Returns a summed entry or per-distinct-value entries + /// depending on `options.distinct`. + #[allow(clippy::too_many_arguments)] + pub fn execute_document_count_range_no_proof( + &self, + contract_id: [u8; 32], + document_type: DocumentTypeRef, + document_type_name: String, + where_clauses: Vec, + options: RangeCountOptions, + transaction: TransactionArg, + platform_version: &PlatformVersion, + ) -> Result, Error> { + let index = DriveDocumentCountQuery::find_range_countable_index_for_where_clauses( + document_type.indexes(), + &where_clauses, + ) + .ok_or_else(|| { + Error::Query(QuerySyntaxError::WhereClauseOnNonIndexedProperty( + "range count requires a `range_countable: true` index whose last \ + property matches the range field, with all other clauses covering \ + its prefix as `==` matches" + .to_string(), + )) + })?; + let count_query = DriveDocumentCountQuery { + document_type, + contract_id, + document_type_name, + index, + where_clauses, + }; + count_query.execute_range_count_no_proof(self, &options, transaction, platform_version) + } +} diff --git a/packages/rs-drive/src/query/drive_document_count_query/executors/range_proof.rs b/packages/rs-drive/src/query/drive_document_count_query/executors/range_proof.rs new file mode 100644 index 00000000000..3436eeae738 --- /dev/null +++ b/packages/rs-drive/src/query/drive_document_count_query/executors/range_proof.rs @@ -0,0 +1,50 @@ +//! Range-count proof executor for +//! [`super::super::DocumentCountMode::RangeProof`] dispatch — +//! `prove = true` count queries with a range clause and empty +//! `group_by`. Uses grovedb's `AggregateCountOnRange` primitive +//! to emit a single u64 verified out of the proof. + +use super::super::super::conditions::WhereClause; +use super::super::DriveDocumentCountQuery; +use crate::drive::Drive; +use crate::error::query::QuerySyntaxError; +use crate::error::Error; +use dpp::data_contract::document_type::accessors::DocumentTypeV0Getters; +use dpp::data_contract::document_type::DocumentTypeRef; +use dpp::version::PlatformVersion; +use grovedb::TransactionArg; + +impl Drive { + /// Range-count proof via grovedb's `AggregateCountOnRange`. + /// Returns proof bytes that the client verifies via + /// `GroveDb::verify_aggregate_count_query`. + pub fn execute_document_count_range_proof( + &self, + contract_id: [u8; 32], + document_type: DocumentTypeRef, + document_type_name: String, + where_clauses: Vec, + transaction: TransactionArg, + platform_version: &PlatformVersion, + ) -> Result, Error> { + let index = DriveDocumentCountQuery::find_range_countable_index_for_where_clauses( + document_type.indexes(), + &where_clauses, + ) + .ok_or_else(|| { + Error::Query(QuerySyntaxError::WhereClauseOnNonIndexedProperty( + "range count requires a `range_countable: true` index whose last \ + property matches the range field" + .to_string(), + )) + })?; + let count_query = DriveDocumentCountQuery { + document_type, + contract_id, + document_type_name, + index, + where_clauses, + }; + count_query.execute_aggregate_count_with_proof(self, transaction, platform_version) + } +} diff --git a/packages/rs-drive/src/query/drive_document_count_query/executors/total.rs b/packages/rs-drive/src/query/drive_document_count_query/executors/total.rs new file mode 100644 index 00000000000..6a00660b4c5 --- /dev/null +++ b/packages/rs-drive/src/query/drive_document_count_query/executors/total.rs @@ -0,0 +1,114 @@ +//! Total-count executor for [`super::super::DocumentCountMode::Total`] +//! dispatch — `prove = false` count queries without a range clause. + +use super::super::super::conditions::WhereClause; +use super::super::{DriveDocumentCountQuery, SplitCountEntry}; +use crate::drive::Drive; +use crate::error::query::QuerySyntaxError; +use crate::error::Error; +use dpp::data_contract::document_type::DocumentTypeRef; +use dpp::version::PlatformVersion; +use grovedb::TransactionArg; + +impl Drive { + /// Total count for the given where clauses against an exactly- + /// covering countable index, OR — when the where clauses are + /// empty and the document type has `documents_countable: true` — + /// the type's primary-key CountTree (O(1) read at the doctype + /// tree's root). + /// + /// Single summed entry with empty key. + pub fn execute_document_count_total_no_proof( + &self, + contract_id: [u8; 32], + document_type: DocumentTypeRef, + document_type_name: String, + where_clauses: Vec, + transaction: TransactionArg, + platform_version: &PlatformVersion, + ) -> Result, Error> { + use dpp::data_contract::document_type::accessors::{ + DocumentTypeV0Getters, DocumentTypeV2Getters, + }; + + // Fast path: unfiltered total count on a `documents_countable: + // true` document type reads the primary-key CountTree directly + // (O(1)). No index needed — the doctype tree itself carries + // the count. + if where_clauses.is_empty() && document_type.documents_countable() { + let count = self.read_primary_key_count_tree( + &contract_id, + &document_type_name, + transaction, + platform_version, + )?; + return Ok(vec![SplitCountEntry { + in_key: None, + key: vec![], + // `documents_countable` fast path: we read the + // CountTree directly and got an explicit count, so + // this is a verified `Some(_)` (possibly `Some(0)` + // for an empty doctype). + count: Some(count), + }]); + } + + let index = DriveDocumentCountQuery::find_countable_index_for_where_clauses( + document_type.indexes(), + &where_clauses, + ) + .ok_or_else(|| { + Error::Query(QuerySyntaxError::WhereClauseOnNonIndexedProperty( + "count query requires a `countable: true` index whose properties \ + exactly match the where clause fields, or `documentsCountable: \ + true` on the document type for unfiltered total counts" + .to_string(), + )) + })?; + let count_query = DriveDocumentCountQuery { + document_type, + contract_id, + document_type_name, + index, + where_clauses, + }; + count_query.execute_no_proof(self, transaction, platform_version) + } + + /// Reads the document-type primary-key tree's `CountTree` element + /// (`[contract_doc, contract_id, [1], doctype, 0]`) and returns + /// `count_value_or_default()`. Used by the `documents_countable: + /// true` fast path on the total-count flow. + /// + /// Returns 0 when the element doesn't exist (e.g. fresh contract + /// with no documents inserted). Caller is responsible for ensuring + /// `documents_countable` is set on the document type before + /// calling — without it the element at `[..., doctype, 0]` is a + /// regular `NormalTree` and `count_value_or_default()` returns 0 + /// regardless of how many documents the type actually has. + pub(super) fn read_primary_key_count_tree( + &self, + contract_id: &[u8; 32], + document_type_name: &str, + transaction: TransactionArg, + platform_version: &PlatformVersion, + ) -> Result { + let drive_version = &platform_version.drive; + let path = [ + &[crate::drive::RootTree::DataContractDocuments as u8] as &[u8], + contract_id, + &[1u8], + document_type_name.as_bytes(), + ]; + let mut drive_operations = vec![]; + let element = self.grove_get_raw_optional( + grovedb_path::SubtreePath::from(path.as_slice()), + &[0], + crate::util::grove_operations::DirectQueryType::StatefulDirectQuery, + transaction, + &mut drive_operations, + drive_version, + )?; + Ok(element.map_or(0, |e| e.count_value_or_default())) + } +} diff --git a/packages/rs-drive/src/query/drive_document_count_query/index_picker.rs b/packages/rs-drive/src/query/drive_document_count_query/index_picker.rs index 002f2e38587..30ff6ed939c 100644 --- a/packages/rs-drive/src/query/drive_document_count_query/index_picker.rs +++ b/packages/rs-drive/src/query/drive_document_count_query/index_picker.rs @@ -101,10 +101,36 @@ impl DriveDocumentCountQuery<'_> { .iter() .filter(|wc| Self::is_range_operator(wc.operator)) .collect(); - if range_clauses.len() != 1 { - return None; - } - let range_clause = range_clauses[0]; + // Accept either: + // - 1 range clause (Q7 / G4 / G5 / G7 — the range is the + // terminator; prefix props use `==` or `In`). + // - 2 range clauses on distinct fields (G8 — outer range on + // an index prefix property, inner range on the terminator; + // the carrier-aggregate proof shape introduced by grovedb + // PR #664). + let (outer_range_field, terminator_range_clause) = match range_clauses.len() { + 1 => (None, range_clauses[0]), + 2 => { + // The two ranges must be on different fields — same- + // field two-sided ranges are flattened by the parser + // into `between*` and arrive with one clause. + if range_clauses[0].field == range_clauses[1].field { + return None; + } + // One of the two must be on an index's terminator; the + // other becomes the outer carrier dimension. We pick + // the terminator below by walking each candidate + // index's property order — defer choosing here. + ( + Some(( + range_clauses[0].field.as_str(), + range_clauses[1].field.as_str(), + )), + range_clauses[0], // placeholder, refined per-index below + ) + } + _ => return None, + }; // Reject any operator that's neither indexable (Equal/In) nor a // range operator — anything else has no defined count semantics. @@ -125,8 +151,45 @@ impl DriveDocumentCountQuery<'_> { continue; } - // Walk the index properties: prefix matches must come first, - // followed by the range property as the LAST element. + // For the two-range case, the terminator's field must be + // one of the two range fields, and the other range field + // must be the index's first property (the carrier + // dimension). + if let Some((field_a, field_b)) = outer_range_field { + let terminator = index.properties.last()?; + let first = index.properties.first()?; + // Determine which range field is the terminator. + let (outer_field, _terminator_field) = if terminator.name == field_a { + (field_b, field_a) + } else if terminator.name == field_b { + (field_a, field_b) + } else { + continue; + }; + if first.name != outer_field { + continue; + } + // Any Equal/In prefix clauses must sit between the + // first (outer-range) and last (terminator-range) + // properties. For the widget contract there are no + // such middle properties on byBrandColor, but the + // builder handles the general case. + let mut intermediate_props_ok = true; + for prop in &index.properties[1..index.properties.len() - 1] { + if !prefix_fields.contains(prop.name.as_str()) { + intermediate_props_ok = false; + break; + } + } + if intermediate_props_ok { + return Some(index); + } + continue; + } + + // Single-range case (the original logic): prefix matches + // must come first, followed by the range property as the + // LAST element. let mut prefix_len = 0usize; for prop in &index.properties { if prefix_fields.contains(prop.name.as_str()) { @@ -143,7 +206,7 @@ impl DriveDocumentCountQuery<'_> { continue; } let range_prop = &index.properties[prefix_len]; - if range_prop.name == range_clause.field { + if range_prop.name == terminator_range_clause.field { return Some(index); } } diff --git a/packages/rs-drive/src/query/drive_document_count_query/mod.rs b/packages/rs-drive/src/query/drive_document_count_query/mod.rs index d7eb5e688f6..a30ed37ed02 100644 --- a/packages/rs-drive/src/query/drive_document_count_query/mod.rs +++ b/packages/rs-drive/src/query/drive_document_count_query/mod.rs @@ -45,12 +45,87 @@ pub mod drive_dispatcher; pub mod execute_point_lookup; #[cfg(feature = "server")] pub mod execute_range_count; +#[cfg(feature = "server")] +pub mod executors; #[cfg(feature = "server")] pub use drive_dispatcher::{DocumentCountRequest, DocumentCountResponse}; #[cfg(feature = "server")] pub use execute_range_count::RangeCountOptions; +/// Hard cap on entries the count fan-out arms ask the executor +/// to return. +/// +/// Count fan-out (`PerInValue`, and the Aggregate + range +/// sub-case of `RangeNoProof`) emits at most one entry per `In` +/// value, and `In` is structurally capped at 100 by +/// [`super::conditions::WhereClause::in_values`]. This cap sits +/// well above the real bound. Two reasons to pin it explicitly +/// instead of leaning on the operator-tunable +/// `default_query_limit`: +/// +/// 1. `default_query_limit` is a documents-fetch knob — applying +/// it to count fan-out can truncate aggregate sums below |In| +/// under tighter operator tuning, silently producing wrong +/// totals. +/// 2. Pinning a number here keeps the dispatcher's correctness +/// independent of operator configuration. +/// +/// `1024` is high enough that the cap never fires under the +/// current `WhereClause::in_values` policy. If a future code +/// change makes it reachable, treat that as a signal to revisit +/// the bound before raising the constant. +/// +/// # Pattern: failsafe cap for structurally-bounded ops +/// +/// This is the prototype of a small project convention: when an +/// executor-level operation has a structural upper bound enforced +/// upstream (here, `WhereClause::in_values()`'s 100-cap on the In +/// array), pin a failsafe cap at the executor boundary that sits +/// well above the upstream bound rather than reusing an unrelated +/// operator-tunable limit. The failsafe never fires under the +/// upstream constraint — it exists to (a) keep behavior +/// independent of operator config, and (b) localize the blast +/// radius if the upstream constraint ever loosens. Constants +/// added under this pattern should follow the +/// `MAX__AS_FAILSAFE` naming so the role is visible +/// at the use site. +#[cfg(feature = "server")] +pub const MAX_LIMIT_AS_FAILSAFE: u32 = 1024; + +/// Platform-wide **maximum** outer-walk cap for carrier-aggregate +/// range-outer proofs (chapter 30 G8: `outer_range_field > X AND +/// inner_acor_field > Y` with `group_by = [outer_range_field]` and +/// `prove = true`). +/// +/// The cap bounds the proof size: bytes grow linearly with the +/// number of outer matches (~1 700 B per outer key in this +/// chapter's widget fixture; `10 × 1 700 B ≈ 17 KB` worst case). +/// 10 keeps the worst-case proof comfortably inside Tier-1 of the +/// visualizer's shareable-link guidance (< 20 KB). +/// +/// **Caller semantics:** +/// - `request.limit = None` → server uses `MAX_CARRIER_AGGREGATE_OUTER_RANGE_LIMIT` +/// (the default). +/// - `request.limit = Some(n)` with `n ≤ MAX_CARRIER_AGGREGATE_OUTER_RANGE_LIMIT` +/// → accepted; the dispatcher passes `n` through to +/// `SizedQuery::limit` so the prover walks exactly `n` outer matches. +/// - `request.limit = Some(n)` with `n > MAX_CARRIER_AGGREGATE_OUTER_RANGE_LIMIT` +/// → rejected with `InvalidLimit`. The cap is a hard ceiling: callers +/// that want more results must call repeatedly with disjoint +/// outer-range windows. +/// +/// Why the ceiling is a hardcoded compile-time constant rather +/// than `drive_config.max_query_limit` (the operator-tunable +/// runtime value): on the prove path, `SizedQuery::limit` is +/// part of the serialized `PathQuery` and feeds the merk-root +/// reconstruction. Anchoring the ceiling to a compile-time +/// constant guarantees prover and verifier agree on what the +/// "default when None" value is, regardless of operator config +/// (same rationale as `RangeDistinctProof`'s use of +/// `crate::config::DEFAULT_QUERY_LIMIT`). +pub const MAX_CARRIER_AGGREGATE_OUTER_RANGE_LIMIT: u16 = 10; + #[cfg(feature = "server")] #[cfg(test)] mod tests; @@ -99,18 +174,142 @@ pub struct SplitCountEntry { pub key: Vec, /// The count of documents matching this `(in_key, key)` tuple /// (or just `key` for flat queries). - pub count: u64, + /// + /// Three-valued by design: + /// - `Some(n)` with `n > 0` — verified count for an entry the + /// underlying data path materialized. + /// - `Some(0)` — caller queried this branch and the executor + /// confirmed zero matching documents. Emitted by the no-proof + /// point-lookup path's aggregated total wrapper (a single + /// summed entry whose value can be 0) and by the no-proof range + /// executors when their walk returns nothing. Not emitted + /// per-In-branch under the current shape — see `None` below. + /// - `None` — reserved for a future absence-proof variant. The + /// current `point_lookup_count_path_query` doesn't set + /// `absence_proofs_for_non_existing_searched_keys: true`, so + /// absent In branches are **omitted from the verified entry + /// list entirely** (grovedb's `verify_query` doesn't surface + /// `(path, key, None)` triples for them). Callers that need to + /// distinguish "queried but absent" diff the request's In array + /// against the returned entries by key. The variant exists in + /// the type signature so a future path-query change that flips + /// the flag surfaces absences via `count: None` without a + /// breaking struct change — distinguishable from `Some(0)` + /// (which a zero-count CountTree could never produce on its own + /// since zero-count CountTrees aren't materialized in merk). + pub count: Option, +} + +/// SQL-shaped count-query mode — names the response shape the +/// caller asked for via `(select, group_by)` on the wire. +/// +/// **Two count-mode enums coexist in this module.** This one names +/// the *output shape* the request produces (single aggregate vs +/// per-group entries). [`DocumentCountMode`] below names the +/// *executor strategy* (which proof primitive / which walk path +/// Drive uses to compute that shape). `CountMode` lives on +/// [`DocumentCountRequest`] as the caller-supplied contract; +/// `DocumentCountMode` is derived from `(CountMode, where_clauses, +/// prove)` by [`DriveDocumentCountQuery::detect_mode`] just before +/// dispatch. +/// +/// The invariants below are enforced upstream (in drive-abci's +/// `validate_and_route`) before a `DocumentCountRequest` is built. +/// They're documented here so any new caller knows the +/// shape-validity contract attached to each variant. +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum CountMode { + /// `select=COUNT, group_by=[]`. Single u64 result. + /// + /// Where-clause shapes accepted: + /// - empty (relies on a `documentsCountable: true` doctype), + /// - Equal-only (fully covered by a `countable: true` index), + /// - one `In` (per-In fan-out, summed server-side), + /// - one range (uses `AggregateCountOnRange` for prove, + /// `RangeNoProof` for no-proof), + /// - one `In` + one range on the no-proof path (per-In fan-out + /// each doing a range walk; prove is rejected). + /// + /// `limit` is structurally meaningless (aggregate is one row) + /// and is rejected upstream when set. + Aggregate, + + /// `select=COUNT, group_by=[in_field]`. One entry per `In` value. + /// + /// Where-clause invariants: exactly one `In` clause whose field + /// matches `group_by[0]`; no range clause. + /// + /// `limit` is rejected upstream when set. The In array is + /// already capped at 100 entries by `WhereClause::in_values()`, + /// so the result size is bounded by construction; a separate + /// `limit` would either be redundant (≤ 100) or would silently + /// truncate the proof to fewer In branches than the caller + /// asked for (because the PointLookupProof path can't represent + /// a partial-In-array selection in its `SizedQuery`). Callers + /// that want fewer branches narrow the In array directly. + GroupByIn, + + /// `select=COUNT, group_by=[range_field]`. One entry per distinct + /// value within the range. + /// + /// Where-clause invariants: exactly one range clause whose field + /// matches `group_by[0]`; no `In` clause. + /// `limit` caps the number of distinct values; on the prove + /// path it's validated-not-clamped (oversized values rejected + /// with `InvalidLimit`). + GroupByRange, + + /// `select=COUNT, group_by=[in_field, range_field]`. One entry + /// per `(in_key, range_key)` pair. + /// + /// Where-clause invariants: exactly one `In` clause on `group_by[0]` + /// AND exactly one range clause on `group_by[1]`. + /// `limit` is a **global cap on the emitted `(in_key, key)` lex + /// stream**, not per-In-branch. The executor pushes a single + /// `SizedQuery::limit` over the compound walk, so a request + /// with `|In| = 3` and `limit = 5` returns at most 5 entries + /// total across all In branches (ordered by `(in_key, key)`, + /// direction from the first `order_by` clause). On the prove + /// path it's validated-not-clamped (oversized values rejected + /// with `InvalidLimit`). + GroupByCompound, +} + +impl CountMode { + /// `true` for [`Self::Aggregate`] (single-row response); + /// `false` for the three grouped variants. See each variant's + /// docstring for the per-shape semantics. + pub fn is_aggregate(self) -> bool { + matches!(self, Self::Aggregate) + } + + /// `true` for [`Self::GroupByRange`] and [`Self::GroupByCompound`] + /// — the two variants whose proof shape requires per-distinct- + /// value `KVCount` ops. See each variant's docstring for the + /// per-shape proof routing. + pub fn requires_distinct_walk(self) -> bool { + matches!(self, Self::GroupByRange | Self::GroupByCompound) + } + + /// `true` for [`Self::GroupByRange`] and [`Self::GroupByCompound`] + /// — the two variants whose result size isn't structurally + /// bounded. [`Self::Aggregate`] and [`Self::GroupByIn`] reject + /// `limit` upstream; see each variant's docstring for the + /// per-shape reasoning. + pub fn accepts_limit(self) -> bool { + matches!(self, Self::GroupByRange | Self::GroupByCompound) + } } /// Classification of a count query's shape, used to dispatch to the /// right executor. Returned by /// [`DriveDocumentCountQuery::detect_mode`]. /// -/// The discriminator is purely a function of the where-clause operators -/// + request flags (`return_distinct_counts_in_range`, `prove`); it -/// does not depend on the contract's index set. Picking a covering -/// index for the chosen mode is a separate step that requires the -/// document type's `BTreeMap`. +/// The discriminator is purely a function of the where-clause +/// operators + the caller's [`CountMode`] + `prove`; it does not +/// depend on the contract's index set. Picking a covering index for +/// the chosen mode is a separate step that requires the document +/// type's `BTreeMap`. #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum DocumentCountMode { /// No range, no `In` — single summed entry with empty key. Reads @@ -122,19 +321,22 @@ pub enum DocumentCountMode { PerInValue, /// Exactly one range clause, no proof — walks the property-name /// `ProvableCountTree`'s children inside the range. Returns either - /// a single summed entry or per-distinct-value entries depending on - /// `return_distinct_counts_in_range`. + /// a single summed entry or per-distinct-value entries depending + /// on whether the caller's [`CountMode`] requires a distinct walk + /// ([`CountMode::GroupByRange`] / [`CountMode::GroupByCompound`]) + /// or not ([`CountMode::Aggregate`]). RangeNoProof, /// Exactly one range clause + `prove = true` + - /// `return_distinct_counts_in_range = false` — produces a grovedb + /// [`CountMode::Aggregate`] — produces a grovedb /// `AggregateCountOnRange` proof that verifies to a single u64. /// The merk-level primitive returns one aggregate; per-distinct- /// value entries with proof go through [`Self::RangeDistinctProof`] /// instead. RangeProof, /// Exactly one range clause + `prove = true` + - /// `return_distinct_counts_in_range = true` — produces a regular - /// range proof against the property-name `ProvableCountTree`. The + /// [`CountMode::GroupByRange`] or [`CountMode::GroupByCompound`] + /// — produces a regular range proof against the property-name + /// `ProvableCountTree`. The /// proof's `KVCount(key, value, count)` ops carry per-distinct- /// value counts, each cryptographically committed via /// `node_hash_with_count` to the merk root. The verifier walks the @@ -157,4 +359,34 @@ pub enum DocumentCountMode { /// the merk-level `count_value` IS the result, the SDK /// extracts it via `verify_point_lookup_count_proof`. PointLookupProof, + /// Exactly one `In` clause + one range clause + `prove = true` + /// + [`CountMode::GroupByIn`] — produces a grovedb carrier + /// `AggregateCountOnRange` proof: one outer-key descent per + /// `In` value, each terminating in an ACOR boundary walk over + /// the per-branch range subtree. Returns one `(in_key, u64)` + /// pair per resolved In branch — same per-key aggregate + /// semantics as the no-proof per-In fan-out, just verifiable. + /// + /// Proof size is `O(|In values| · (log B + log C'))` where `B` + /// is the In-property's distinct-value count and `C'` is the + /// terminator subtree's distinct-value count. Smaller than the + /// alternative [`Self::RangeDistinctProof`] (which scales with + /// the number of distinct in-range terminator values per + /// branch, not per-branch log-bound boundary nodes) and + /// preserves per-In aggregate granularity that GROUP BY + /// `[in_field, range_field]` can't express. + /// + /// Path-query shape (see + /// [`DriveDocumentCountQuery::carrier_aggregate_count_path_query`]): + /// outer Keys = serialized In values; subquery_path = ranged + /// property name; subquery = ACOR(range). Verified via + /// [`grovedb::GroveDb::verify_aggregate_count_query_per_key`] + /// (returns `Vec<(Vec, u64)>`). + /// + /// Enabled by grovedb PR #663 ("allow AggregateCountOnRange as + /// carrier subquery"). Before that PR this shape was rejected + /// in [`Self::detect_mode`] with the message "range count + /// queries with an `in` clause are not supported on the + /// aggregate prove path". + RangeAggregateCarrierProof, } diff --git a/packages/rs-drive/src/query/drive_document_count_query/mode_detection.rs b/packages/rs-drive/src/query/drive_document_count_query/mode_detection.rs index 5e864c59e73..7d68968ac83 100644 --- a/packages/rs-drive/src/query/drive_document_count_query/mode_detection.rs +++ b/packages/rs-drive/src/query/drive_document_count_query/mode_detection.rs @@ -6,7 +6,7 @@ //! attempting verification). use super::super::conditions::{WhereClause, WhereOperator}; -use super::{DocumentCountMode, DriveDocumentCountQuery}; +use super::{CountMode, DocumentCountMode, DriveDocumentCountQuery}; #[cfg(any(feature = "server", feature = "verify"))] use crate::error::query::QuerySyntaxError; @@ -56,12 +56,14 @@ impl DriveDocumentCountQuery<'_> { /// Classify a count query's mode from its where clauses + request flags. /// - /// This is the protocol-version-agnostic shape detection that decides - /// which executor (Equal/In point lookup, range walk, range proof, - /// materialize-and-count proof, etc.) the request maps to. The - /// returned [`DocumentCountMode`] discriminates among the handler's - /// dispatch arms; concrete pagination / index-picker inputs still - /// flow through the call sites separately. + /// This is the protocol-version-agnostic shape detection that + /// decides which executor (one of the six + /// [`DocumentCountMode`] variants — `Total` / `PerInValue` / + /// `RangeNoProof` / `RangeProof` / `RangeDistinctProof` / + /// `PointLookupProof`) the request maps to. The returned + /// `DocumentCountMode` discriminates among the dispatcher's + /// match arms; concrete pagination / index-picker inputs flow + /// through the call sites separately. /// /// All validation that depends only on the where clauses + flags /// (multiple range clauses, range mixed with `In`, distinct mode on @@ -74,9 +76,16 @@ impl DriveDocumentCountQuery<'_> { #[cfg(any(feature = "server", feature = "verify"))] pub fn detect_mode( where_clauses: &[WhereClause], - return_distinct_counts_in_range: bool, + mode: CountMode, prove: bool, ) -> Result { + // The caller-supplied `CountMode` is the SQL-shape contract + // (Aggregate / GroupByIn / GroupByRange / GroupByCompound). + // Translate it back to the "distinct walk required?" boolean + // the per-mode tuple match below was written against. Pure + // mechanical mapping: the distinct walk is what the two + // range-grouped variants need. + let distinct = mode.requires_distinct_walk(); // Reject any operator that's neither an indexable point operator // (Equal/In) nor a range operator. Defense-in-depth: the request // shape forbids these elsewhere, but folding the check in here @@ -104,11 +113,40 @@ impl DriveDocumentCountQuery<'_> { .filter(|wc| wc.operator == WhereOperator::In) .count(); + // `range_count > 1` is rejected for every shape EXCEPT the + // carrier-ACOR with outer range (G8): when the caller asks + // for `GroupByRange` + `prove = true` and there are exactly + // two range clauses on different fields (one on the index's + // first property — the carrier — and one on the terminator — + // the inner ACOR), grovedb's carrier-subquery composition + // ([PR #663](https://github.com/dashpay/grovedb/pull/663) + // shipped the carrier shape; [PR #664](https://github.com/dashpay/grovedb/pull/664) + // permits `SizedQuery::limit` on it) makes this a well-formed + // single-proof shape. The two ranges must be on distinct + // fields — combining two-sided ranges on the same field still + // routes through `between*` as before. if range_count > 1 { - return Err(QuerySyntaxError::InvalidWhereClauseComponents( - "count query supports at most one range where-clause; combine \ - two-sided ranges via `between*` instead of separate `>` / `<` clauses", - )); + let two_ranges_on_distinct_fields = where_clauses + .iter() + .filter(|wc| Self::is_range_operator(wc.operator)) + .map(|wc| wc.field.as_str()) + .collect::>() + .len() + == range_count; + if !(prove + && matches!(mode, CountMode::GroupByRange) + && range_count == 2 + && in_count == 0 + && two_ranges_on_distinct_fields) + { + return Err(QuerySyntaxError::InvalidWhereClauseComponents( + "count query supports at most one range where-clause; combine \ + two-sided ranges via `between*` instead of separate `>` / `<` \ + clauses, or use `group_by = [outer_range_field]` with `prove = \ + true` for the carrier-aggregate shape with one outer range and \ + one inner ACOR range on a different field", + )); + } } if in_count > 1 { return Err(QuerySyntaxError::InvalidWhereClauseComponents( @@ -120,77 +158,109 @@ impl DriveDocumentCountQuery<'_> { let has_range = range_count == 1; let has_in = in_count == 1; - // `range + In` is only rejected on the aggregate prove path - // (grovedb's `AggregateCountOnRange` primitive wraps a single - // inner range and can't cartesian-fork over multiple In - // values at the merk layer — see the comment on - // `aggregate_count_path_query`). For distinct modes (both - // no-proof and prove) and for total-range-no-proof, the - // `distinct_count_path_query` builder handles In on prefix - // via grovedb's native subquery primitive. - if has_range && has_in && prove && !return_distinct_counts_in_range { + // `range + In` on the prove path used to be rejected + // wholesale because grovedb's `AggregateCountOnRange` + // primitive wraps a single inner range and historically + // couldn't cartesian-fork. As of grovedb PR #663 it CAN + // appear under outer `Keys` via the carrier-subquery + // composition, so the rejection is now conditional: + // - `CountMode::GroupByIn` (single-field group_by on the + // In field): routes to the new + // `DocumentCountMode::RangeAggregateCarrierProof` — + // produces one (in_key, u64) pair per In branch via a + // carrier-ACOR PathQuery (see + // [`super::path_query::carrier_aggregate_count_path_query`]). + // - `CountMode::GroupByRange` / `GroupByCompound` (distinct + // modes): route to `RangeDistinctProof` as before. + // - `CountMode::Aggregate` (no group_by): still rejected. + // With no group_by the caller asks for a single summed + // count across all In branches, but the carrier-ACOR + // primitive returns one count per branch — collapsing + // that back to a single sum at the verifier requires + // trusting the SDK to add them, which is exactly what + // the prove path is supposed to avoid (the verifier + // should get the consensus-committed answer, not + // compute a derived one). + if has_range && has_in && prove && !distinct && !matches!(mode, CountMode::GroupByIn) { return Err(QuerySyntaxError::InvalidWhereClauseComponents( "range count queries with an `in` clause are not supported on the \ - aggregate prove path; use `return_distinct_counts_in_range = true` \ - for compound In-on-prefix prove queries, or `prove = false` for the \ - no-proof variant", + aggregate prove path; use `group_by = [in_field]` for the carrier \ + per-In-aggregate proof (one u64 per branch), `group_by = [in_field, \ + range_field]` for the compound distinct-prove path (per-distinct-\ + value entries), or `prove = false` for the no-proof variant", )); } - if return_distinct_counts_in_range && !has_range { + if distinct && !has_range && range_count != 2 { return Err(QuerySyntaxError::InvalidWhereClauseComponents( - "return_distinct_counts_in_range requires a range where-clause", + "GROUP BY on a range field requires a range where-clause; the \ + range field must appear in `where` for the distinct walk to \ + have a window to iterate over", )); } - Ok( - match (has_range, has_in, prove, return_distinct_counts_in_range) { - // Range + prove + distinct (with or without In on - // prefix): per-distinct-value counts come from a - // regular range proof against the property-name - // `ProvableCountTree`. With In on prefix the path - // query uses grovedb's subquery primitive to - // cartesian-fork; the verifier walks the same - // compound shape. - (true, _, true, true) => DocumentCountMode::RangeDistinctProof, - // Range + prove + summed (no In): `AggregateCountOnRange` - // collapse — single u64 verified out. The In case is - // rejected above. - (true, false, true, false) => DocumentCountMode::RangeProof, - // Range + no-proof: the executor uses the same - // `distinct_count_path_query` builder; In on prefix - // forks via grovedb subquery at execution time. Sum - // vs. distinct comes from `RangeCountOptions.distinct` - // applied to the merged result. - (true, _, false, _) => DocumentCountMode::RangeNoProof, - (false, true, false, _) => DocumentCountMode::PerInValue, - // `In` + `prove = true` (no range): route to the - // CountTree-element proof path. The shared - // `point_lookup_count_path_query` builder emits one - // `Element::CountTree` per matched In branch (via - // outer `Key`s + `[0]` subquery); the SDK's - // `verify_point_lookup_count_proof` extracts - // `count_value_or_default()` from each verified - // element and the `FromProof` - // for `DocumentSplitCounts` returns them as - // per-In-value entries. Proof size is O(|In values| - // × log n) — no document materialization, no - // `u16::MAX` cap on matching docs. - (false, true, true, _) => DocumentCountMode::PointLookupProof, - // No range, no In, `prove = true`: same CountTree- - // element proof shape — either the documents_countable - // primary-key CountTree fast path (empty where) or - // a single per-branch CountTree element for an - // Equal-only fully-covered query. - (false, false, true, _) => DocumentCountMode::PointLookupProof, - (false, false, false, _) => DocumentCountMode::Total, - // (true, true, true, false) — range + In on the - // aggregate prove path — is rejected by the - // explicit early check above. - (true, true, true, false) => unreachable!( - "range + In + prove + !distinct is rejected before the dispatch match" - ), - }, - ) + // G8 short-circuit: `GroupByRange + prove` with exactly two + // range clauses on distinct fields routes to the carrier + // ACOR shape. One range becomes the outer dimension of the + // carrier walk; the other range becomes the inner ACOR + // target. `SizedQuery::limit` caps the outer walk (per + // [grovedb PR #664](https://github.com/dashpay/grovedb/pull/664)). + // The validity of "which range is the outer / which is the + // inner" depends on the picked index — checked in the + // path-query builder against the index's property order. + if prove && matches!(mode, CountMode::GroupByRange) && range_count == 2 && in_count == 0 { + return Ok(DocumentCountMode::RangeAggregateCarrierProof); + } + + Ok(match (has_range, has_in, prove, distinct) { + // Range + prove + distinct (with or without In on + // prefix): per-distinct-value counts come from a + // regular range proof against the property-name + // `ProvableCountTree`. With In on prefix the path + // query uses grovedb's subquery primitive to + // cartesian-fork; the verifier walks the same + // compound shape. + (true, _, true, true) => DocumentCountMode::RangeDistinctProof, + // Range + prove + summed (no In): `AggregateCountOnRange` + // collapse — single u64 verified out. The In case is + // rejected above. + (true, false, true, false) => DocumentCountMode::RangeProof, + // Range + no-proof: the executor uses the same + // `distinct_count_path_query` builder; In on prefix + // forks via grovedb subquery at execution time. Sum + // vs. distinct comes from `RangeCountOptions.distinct` + // applied to the merged result. + (true, _, false, _) => DocumentCountMode::RangeNoProof, + (false, true, false, _) => DocumentCountMode::PerInValue, + // `In` + `prove = true` (no range): route to the + // CountTree-element proof path. The shared + // `point_lookup_count_path_query` builder emits one + // `Element::CountTree` per matched In branch (via + // outer `Key`s + `[0]` subquery); the SDK's + // `verify_point_lookup_count_proof` extracts + // `count_value_or_default()` from each verified + // element, and the `FromProof` impl + // for `DocumentSplitCounts` returns them as + // per-In-value entries. Proof size is O(|In values| + // × log n) — no document materialization, no + // `u16::MAX` cap on matching docs. + (false, true, true, _) => DocumentCountMode::PointLookupProof, + // No range, no In, `prove = true`: same CountTree- + // element proof shape — either the documents_countable + // primary-key CountTree fast path (empty where) or + // a single per-branch CountTree element for an + // Equal-only fully-covered query. + (false, false, true, _) => DocumentCountMode::PointLookupProof, + (false, false, false, _) => DocumentCountMode::Total, + // Range + In + prove + !distinct: the GroupByIn case + // routes to the new carrier-ACOR proof shape (grovedb + // PR #663); the Aggregate case is rejected above. + (true, true, true, false) if matches!(mode, CountMode::GroupByIn) => { + DocumentCountMode::RangeAggregateCarrierProof + } + (true, true, true, false) => { + unreachable!("range + In + prove + Aggregate is rejected before the dispatch match") + } + }) } } diff --git a/packages/rs-drive/src/query/drive_document_count_query/path_query.rs b/packages/rs-drive/src/query/drive_document_count_query/path_query.rs index 37ad8ac8378..a536c900b0f 100644 --- a/packages/rs-drive/src/query/drive_document_count_query/path_query.rs +++ b/packages/rs-drive/src/query/drive_document_count_query/path_query.rs @@ -164,9 +164,10 @@ impl DriveDocumentCountQuery<'_> { /// /// Shared between the server-side prove path /// ([`Self::execute_aggregate_count_with_proof`]) and the client- - /// side verify path (the SDK's `FromProof` for - /// `DocumentCount`). Both sides must produce the *exact same* - /// `PathQuery` for verification to recompute the same merk root. + /// side verify path (the SDK's `FromProof` for + /// `DocumentCount`, via the shared `verify_aggregate_count` + /// helper). Both sides must produce the *exact same* `PathQuery` + /// for verification to recompute the same merk root. /// /// Aggregate-count specifically restricts prefix props to `Equal`: /// grovedb's `AggregateCountOnRange` primitive wraps a *single* @@ -217,8 +218,8 @@ impl DriveDocumentCountQuery<'_> { return Err(Error::Query( QuerySyntaxError::InvalidWhereClauseComponents( "aggregate-count proof: prefix properties must use `==` (no `in`); \ - use `return_distinct_counts_in_range = true` for compound In-on-prefix \ - queries", + use a two-field `group_by = [in_field, range_field]` for compound \ + In-on-prefix queries", ), )); } @@ -244,6 +245,219 @@ impl DriveDocumentCountQuery<'_> { Ok(PathQuery::new_aggregate_count_on_range(path, query_item)) } + /// Build the grovedb `PathQuery` for a **carrier** + /// `AggregateCountOnRange` proof — one outer Key per `In` + /// value, each terminating in an ACOR boundary walk over the + /// per-branch range subtree. Returns one `(in_key, u64)` pair + /// per resolved In branch via + /// [`grovedb::GroveDb::query_aggregate_count_per_key`] (no- + /// proof) and + /// [`grovedb::GroveDb::verify_aggregate_count_query_per_key`] + /// (verify). + /// + /// Required where-clause shape (validated upstream by + /// [`Self::detect_mode`] routing to + /// [`DocumentCountMode::RangeAggregateCarrierProof`]): + /// - Exactly one `In` clause on the In-property + /// - Exactly one range clause on the *terminator* property of + /// a `range_countable: true` index whose first property is + /// the In-property + /// - Any prefix properties between In and range must use + /// `==` (mirror of [`Self::aggregate_count_path_query`]'s + /// non-In prefix rule) + /// + /// Path-query structure: + /// - Outer path stops one level above the In-bearing property + /// subtree's children (`@/doc_prefix/0x01/doctype/`). + /// - Outer Query: `Key(in_value_0)`, `Key(in_value_1)`, … in + /// lex-asc serialized order (grovedb's multi-key walker + /// invariant). + /// - `subquery_path`: the terminator property name (and any + /// trailing `==` clause names between In and range, in + /// index order). + /// - `subquery`: `Query::new_aggregate_count_on_range(range_item)`. + /// + /// Enabled by [grovedb PR #663](https://github.com/dashpay/grovedb/pull/663). + /// Before that PR, `AggregateCountOnRange` was required to be + /// the only item in its query and could not appear under a + /// `subquery` field — the dispatcher rejected this shape with + /// "range count queries with an `in` clause are not supported on + /// the aggregate prove path". + /// + /// Errors: + /// - No range where-clause / multiple range where-clauses → + /// `InvalidWhereClauseComponents` + /// - No In where-clause → `InvalidWhereClauseComponents` + /// - In on a non-prefix property → `InvalidWhereClauseComponents` + /// - Prefix property between In and range uses non-Equal → + /// `InvalidWhereClauseComponents` + pub fn carrier_aggregate_count_path_query( + &self, + limit: Option, + platform_version: &PlatformVersion, + ) -> Result { + // The terminator property (last in the index) carries the + // ACOR target range. The "carrier" property — the one whose + // clause becomes the outer Query items — is either: + // - An `In` clause (G7 shape: one Key per In value) + // - A range clause on a prefix prop (G8 shape: one QueryItem + // bounding the outer range, with `SizedQuery::limit` capping + // how many outer matches the carrier walks — see + // [grovedb PR #664](https://github.com/dashpay/grovedb/pull/664)) + // + // The terminator's clause must be a range and is converted to + // the inner ACOR `QueryItem`. Any properties between the + // carrier and the terminator must use `==` and extend the + // subquery_path. + let terminator_prop_name = &self + .index + .properties + .last() + .ok_or(Error::Query( + QuerySyntaxError::InvalidWhereClauseComponents( + "range_countable index must have at least one property", + ), + ))? + .name; + let terminator_clause = self + .where_clauses + .iter() + .find(|wc| wc.field == *terminator_prop_name && Self::is_range_operator(wc.operator)) + .ok_or(Error::Query( + QuerySyntaxError::InvalidWhereClauseComponents( + "carrier_aggregate_count_path_query requires a range where-clause on the \ + terminator property of the chosen index", + ), + ))?; + let inner_range_item = + self.range_clause_to_query_item(terminator_clause, platform_version)?; + + let mut base_path: Vec> = vec![ + vec![RootTree::DataContractDocuments as u8], + self.contract_id.to_vec(), + vec![1u8], + self.document_type_name.as_bytes().to_vec(), + ]; + let mut subquery_path_extension: Vec> = vec![]; + + // Carrier clause state: either `None` (not seen yet, still on + // the `==`-prefix run), `Some(In)` (G7), or `Some(Range)` (G8). + enum Carrier { + Pending, + In(WhereClause), + Range(WhereClause), + } + let mut carrier = Carrier::Pending; + let prefix_and_carrier_props = &self.index.properties[..self.index.properties.len() - 1]; + + for prop in prefix_and_carrier_props { + let clause = self + .where_clauses + .iter() + .find(|wc| wc.field == prop.name) + .ok_or( + Error::Query(QuerySyntaxError::InvalidWhereClauseComponents( + "carrier-aggregate proof: missing where clause for an index prefix property", + )), + )?; + match (&carrier, clause.operator) { + (Carrier::Pending, WhereOperator::Equal) => { + base_path.push(prop.name.as_bytes().to_vec()); + base_path.push(self.document_type.serialize_value_for_key( + prop.name.as_str(), + &clause.value, + platform_version, + )?); + } + (Carrier::Pending, WhereOperator::In) => { + base_path.push(prop.name.as_bytes().to_vec()); + carrier = Carrier::In(clause.clone()); + } + (Carrier::Pending, op) if Self::is_range_operator(op) => { + base_path.push(prop.name.as_bytes().to_vec()); + carrier = Carrier::Range(clause.clone()); + } + (Carrier::In(_) | Carrier::Range(_), WhereOperator::Equal) => { + subquery_path_extension.push(prop.name.as_bytes().to_vec()); + subquery_path_extension.push(self.document_type.serialize_value_for_key( + prop.name.as_str(), + &clause.value, + platform_version, + )?); + } + (Carrier::In(_) | Carrier::Range(_), _) => { + return Err(Error::Query( + QuerySyntaxError::InvalidWhereClauseComponents( + "carrier-aggregate proof: at most one carrier clause (In or range) \ + is supported on prefix properties; subsequent prefix clauses must \ + use `==`", + ), + )); + } + _ => { + return Err(Error::Query( + QuerySyntaxError::InvalidWhereClauseComponents( + "carrier-aggregate proof: prefix property operator unsupported", + ), + )); + } + } + } + subquery_path_extension.push(terminator_prop_name.as_bytes().to_vec()); + + let mut outer_query = Query::new(); + match carrier { + Carrier::Pending => { + return Err(Error::Query( + QuerySyntaxError::InvalidWhereClauseComponents( + "carrier-aggregate proof: an In or range clause must appear on a prefix \ + property of the chosen index to act as the carrier dimension", + ), + )); + } + Carrier::In(in_clause) => { + // Build one Key per In value, sorted lex-ascending + // (grovedb's multi-key walker invariant per PR #663). + let in_values = in_clause.in_values().into_data_with_error()??; + let mut serialized_in_keys: Vec> = in_values + .iter() + .map(|v| { + self.document_type.serialize_value_for_key( + in_clause.field.as_str(), + v, + platform_version, + ) + }) + .collect::>()?; + serialized_in_keys.sort(); + serialized_in_keys.dedup(); + for key in serialized_in_keys { + outer_query.insert_key(key); + } + } + Carrier::Range(range_clause) => { + // Single QueryItem bounding the outer range. The + // carrier walks this range and emits one `(key, u64)` + // pair per matched outer key. + let outer_range_item = + self.range_clause_to_query_item(&range_clause, platform_version)?; + outer_query.items.push(outer_range_item); + } + } + outer_query.set_subquery_path(subquery_path_extension); + outer_query.set_subquery(Query::new_aggregate_count_on_range(inner_range_item)); + + // `SizedQuery::limit` is permitted on carriers as of grovedb + // PR #664; for In-outer carriers the |IN| array already + // bounds the result so `limit` is typically `None`, but for + // Range-outer carriers `limit` caps the outer walk and is + // load-bearing for proof bytes. + Ok(PathQuery::new( + base_path, + SizedQuery::new(outer_query, limit, None), + )) + } + /// Build the grovedb `PathQuery` for a *regular* range query /// against this count query's `range_countable` index — the /// distinct-counts variant. Used by: @@ -484,9 +698,8 @@ impl DriveDocumentCountQuery<'_> { /// Build the grovedb `PathQuery` for a point-lookup count proof /// against a `countable: true` index. Returns one element per - /// covered branch — the `CountTree` element at - /// `[..., last_field, last_value, 0]` whose `count_value` is the - /// per-branch document count. + /// covered branch whose `count_value` is the per-branch document + /// count. /// /// Shared between the server-side prove path /// ([`Self::execute_point_lookup_count_with_proof`]) and the @@ -495,6 +708,33 @@ impl DriveDocumentCountQuery<'_> { /// produce the *exact same* `PathQuery` for the merk-root /// recomputation to match. /// + /// ## Two terminator shapes depending on `range_countable` + /// + /// The proof's terminal element is at one of two layers, picked + /// from [`Index::range_countable`]: + /// + /// - **Normal `countable: true`** (NOT `range_countable`): the + /// terminator's value tree is a `NormalTree`, and the doc-count + /// `CountTree` sits inside it at the conventional `[0]` child. + /// Proof targets `[..., last_field, last_value, 0]`. + /// - **`range_countable: true`**: the terminator's value tree is + /// itself a `CountTree` (continuation property-name subtrees + /// sit beneath as `Element::NonCounted` so they don't pollute + /// the parent count — see `add_indices_for_index_level_for_contract_operations_v0`). + /// The value tree's own `count_value_or_default()` already IS + /// the per-branch doc count, so the proof targets the value + /// tree directly at `[..., last_field, last_value]` and saves + /// one merk-path layer per covered branch. + /// + /// Concretely the optimization replaces a trailing `Key([0])` + /// with `Key(last_value)` against `[..., last_field]` (Equal- + /// only, no In) — or against the In-bearing prop's property-name + /// subtree (In on terminator) — or replaces the trailing pair in + /// `set_subquery_path` (In on prefix + trailing Equals that reach + /// the terminator). The query shape stays in the same Query/ + /// subquery topology so byte-equality across prover and verifier + /// is preserved by construction. + /// /// ## Shape support /// /// The builder requires the where clauses to **fully cover** the @@ -528,23 +768,31 @@ impl DriveDocumentCountQuery<'_> { /// route through this single builder, so they accept the same /// query shapes by construction. /// - /// Output shapes: - /// - **Equal-only, fully covered**: flat path query at - /// `[..., last_field, last_value]` with a single `Key([0])` - /// item. Returns one element (the CountTree). + /// Output shapes (`countable` / `range_countable` differ only in + /// whether the trailing `Key([0])` is replaced by `Key(last_value)`): + /// - **Equal-only, fully covered**: + /// - `countable`: path `[..., last_field, last_value]`, single `Key([0])`. + /// - `range_countable`: path `[..., last_field]`, single + /// `Key(last_value)`. /// - **Equal prefix + `In` (any position) [+ trailing Equals]**: /// compound query with `base_path` ending at the In-bearing - /// property's property-name subtree (so any Equal clauses - /// *before* the In are baked into `base_path`); outer Query - /// has one `Key` per In value (sorted lex-asc for prove/no- - /// proof parity and pushed-limit safety — same convention as - /// [`Self::distinct_count_path_query`]). `set_subquery_path` - /// carries the post-In Equal clauses' `(prop_name, - /// serialized_value)` pairs in index order, and the subquery's - /// `Key([0])` picks off the CountTree at the resolved leaf - /// under each matched In branch. Same `set_subquery_path` + - /// `set_subquery` mechanism as [`Self::distinct_count_path_query`] - /// uses for compound In-on-prefix range counts. + /// property's property-name subtree (Equal clauses before the + /// In are baked into `base_path`); outer Query has one `Key` + /// per In value (sorted lex-asc for prove/no-proof parity and + /// pushed-limit safety — same convention as + /// [`Self::distinct_count_path_query`]). + /// - **In on terminator**: + /// - `countable`: subquery `Key([0])` under each In value's + /// value tree (`set_subquery_path` unset). + /// - `range_countable`: outer `Key`s already point at the + /// CountTree value trees themselves; no subquery is set. + /// - **In on a prefix + trailing Equals reaching the + /// terminator**: `set_subquery_path` carries the post-In + /// Equal `(name, value)` pairs in index order: + /// - `countable`: full pairs, subquery `Key([0])`. + /// - `range_countable`: last pair's `value` is hoisted out as + /// the subquery's single `Key(value)`; `set_subquery_path` + /// ends at the terminator's property-name segment. /// /// ## Errors /// @@ -553,6 +801,8 @@ impl DriveDocumentCountQuery<'_> { /// - More than one `In` clause /// - Any non-`Equal` / non-`In` operator (defense-in-depth; mode /// detection already filters these out) + /// + /// [`Index::range_countable`]: dpp::data_contract::document_type::index::Index::range_countable pub fn point_lookup_count_path_query( &self, platform_version: &PlatformVersion, @@ -579,7 +829,10 @@ impl DriveDocumentCountQuery<'_> { // `set_subquery_path` — i.e., the descent under each matched // In value walks `[trailing_field_1, trailing_value_1, ..., // trailing_field_n, trailing_value_n]` before the - // `Key([0])` subquery picks off the CountTree leaf. + // selector subquery (either `Key([0])` for normal countable + // or a `Key(terminator_value)` lift for range_countable — + // see the post-loop selector decision below) picks off the + // count-bearing element. // // No position restriction on the In clause: any index // position works because the count path doesn't have the @@ -667,18 +920,76 @@ impl DriveDocumentCountQuery<'_> { } } - // CountTree storage convention: the count lives at the `[0]` - // child of the value tree. See the book's "Count Trees and - // Provable Counts" chapter for the layout. + // Whether the terminator's value tree is itself a `CountTree` + // (carries the per-branch doc count directly) vs. a + // `NormalTree` whose `[0]` child is the `CountTree`. Drives + // the selector-element decision below. + // + // The insertion side + // (`add_indices_for_index_level_for_contract_operations_v0`) + // makes the terminator value tree a `CountTree` for **any** + // countable index — not just `range_countable: true`. Both + // tiers (`Countable` and `CountableAllowingOffset`) layout + // the value tree the same way: a `CountTree` whose count + // equals the `[0]` ref-bucket's doc count (continuations + // wrapped `NonCounted` so they don't pollute the parent). + // `range_countable` only additionally upgrades the + // property-name tree to `ProvableCountTree` for + // `AggregateCountOnRange` queries — that's orthogonal to the + // point-lookup proof shape. + // + // So gate the optimization on `countable.is_countable()`: + // every countable index uses the compact shape. The picker + // upstream already requires the index to be countable to be + // selected (`find_countable_index_for_where_clauses` / the + // range_countable picker for range shapes), so reaching this + // builder with a non-countable index would be a bug — but + // we keep the gate explicit for clarity. + // + // The loop above already enforces full coverage of every + // index property, so the terminator is always proven; this + // flag is the only differentiator between the two output + // shapes. + let count_tree_terminator = self.index.countable.is_countable(); + + // CountTree storage convention for non-countable indexes + // (defensive — picker upstream filters these out): the count + // lives at the `[0]` child of the value + // tree. See the book's "Count Trees and Provable Counts" + // chapter for the layout. const COUNT_TREE_KEY: u8 = 0; match in_outer_keys { None => { - // Equal-only, fully covered. `base_path` ends at - // `[..., last_field, last_value]`; query asks for the - // single key `[0]` (the CountTree element). + // Equal-only, fully covered. + // + // - normal countable: `base_path` ends at + // `[..., last_field, last_value]`; query asks for + // the single key `[0]` (the CountTree under the + // value tree). + // - `range_countable`: peel the trailing `last_value` + // off `base_path` and use it as the query's Key. + // The resolved element is the value tree itself + // (a CountTree), and its `count_value_or_default()` + // is the per-branch count — one merk layer shorter + // per resolved branch than the `[0]` shape. let mut query = Query::new(); - query.insert_key(vec![COUNT_TREE_KEY]); + if count_tree_terminator { + // The Equal loop always pushes (name, value) per + // prop, so `base_path` has at least the trailing + // serialized `last_value` to lift. The expect() + // here would fire only if the loop above changed + // its push contract — a load-bearing invariant + // checked by every test in this module that + // routes through this builder. + let last_value = base_path.pop().expect( + "Equal-only loop pushes (name, value) per prop; \ + base_path must hold the terminator's serialized value", + ); + query.insert_key(last_value); + } else { + query.insert_key(vec![COUNT_TREE_KEY]); + } Ok(PathQuery::new( base_path, SizedQuery::new(query, None, None), @@ -688,31 +999,82 @@ impl DriveDocumentCountQuery<'_> { // Compound shape. `base_path` ends at the In-bearing // property's property-name subtree; the outer Query // enumerates serialized In values; the subquery - // descends to the CountTree element under each - // matched In value. + // (when present) descends from each matched In value + // to the count-bearing element. // // `subquery_path_extension` carries 0..N segments, // one `(prop_name, serialized_value)` pair per Equal // clause that sits *after* the In in the index - // ordering: - // - **In on last property**: `subquery_path_extension` - // is empty; subquery's `Key([0])` runs directly - // under each In value's value tree. - // - **In with any number of trailing Equals**: - // `set_subquery_path` consumes those segments so - // the subquery descends through them before grabbing - // the `Key([0])` CountTree at the resolved leaf. + // ordering. The exact subquery topology depends on + // both whether trailing Equals exist AND whether the + // terminator is range_countable; see the inline + // branches below. let mut outer_query = Query::new(); for key in keys { outer_query.insert_key(key); } - let mut subquery = Query::new(); - subquery.insert_key(vec![COUNT_TREE_KEY]); - if !subquery_path_extension.is_empty() { + + if subquery_path_extension.is_empty() { + // **In on the terminator** (no trailing Equals). + if count_tree_terminator { + // Outer `Key`s already point at the terminator + // value trees, which are themselves CountTrees. + // No subquery is needed — grovedb returns one + // element per matched outer Key. + } else { + // Normal countable: descend one more layer + // under each matched In value's NormalTree + // value tree to grab the `Key([0])` CountTree + // child. + let mut subquery = Query::new(); + subquery.insert_key(vec![COUNT_TREE_KEY]); + outer_query.set_subquery(subquery); + } + } else { + // **In on a prefix + trailing Equals** that + // collectively reach the terminator. + let mut subquery = Query::new(); + if count_tree_terminator { + // The terminator's serialized value is the + // last element pushed into + // `subquery_path_extension` (the trailing- + // Equal loop pushes `[name, value, ..., + // termname, termval]`). Lift `termval` out + // as the subquery's Key so the descent stops + // at the terminator's property-name subtree + // and the subquery resolves the CountTree + // value tree directly. `subquery_path_extension` + // is left at an odd length on purpose — it + // ends with the terminator's `name` segment, + // exactly where the subquery's `Key(termval)` + // picks up. + let termval = subquery_path_extension.pop().expect( + "trailing-Equal loop pushes (name, value) pairs; \ + non-empty extension's tail must be the terminator's \ + serialized value", + ); + subquery.insert_key(termval); + } else { + // Normal countable: subquery descends to the + // `Key([0])` CountTree at the resolved leaf, + // with the full `(name, value)` pairs of the + // trailing Equals consumed by + // `set_subquery_path`. + subquery.insert_key(vec![COUNT_TREE_KEY]); + } outer_query.set_subquery_path(subquery_path_extension); + outer_query.set_subquery(subquery); } - outer_query.set_subquery(subquery); + // `SizedQuery::new(_, None, None)` is intentional — + // PointLookupProof always returns ALL In branches. + // The handler rejects `limit` upstream on this path + // (see [`CountMode::accepts_limit`]'s `GroupByIn` + // arm) because the In array is already capped at 100 + // by `WhereClause::in_values()`, and a partial-In + // selection isn't representable in this `SizedQuery` + // shape without rebuilding the verifier to know + // which subset got truncated. Ok(PathQuery::new( base_path, SizedQuery::new(outer_query, None, None), diff --git a/packages/rs-drive/src/query/drive_document_count_query/tests.rs b/packages/rs-drive/src/query/drive_document_count_query/tests.rs index 58a420e275c..7c322f5902c 100644 --- a/packages/rs-drive/src/query/drive_document_count_query/tests.rs +++ b/packages/rs-drive/src/query/drive_document_count_query/tests.rs @@ -157,7 +157,11 @@ fn test_count_query_fully_covered_equal_succeeds_on_both_paths() { .execute_no_proof(&drive, None, platform_version) .expect("expected no-proof count to succeed"); assert_eq!(results.len(), 1); - assert_eq!(results[0].count, 3, "expected count of 3 docs at age=30"); + assert_eq!( + results[0].count, + Some(3), + "expected count of 3 docs at age=30" + ); assert!( results[0].key.is_empty(), "expected empty key for fully-covered Equal-only count" @@ -386,7 +390,8 @@ fn test_count_query_total_count_with_in_operator() { assert_eq!(results.len(), 1); assert_eq!( - results[0].count, 5, + results[0].count, + Some(5), "expected count of 5 (age=30 has 3, age=40 has 2)" ); } @@ -429,7 +434,132 @@ fn test_count_query_total_count_with_in_operator_no_matches() { .expect("expected query to succeed"); assert_eq!(results.len(), 1); - assert_eq!(results[0].count, 0, "expected count of 0 for unmatched In"); + assert_eq!( + results[0].count, + Some(0), + "expected count of 0 for unmatched In" + ); +} + +/// Pin against silent-aggregate-truncation: the PerInValue / range +/// fan-out arms used to unwrap `request.limit` to +/// `drive_config.default_query_limit`, which under tighter operator +/// tuning would truncate the per-In fan-out below |In| and produce +/// a wrong aggregate sum. +/// +/// `CountMode::Aggregate` callers reject explicit `limit` upstream +/// (`validate_and_route` returns `InvalidLimit`), so the only path +/// into the dispatcher with a meaningful In fan-out cap is the +/// constant `MAX_LIMIT_AS_FAILSAFE` baked into the dispatcher. This +/// test sets `default_query_limit = 3` and asks for an Aggregate +/// over an 8-element In array: pre-fix this returned 3 (sum of +/// first 3 In branches), post-fix it returns 8. +#[test] +fn test_aggregate_count_in_fan_out_ignores_default_query_limit() { + use crate::config::DriveConfig; + use crate::query::drive_document_count_query::drive_dispatcher::{ + DocumentCountRequest, DocumentCountResponse, + }; + + let (drive, data_contract) = setup_drive_and_contract(); + let platform_version = PlatformVersion::latest(); + + // 8 distinct ages, one doc per age. Each doc gets a unique + // (firstName, middleName, lastName) tuple to satisfy the + // family-contract-countable's unique compound index. + // Count > `OPERATOR_TUNED_LIMIT` (3) so truncation would be + // detectable. + let names = [ + "Alice", "Bob", "Carol", "Dave", "Eve", "Frank", "Grace", "Heidi", + ]; + for (i, (age, name)) in [30u64, 40, 50, 60, 70, 80, 90, 100] + .iter() + .zip(names.iter()) + .enumerate() + { + insert_person_doc( + &drive, + &data_contract, + [i as u8 + 1; 32], + name, + "M", + "Smith", + *age, + ); + } + + let document_type = data_contract + .document_type_for_name("person") + .expect("expected document type"); + + // Operator-tuned tight `default_query_limit`. Pre-fix the + // dispatcher would propagate this to the PerInValue executor + // and truncate the fan-out to 3 of the 8 In branches. + const OPERATOR_TUNED_LIMIT: u16 = 3; + let drive_config = DriveConfig { + default_query_limit: OPERATOR_TUNED_LIMIT, + ..Default::default() + }; + + // Wire-shape `where` value the dispatcher CBOR-decodes: a single + // `In` clause on `age` with all 8 values. + let raw_where_value = Value::Array(vec![Value::Array(vec![ + Value::Text("age".to_string()), + Value::Text("in".to_string()), + Value::Array(vec![ + Value::U64(30), + Value::U64(40), + Value::U64(50), + Value::U64(60), + Value::U64(70), + Value::U64(80), + Value::U64(90), + Value::U64(100), + ]), + ])]); + + let request = DocumentCountRequest { + contract: &data_contract, + document_type, + raw_where_value, + raw_order_by_value: Value::Null, + mode: CountMode::Aggregate, + // Aggregate rejects explicit `limit` upstream; the + // dispatcher must not substitute `default_query_limit` for + // the per-In fan-out cap or the aggregate is wrong. + limit: None, + prove: false, + drive_config: &drive_config, + }; + + let response = drive + .execute_document_count_request(request, None, platform_version) + .expect("dispatcher should succeed on Aggregate + In + no-prove"); + + // rs-drive's dispatcher emits `Entries` for the PerInValue + // path; drive-abci's `dispatch_count_v1` is what sums them + // into a single `Aggregate` response on the wire. At this + // layer we exercise the fan-out directly: both the entry + // count and the sum-of-counts must match the full 8 In + // branches, regardless of `OPERATOR_TUNED_LIMIT`. + let entries = match response { + DocumentCountResponse::Entries(e) => e, + other => panic!("expected Entries response from PerInValue dispatch, got {other:?}"), + }; + assert_eq!( + entries.len(), + 8, + "PerInValue fan-out must emit all 8 In branches regardless of \ + operator-tuned default_query_limit ({OPERATOR_TUNED_LIMIT}); pre-fix \ + this returned {OPERATOR_TUNED_LIMIT} entries because the dispatcher \ + propagated `default_query_limit` to the executor's `RangeCountOptions::limit`" + ); + let total: u64 = entries.iter().filter_map(|e| e.count).sum(); + assert_eq!( + total, 8, + "aggregate sum over per-In entries must be 8; under the pre-fix \ + truncation the sum would have been {OPERATOR_TUNED_LIMIT}" + ); } /// `In` clauses with duplicate values are rejected with @@ -579,7 +709,8 @@ fn test_count_query_in_on_before_last_with_trailing_equal_succeeds_on_both_paths .expect("expected no-proof count to succeed"); assert_eq!(results.len(), 1); assert_eq!( - results[0].count, 3, + results[0].count, + Some(3), "expected 3 docs covered by firstName IN [Alice, Bob] AND lastName = Smith" ); @@ -598,7 +729,7 @@ fn test_count_query_in_on_before_last_with_trailing_equal_succeeds_on_both_paths .expect("expected proof verification to succeed"); // Verifier emits one entry per In branch with a non-zero count. // Alice → 2, Bob → 1. - let summed: u64 = entries.iter().map(|e| e.count).sum(); + let summed: u64 = entries.iter().map(|e| e.count.unwrap_or(0)).sum(); assert_eq!( summed, 3, "verified per-branch entries should sum to the no-proof total" @@ -700,7 +831,8 @@ fn test_count_query_in_on_first_of_three_with_two_trailing_equals_succeeds_on_bo .expect("expected no-proof count to succeed"); assert_eq!(results.len(), 1); assert_eq!( - results[0].count, 2, + results[0].count, + Some(2), "expected 2 docs covered by firstName IN [Alice, Bob] AND \ middleName = M AND lastName = Smith" ); @@ -719,13 +851,313 @@ fn test_count_query_in_on_first_of_three_with_two_trailing_equals_succeeds_on_bo let (_root_hash, entries) = query .verify_point_lookup_count_proof(&proof, platform_version) .expect("expected proof verification to succeed"); - let summed: u64 = entries.iter().map(|e| e.count).sum(); + let summed: u64 = entries.iter().map(|e| e.count.unwrap_or(0)).sum(); assert_eq!( summed, 2, "verified per-branch entries should sum to the no-proof total" ); } +/// Pins the **absent-In-branch ↔ missing-from-output** contract on a +/// real grovedb proof. +/// +/// The `point_lookup_count_path_query` builder does NOT set +/// `absence_proofs_for_non_existing_searched_keys: true` on the outer +/// query (see `path_query.rs`), so grovedb's `verify_query` silently +/// omits absent-`Key` branches from the elements stream rather than +/// emitting `(path, key, None)` triples for them. The verifier therefore +/// emits ZERO entries for absent In values — the request's In array +/// length is the authority on what was asked, and "queried but absent" +/// is detected by the caller diffing the In array against the verified +/// output (cf. [`verify_distinct_count_proof_v0`]'s docstring at the +/// "caller can detect 'I asked for 3 In values but only got entries for +/// 2'" comment). +/// +/// This contract makes the `count: Option` field's `None` variant +/// effectively unreachable on the current path-query shape — it's +/// reserved for a future variant that flips +/// `absence_proofs_for_non_existing_searched_keys: true`. The `elem.map(...)` +/// branch in `verify_point_lookup_count_proof_v0` is forward-compatible +/// code for that variant, not active behavior today. +/// +/// Test setup: insert docs at age=30 (×3), age=40 (×2), age=50 (×1); +/// query `age IN [30, 40, 99, 50]` against `byAge`. age=99 has no +/// matching docs and no CountTree element materialized in the merk +/// tree, so grovedb omits that key from the verified elements stream. +/// +/// Pins: +/// - **Absent branch (age=99) is silently dropped** — verified entry +/// count is 3, not 4. Caller must diff against the In array if they +/// want to surface absent branches. A regression that emitted a +/// `Some(0)` entry for the absent branch would break the "absence is +/// detected by missing entry, not by zero-count entry" contract this +/// path's docstring documents. +/// - **Present branches → `Some(N)` matching the no-proof totals** — +/// 30→3, 40→2, 50→1 — pins that present-branch counts round-trip +/// through real merk proof verification correctly. +/// - **Entry-to-In-value mapping via serialized `key`** — each entry's +/// `key` equals `document_type.serialize_value_for_key("age", &v, …)` +/// for its In value, so callers can demux entries back to the In +/// array without positional assumptions (grovedb sorts by serialized +/// key, not user-input order — see `path_query.rs:391–400`). +/// +/// This is the test we'd need to flip the assertion in if/when the path +/// query starts requesting absence proofs — a clear semantic anchor for +/// the future variant. +#[test] +fn test_point_lookup_proof_omits_absent_in_branches_from_entries() { + let (drive, data_contract) = setup_drive_and_contract(); + let platform_version = PlatformVersion::latest(); + + // Distinct (firstName, middleName, lastName) tuples so the unique + // `byFirstNameMiddleLastName` index doesn't reject any insert; the + // count query routes through `byAge` regardless. + insert_person_doc(&drive, &data_contract, [1u8; 32], "A", "M", "Smith", 30); + insert_person_doc(&drive, &data_contract, [2u8; 32], "B", "M", "Smith", 30); + insert_person_doc(&drive, &data_contract, [3u8; 32], "C", "M", "Smith", 30); + insert_person_doc(&drive, &data_contract, [4u8; 32], "D", "M", "Smith", 40); + insert_person_doc(&drive, &data_contract, [5u8; 32], "E", "M", "Smith", 40); + insert_person_doc(&drive, &data_contract, [6u8; 32], "F", "M", "Smith", 50); + + let document_type = data_contract + .document_type_for_name("person") + .expect("expected document type"); + + // age IN [30, 40, 99, 50] — 99 is the absent branch. Interleaving + // it between present values pins that grovedb omits absent keys + // regardless of position, not just at the array tail. + let in_clause = WhereClause { + field: "age".to_string(), + operator: WhereOperator::In, + value: Value::Array(vec![ + Value::U64(30), + Value::U64(40), + Value::U64(99), + Value::U64(50), + ]), + }; + + let index = DriveDocumentCountQuery::find_countable_index_for_where_clauses( + document_type.indexes(), + std::slice::from_ref(&in_clause), + ) + .expect("expected picker to accept byAge for In on age"); + // Sanity-pin the picker chose the single-property `byAge` index — + // a change here means a future picker rewrite reshaped what counts + // as "fully covered" for a 1-property In. + assert_eq!(index.properties.len(), 1); + assert_eq!(index.properties[0].name.as_str(), "age"); + + let query = DriveDocumentCountQuery { + document_type, + contract_id: data_contract.id().to_buffer(), + document_type_name: "person".to_string(), + index, + where_clauses: vec![in_clause], + }; + + let proof = query + .execute_point_lookup_count_with_proof(&drive, None, platform_version) + .expect("expected prove count to succeed"); + assert!(!proof.is_empty(), "expected non-empty proof bytes"); + + let (_root_hash, entries) = query + .verify_point_lookup_count_proof(&proof, platform_version) + .expect("expected proof verification to succeed"); + + // The load-bearing assertion: grovedb's `verify_query` (without + // `absence_proofs_for_non_existing_searched_keys: true`) silently + // drops absent-Key branches from the elements stream, so the + // verifier emits 3 entries — one per PRESENT In value — not 4. + assert_eq!( + entries.len(), + 3, + "expected one entry per PRESENT In value (absent branches \ + are omitted, not emitted as Some(0) or None); got {} entries: \ + {:?}", + entries.len(), + entries + ); + + // Demux entries by serialized `key` (which is what the verifier + // populates from `path[base_path_len]`, see + // `verify_point_lookup_count_proof_v0`). Same serializer the + // path-query builder uses for outer-Query keys, so by-construction + // the entry's `key` matches `serialize_value_for_key("age", v)`. + use dpp::data_contract::document_type::methods::DocumentTypeV0Methods; + let document_type = data_contract + .document_type_for_name("person") + .expect("expected document type"); + let key_for = |v: u64| -> Vec { + document_type + .serialize_value_for_key("age", &Value::U64(v), platform_version) + .expect("serialize age key") + }; + + let find_present = |v: u64| -> u64 { + let k = key_for(v); + let matching: Vec<_> = entries.iter().filter(|e| e.key == k).collect(); + assert_eq!( + matching.len(), + 1, + "expected exactly one entry for present age={}; got {}: {:?}", + v, + matching.len(), + matching + ); + matching[0] + .count + .expect("present-branch entry must be Some(_), not None") + }; + + // Present branches: real counts, round-tripped through proof bytes. + assert_eq!(find_present(30), 3, "age=30 has 3 docs"); + assert_eq!(find_present(40), 2, "age=40 has 2 docs"); + assert_eq!(find_present(50), 1, "age=50 has 1 doc"); + + // Absent branch: no entry with key=serialize(99). This is the + // contract — absent branches are detected by the caller as "queried + // but missing from output", not surfaced via Some(0) or None. + let absent_key = key_for(99); + assert!( + !entries.iter().any(|e| e.key == absent_key), + "expected NO entry for absent age=99; found one in: {:?}. \ + If this fires after a path-query change, the builder may now \ + request absence proofs — update this test and the verifier \ + docstrings to reflect the new contract.", + entries + ); +} + +/// Boundary-cap test: `|In| = 100` exactly. The 100-element cap on In +/// arrays lives in [`WhereClause::in_values`]; existing tests cover +/// `< 100` (the happy path) and `> 100` (the rejection case at 101, +/// see [`test_count_query_in_operator_rejects_oversized_array`]). Off- +/// by-one in the cap (`>= 100` vs. `> 100`) would silently reject all +/// max-sized queries while passing every smaller test — this pins that +/// 100 is **accepted** end-to-end through both no-proof and prove paths. +/// +/// Setup: 100 distinct `age` values (single-property `byAge` countable +/// index, fully covered by an In on `age` alone), with each doc's +/// (firstName, middleName, lastName) tuple distinct so the unique +/// 3-prop index admits all inserts. Each age has exactly one matching +/// doc → total no-proof count = 100; per-branch prove count = 100 +/// entries × `Some(1)`. +/// +/// Pins: +/// - **`in_values()` accepts |In| = 100** — boundary not off-by-one. +/// - **No-proof per-In fan-out scales to 100 branches** — one +/// `query_aggregate_count` per In value, summed to 100. +/// - **Prove path emits 100 verified entries** — proof reconstruction +/// doesn't hit a hidden inner cap (e.g. a smaller `limit` baked into +/// the path-query builder). +/// - **All 100 entries verify with `Some(1)`** — sum equals no-proof +/// total; per-branch shape matches. Pinning per-entry rather than +/// just the sum catches a regression that would split the count +/// unevenly across branches. +#[test] +fn test_count_query_in_operator_accepts_max_sized_array() { + let (drive, data_contract) = setup_drive_and_contract(); + let platform_version = PlatformVersion::latest(); + + // 100 distinct ages, each with a unique (firstName, middleName, + // lastName) tuple so the unique 3-prop index admits all inserts. + // Using ages 1..=100 keeps the byAge index fully covered by a + // single In on `age`. + for i in 0u64..100 { + let mut id = [0u8; 32]; + id[..2].copy_from_slice(&(i as u16).to_be_bytes()); + // Unique firstName per doc keeps the unique 3-prop index happy + // regardless of any shared middle/last names. + let first_name = format!("P{:03}", i); + insert_person_doc(&drive, &data_contract, id, &first_name, "M", "Smith", i + 1); + } + + let document_type = data_contract + .document_type_for_name("person") + .expect("expected document type"); + + let in_values: Vec = (1u64..=100).map(Value::U64).collect(); + assert_eq!(in_values.len(), 100, "test setup invariant: |In| = 100"); + + let in_clause = WhereClause { + field: "age".to_string(), + operator: WhereOperator::In, + value: Value::Array(in_values), + }; + + let index = DriveDocumentCountQuery::find_countable_index_for_where_clauses( + document_type.indexes(), + std::slice::from_ref(&in_clause), + ) + .expect("expected picker to accept byAge for In on age"); + assert_eq!(index.properties.len(), 1); + assert_eq!(index.properties[0].name.as_str(), "age"); + + let query = DriveDocumentCountQuery { + document_type, + contract_id: data_contract.id().to_buffer(), + document_type_name: "person".to_string(), + index, + where_clauses: vec![in_clause], + }; + + // No-proof: per-In fan-out, summed. 100 branches × 1 doc each = 100. + let no_proof = query + .execute_no_proof(&drive, None, platform_version) + .expect("expected no-proof count to accept |In| = 100"); + assert_eq!( + no_proof.len(), + 1, + "no-proof returns single aggregated entry" + ); + assert_eq!( + no_proof[0].count, + Some(100), + "100 distinct age branches × 1 doc each = 100" + ); + + // Prove: verifier emits one entry per PRESENT branch (all 100 are + // present here, so 100 entries — see + // `test_point_lookup_proof_omits_absent_in_branches_from_entries` + // for the absent-branch contract). + let proof = query + .execute_point_lookup_count_with_proof(&drive, None, platform_version) + .expect("expected prove count to accept |In| = 100"); + assert!( + !proof.is_empty(), + "expected non-empty proof bytes for 100-element In array" + ); + + let (_root_hash, entries) = query + .verify_point_lookup_count_proof(&proof, platform_version) + .expect("expected proof verification to succeed for |In| = 100"); + + assert_eq!( + entries.len(), + 100, + "verifier emits one entry per present In value at the 100-cap \ + boundary; got {} entries — a smaller count means a hidden \ + inner cap kicked in (e.g. DEFAULT_QUERY_LIMIT on the \ + path-query builder)", + entries.len() + ); + let summed: u64 = entries.iter().map(|e| e.count.unwrap_or(0)).sum(); + assert_eq!( + summed, 100, + "verified per-branch counts should sum to the no-proof total" + ); + // Every entry must be Some(1) — present branch with one doc. + // Catches a regression that splits counts unevenly (e.g. a + // verifier bug that double-counts one branch and zeros another). + assert!( + entries.iter().all(|e| e.count == Some(1)), + "each of the 100 branches has exactly one doc; expected every \ + entry to be Some(1), got: {:?}", + entries + ); +} + /// Pins the DoS-bound invariant on the compound `range + In` /// summed no-proof path: per-In aggregate fan-out, NOT a walk-and- /// sum over every matched `(in_key, key)` element. A regression @@ -891,7 +1323,7 @@ fn test_compound_range_in_summed_no_proof_uses_per_in_aggregate_fanout() { document_type, raw_where_value, raw_order_by_value: Value::Null, - return_distinct_counts_in_range: false, + mode: CountMode::Aggregate, limit: None, prove: false, drive_config: &drive_config, @@ -965,7 +1397,7 @@ fn test_count_request_with_duplicate_equality_clauses_is_rejected() { document_type, raw_where_value, raw_order_by_value: Value::Null, - return_distinct_counts_in_range: false, + mode: CountMode::Aggregate, limit: None, prove: false, drive_config: &drive_config, @@ -1160,7 +1592,7 @@ fn test_range_distinct_proof_uses_compile_time_default_query_limit_not_operator_ document_type, raw_where_value, raw_order_by_value: Value::Null, - return_distinct_counts_in_range: true, + mode: CountMode::GroupByRange, limit: None, prove: true, drive_config: &drive_config, @@ -1500,7 +1932,8 @@ fn test_countable_allowing_offset_variant_end_to_end() { .expect("expected count query to succeed against ProvableCountTree"); assert_eq!(results.len(), 1); assert_eq!( - results[0].count, 2, + results[0].count, + Some(2), "ProvableCountTree should report 2 Alices" ); } @@ -1572,7 +2005,8 @@ fn test_count_query_unique_countable_index_returns_correct_count() { assert_eq!(results.len(), 1); assert_eq!( - results[0].count, 1, + results[0].count, + Some(1), "exact match on a unique countable index should be 1, not 0 \ (Reference at [0] returns count_value_or_default = 1)" ); @@ -1827,7 +2261,7 @@ mod detect_mode_tests { /// No clauses, no flags → total mode. #[test] fn no_clauses_no_flags_is_total() { - let mode = DriveDocumentCountQuery::detect_mode(&[], false, false).unwrap(); + let mode = DriveDocumentCountQuery::detect_mode(&[], CountMode::Aggregate, false).unwrap(); assert_eq!(mode, DocumentCountMode::Total); } @@ -1836,7 +2270,7 @@ mod detect_mode_tests { fn only_equal_clauses_is_total() { let clauses = vec![eq_clause("a"), eq_clause("b")]; assert_eq!( - DriveDocumentCountQuery::detect_mode(&clauses, false, false).unwrap(), + DriveDocumentCountQuery::detect_mode(&clauses, CountMode::Aggregate, false).unwrap(), DocumentCountMode::Total, ); } @@ -1846,7 +2280,7 @@ mod detect_mode_tests { fn single_in_is_per_in_value() { let clauses = vec![in_clause("a")]; assert_eq!( - DriveDocumentCountQuery::detect_mode(&clauses, false, false).unwrap(), + DriveDocumentCountQuery::detect_mode(&clauses, CountMode::Aggregate, false).unwrap(), DocumentCountMode::PerInValue, ); } @@ -1856,7 +2290,7 @@ mod detect_mode_tests { fn equal_plus_in_is_per_in_value() { let clauses = vec![eq_clause("a"), in_clause("b")]; assert_eq!( - DriveDocumentCountQuery::detect_mode(&clauses, false, false).unwrap(), + DriveDocumentCountQuery::detect_mode(&clauses, CountMode::Aggregate, false).unwrap(), DocumentCountMode::PerInValue, ); } @@ -1866,7 +2300,7 @@ mod detect_mode_tests { fn single_range_no_proof_is_range_no_proof() { let clauses = vec![gt_clause("color")]; assert_eq!( - DriveDocumentCountQuery::detect_mode(&clauses, false, false).unwrap(), + DriveDocumentCountQuery::detect_mode(&clauses, CountMode::Aggregate, false).unwrap(), DocumentCountMode::RangeNoProof, ); } @@ -1876,7 +2310,7 @@ mod detect_mode_tests { fn single_range_with_prove_is_range_proof() { let clauses = vec![gt_clause("color")]; assert_eq!( - DriveDocumentCountQuery::detect_mode(&clauses, false, true).unwrap(), + DriveDocumentCountQuery::detect_mode(&clauses, CountMode::Aggregate, true).unwrap(), DocumentCountMode::RangeProof, ); } @@ -1886,7 +2320,7 @@ mod detect_mode_tests { fn no_range_with_prove_is_point_lookup_proof() { let clauses = vec![eq_clause("a")]; assert_eq!( - DriveDocumentCountQuery::detect_mode(&clauses, false, true).unwrap(), + DriveDocumentCountQuery::detect_mode(&clauses, CountMode::Aggregate, true).unwrap(), DocumentCountMode::PointLookupProof, ); } @@ -1896,7 +2330,7 @@ mod detect_mode_tests { fn equal_prefix_plus_range_terminator_is_range_no_proof() { let clauses = vec![eq_clause("brand"), gt_clause("color")]; assert_eq!( - DriveDocumentCountQuery::detect_mode(&clauses, false, false).unwrap(), + DriveDocumentCountQuery::detect_mode(&clauses, CountMode::Aggregate, false).unwrap(), DocumentCountMode::RangeNoProof, ); } @@ -1905,7 +2339,8 @@ mod detect_mode_tests { #[test] fn two_range_operators_rejected() { let clauses = vec![gt_clause("color"), lt_clause("color")]; - let err = DriveDocumentCountQuery::detect_mode(&clauses, false, false).unwrap_err(); + let err = DriveDocumentCountQuery::detect_mode(&clauses, CountMode::Aggregate, false) + .unwrap_err(); assert!(matches!( err, QuerySyntaxError::InvalidWhereClauseComponents(msg) if msg.contains("at most one range") @@ -1916,7 +2351,8 @@ mod detect_mode_tests { #[test] fn two_in_operators_rejected() { let clauses = vec![in_clause("a"), in_clause("b")]; - let err = DriveDocumentCountQuery::detect_mode(&clauses, false, false).unwrap_err(); + let err = DriveDocumentCountQuery::detect_mode(&clauses, CountMode::Aggregate, false) + .unwrap_err(); assert!(matches!( err, QuerySyntaxError::InvalidWhereClauseComponents(msg) if msg.contains("at most one `in`") @@ -1940,11 +2376,11 @@ mod detect_mode_tests { // which uses the unified `distinct_count_path_query` builder // and applies `options.distinct` in post-processing. assert_eq!( - DriveDocumentCountQuery::detect_mode(&clauses, false, false).unwrap(), + DriveDocumentCountQuery::detect_mode(&clauses, CountMode::Aggregate, false).unwrap(), DocumentCountMode::RangeNoProof, ); assert_eq!( - DriveDocumentCountQuery::detect_mode(&clauses, true, false).unwrap(), + DriveDocumentCountQuery::detect_mode(&clauses, CountMode::GroupByRange, false).unwrap(), DocumentCountMode::RangeNoProof, ); @@ -1952,13 +2388,14 @@ mod detect_mode_tests { // query carries In as outer `Key`s and the range as the // subquery; the verifier reconstructs the same shape. assert_eq!( - DriveDocumentCountQuery::detect_mode(&clauses, true, true).unwrap(), + DriveDocumentCountQuery::detect_mode(&clauses, CountMode::GroupByRange, true).unwrap(), DocumentCountMode::RangeDistinctProof, ); // Prove + !distinct (aggregate) — still rejected, the // AggregateCountOnRange primitive can't fork. - let err = DriveDocumentCountQuery::detect_mode(&clauses, false, true).unwrap_err(); + let err = + DriveDocumentCountQuery::detect_mode(&clauses, CountMode::Aggregate, true).unwrap_err(); assert!( matches!( err, @@ -1970,17 +2407,18 @@ mod detect_mode_tests { ); } - /// `return_distinct_counts_in_range = true` without a range → rejected. + /// `CountMode::GroupByRange` without a range clause → rejected. #[test] fn distinct_without_range_rejected() { - let err = DriveDocumentCountQuery::detect_mode(&[], true, false).unwrap_err(); + let err = + DriveDocumentCountQuery::detect_mode(&[], CountMode::GroupByRange, false).unwrap_err(); assert!(matches!( err, QuerySyntaxError::InvalidWhereClauseComponents(msg) if msg.contains("requires a range where-clause") )); } - /// `return_distinct_counts_in_range = true` + `prove = true` → + /// `CountMode::GroupByRange` + `prove = true` → /// `RangeDistinctProof`. Per-distinct-value counts come from a /// regular range proof against the property-name /// `ProvableCountTree` (no `AggregateCountOnRange` wrapper), with @@ -1991,7 +2429,7 @@ mod detect_mode_tests { fn distinct_with_prove_is_range_distinct_proof() { let clauses = vec![gt_clause("color")]; assert_eq!( - DriveDocumentCountQuery::detect_mode(&clauses, true, true).unwrap(), + DriveDocumentCountQuery::detect_mode(&clauses, CountMode::GroupByRange, true).unwrap(), DocumentCountMode::RangeDistinctProof, ); } @@ -2002,25 +2440,835 @@ mod detect_mode_tests { fn distinct_no_prove_with_range_is_range_no_proof() { let clauses = vec![gt_clause("color")]; assert_eq!( - DriveDocumentCountQuery::detect_mode(&clauses, true, false).unwrap(), + DriveDocumentCountQuery::detect_mode(&clauses, CountMode::GroupByRange, false).unwrap(), DocumentCountMode::RangeNoProof, ); } - /// `prove = true` + `In` routes to `PointLookupProof` (the - /// materialize-and-count proof fallback). The SDK's - /// `FromProof` for `DocumentSplitCounts` - /// then groups verified documents by the In field's serialized - /// value to produce per-key count entries. No proof aggregate - /// primitive supports per-In-value entries directly, so the - /// materialize path is the only correct route until grovedb - /// gains a per-key count proof. + /// `prove = true` + `In` routes to `PointLookupProof` — the + /// CountTree-element proof primitive. The + /// `point_lookup_count_path_query` builder emits one + /// `Element::CountTree` per matched In branch; the verifier + /// reads `count_value_or_default()` off each verified element + /// directly. No document materialization, no `u16::MAX` cap on + /// matching docs. Proof size is O(|In values| × log n). #[test] fn in_with_prove_routes_to_point_lookup_proof() { let clauses = vec![in_clause("a")]; assert_eq!( - DriveDocumentCountQuery::detect_mode(&clauses, false, true).unwrap(), + DriveDocumentCountQuery::detect_mode(&clauses, CountMode::Aggregate, true).unwrap(), DocumentCountMode::PointLookupProof, ); } + + /// `GroupByRange + prove + two range clauses on distinct fields` + /// routes to `RangeAggregateCarrierProof` (the carrier-ACOR with + /// outer Range shape — chapter 30 G8). The dispatcher applies a + /// platform-wide max outer-walk cap via + /// [`MAX_CARRIER_AGGREGATE_OUTER_RANGE_LIMIT`], with caller + /// semantics tested at the dispatcher level. + #[test] + fn outer_range_plus_inner_range_with_prove_and_group_by_range_routes_to_carrier_proof() { + let clauses = vec![gt_clause("brand"), gt_clause("color")]; + assert_eq!( + DriveDocumentCountQuery::detect_mode(&clauses, CountMode::GroupByRange, true).unwrap(), + DocumentCountMode::RangeAggregateCarrierProof, + ); + } + + /// Two range clauses on the SAME field are still rejected — the + /// "two ranges on distinct fields" carrier escape hatch requires + /// the ranges to be on different properties (one outer, one + /// terminator). Same-field two-sided ranges flatten through the + /// upstream parser into `between*` and arrive here as one clause. + #[test] + fn two_ranges_on_same_field_with_group_by_range_prove_still_rejected() { + let clauses = vec![gt_clause("color"), lt_clause("color")]; + let err = DriveDocumentCountQuery::detect_mode(&clauses, CountMode::GroupByRange, true) + .unwrap_err(); + assert!(matches!( + err, + QuerySyntaxError::InvalidWhereClauseComponents(_) + )); + } + + /// No-proof path keeps the original `range_count > 1` rejection + /// — the carrier escape hatch is gated on `prove = true` because + /// the no-proof variant doesn't have a corresponding executor + /// yet. (Documenting the gate so a future no-proof carrier wire- + /// up doesn't silently slip past `detect_mode`'s exhaustiveness.) + #[test] + fn two_ranges_no_proof_with_group_by_range_still_rejected() { + let clauses = vec![gt_clause("brand"), gt_clause("color")]; + let err = DriveDocumentCountQuery::detect_mode(&clauses, CountMode::GroupByRange, false) + .unwrap_err(); + assert!(matches!( + err, + QuerySyntaxError::InvalidWhereClauseComponents(_) + )); + } +} + +/// Coverage for the rangeCountable-terminator optimization on the +/// point-lookup proof path. See +/// [`DriveDocumentCountQuery::point_lookup_count_path_query`] for +/// the two-shape rationale. +/// +/// These tests pin **three** axes: +/// +/// 1. **Counts are unchanged** — the optimization is a proof-size +/// win, not a semantic change. Every shape's no-proof and prove +/// paths must agree on the per-branch counts before and after. +/// 2. **Path-query shape diverges between countable and +/// rangeCountable** — explicit structural assertions on +/// `PathQuery.path` / `Query.items` / `default_subquery_branch` +/// so a regression that re-introduces the `[0]` descent for +/// rangeCountable (or, worse, drops it for normal countable) +/// fails loudly here rather than only showing up as a wrong +/// proof size at runtime. +/// 3. **Non-rangeCountable shape preserved** — the byAge regression +/// test pins the unchanged `Key([0])` selector so the +/// optimization isn't accidentally applied to indexes whose +/// value trees are NormalTree (where `[0]` is load-bearing for +/// finding the count). +/// +/// We assert path-query shape directly rather than relying on proof +/// size to surface regressions, because proof-size measurements +/// fluctuate with merk-tree balance and only catch the regression +/// stochastically. The shape assertion is deterministic and points +/// at the exact line that drifted. +#[cfg(all(feature = "server", feature = "verify"))] +mod range_countable_point_lookup_tests { + use super::*; + use dpp::data_contract::document_type::methods::DocumentTypeV0Methods; + use dpp::data_contract::DataContract; + use dpp::data_contract::DataContractFactory; + use dpp::platform_value::platform_value; + use grovedb::QueryItem; + + const PROTOCOL_VERSION_V12: u32 = 12; + + /// Build a `widget` document type with a single `byBrand` index + /// flagged `range_countable: true`. The terminator's value + /// trees are CountTrees (rather than NormalTree + `[0]`-child + /// CountTree), so the point-lookup proof should target them + /// directly. + fn build_by_brand_range_countable_contract() -> DataContract { + let factory = DataContractFactory::new(PROTOCOL_VERSION_V12).expect("create factory"); + let document_schema = platform_value!({ + "type": "object", + "properties": { + "brand": {"type": "string", "position": 0, "maxLength": 32}, + }, + "indices": [{ + "name": "byBrand", + "properties": [{"brand": "asc"}], + "countable": "countable", + "rangeCountable": true, + }], + "additionalProperties": false, + }); + let schemas = platform_value!({ "widget": document_schema }); + factory + .create_with_value_config( + dpp::tests::utils::generate_random_identifier_struct(), + 0, + schemas, + None, + None, + ) + .expect("create contract") + .data_contract_owned() + } + + /// Build a `widget` document type with a compound `byBrandColor` + /// index flagged `range_countable: true`. The terminator is + /// `color`; only its value trees are CountTrees. The intermediate + /// `brand` value trees stay NormalTree (because they're not the + /// terminator), so the optimization is only legal when the proof + /// resolves *down to* the `color` value tree — which is exactly + /// what `brand IN [..] AND color = X` does. + fn build_by_brand_color_range_countable_contract() -> DataContract { + let factory = DataContractFactory::new(PROTOCOL_VERSION_V12).expect("create factory"); + let document_schema = platform_value!({ + "type": "object", + "properties": { + "brand": {"type": "string", "position": 0, "maxLength": 32}, + "color": {"type": "string", "position": 1, "maxLength": 32}, + }, + "indices": [{ + "name": "byBrandColor", + "properties": [{"brand": "asc"}, {"color": "asc"}], + "countable": "countable", + "rangeCountable": true, + }], + "additionalProperties": false, + }); + let schemas = platform_value!({ "widget": document_schema }); + factory + .create_with_value_config( + dpp::tests::utils::generate_random_identifier_struct(), + 0, + schemas, + None, + None, + ) + .expect("create contract") + .data_contract_owned() + } + + /// Build a `gizmo` document type with a single `byCategory` + /// index that is `countable: true` but **NOT** `range_countable`. + /// Used as the regression control — its value trees stay + /// `NormalTree` and the count lives at the `[0]` child, so the + /// point-lookup path query must continue to use `Key([0])`. + fn build_by_category_normal_countable_contract() -> DataContract { + let factory = DataContractFactory::new(PROTOCOL_VERSION_V12).expect("create factory"); + let document_schema = platform_value!({ + "type": "object", + "properties": { + "category": {"type": "string", "position": 0, "maxLength": 32}, + }, + "indices": [{ + "name": "byCategory", + "properties": [{"category": "asc"}], + "countable": "countable", + }], + "additionalProperties": false, + }); + let schemas = platform_value!({ "gizmo": document_schema }); + factory + .create_with_value_config( + dpp::tests::utils::generate_random_identifier_struct(), + 0, + schemas, + None, + None, + ) + .expect("create contract") + .data_contract_owned() + } + + /// Insert a widget doc with the given `(brand, color)`. `color` + /// may be `None` for single-property `byBrand` fixtures. + fn insert_widget( + drive: &Drive, + data_contract: &DataContract, + id: [u8; 32], + brand: &str, + color: Option<&str>, + ) { + let platform_version = PlatformVersion::latest(); + let document_type = data_contract + .document_type_for_name("widget") + .expect("widget doc type"); + + let mut properties = StdBTreeMap::new(); + properties.insert("brand".to_string(), Value::Text(brand.to_string())); + if let Some(c) = color { + properties.insert("color".to_string(), Value::Text(c.to_string())); + } + let document: Document = DocumentV0 { + id: Identifier::from(id), + owner_id: Identifier::from([0u8; 32]), + properties, + revision: None, + created_at: None, + updated_at: None, + transferred_at: None, + created_at_block_height: None, + updated_at_block_height: None, + transferred_at_block_height: None, + created_at_core_block_height: None, + updated_at_core_block_height: None, + transferred_at_core_block_height: None, + creator_id: None, + } + .into(); + let storage_flags = Some(Cow::Owned(StorageFlags::SingleEpoch(0))); + drive + .add_document_for_contract( + DocumentAndContractInfo { + owned_document_info: OwnedDocumentInfo { + document_info: DocumentRefInfo((&document, storage_flags)), + owner_id: None, + }, + contract: data_contract, + document_type, + }, + false, + BlockInfo::default(), + true, + None, + platform_version, + None, + ) + .expect("insert widget"); + } + + /// Insert a gizmo doc with a `category` property. Mirror of + /// [`insert_widget`] for the normal-countable regression fixture. + fn insert_gizmo(drive: &Drive, data_contract: &DataContract, id: [u8; 32], category: &str) { + let platform_version = PlatformVersion::latest(); + let document_type = data_contract + .document_type_for_name("gizmo") + .expect("gizmo doc type"); + + let mut properties = StdBTreeMap::new(); + properties.insert("category".to_string(), Value::Text(category.to_string())); + let document: Document = DocumentV0 { + id: Identifier::from(id), + owner_id: Identifier::from([0u8; 32]), + properties, + revision: None, + created_at: None, + updated_at: None, + transferred_at: None, + created_at_block_height: None, + updated_at_block_height: None, + transferred_at_block_height: None, + created_at_core_block_height: None, + updated_at_core_block_height: None, + transferred_at_core_block_height: None, + creator_id: None, + } + .into(); + let storage_flags = Some(Cow::Owned(StorageFlags::SingleEpoch(0))); + drive + .add_document_for_contract( + DocumentAndContractInfo { + owned_document_info: OwnedDocumentInfo { + document_info: DocumentRefInfo((&document, storage_flags)), + owner_id: None, + }, + contract: data_contract, + document_type, + }, + false, + BlockInfo::default(), + true, + None, + platform_version, + None, + ) + .expect("insert gizmo"); + } + + /// **Equal-only rangeCountable**: `brand == "acme"` against + /// single-property `byBrand` (rangeCountable). The path query + /// must stop *one segment short* of the legacy shape — at + /// `[..., "brand"]` with the query asking for + /// `Key(serialize("acme"))` — so the resolved element is the + /// terminator value tree itself (a CountTree). The legacy shape + /// would have descended to `[..., "brand", serialize("acme")]` + /// + `Key([0])`, which adds a redundant merk layer. + #[test] + fn equal_only_rangecountable_path_query_targets_value_tree_directly() { + let drive = setup_drive_with_initial_state_structure(None); + let platform_version = PlatformVersion::latest(); + let data_contract = build_by_brand_range_countable_contract(); + drive + .apply_contract( + &data_contract, + BlockInfo::default(), + true, + StorageFlags::optional_default_as_cow(), + None, + platform_version, + ) + .expect("apply contract"); + + // 3 acme + 2 contoso so we have a non-trivial per-brand count + // to verify against. + insert_widget(&drive, &data_contract, [1u8; 32], "acme", None); + insert_widget(&drive, &data_contract, [2u8; 32], "acme", None); + insert_widget(&drive, &data_contract, [3u8; 32], "acme", None); + insert_widget(&drive, &data_contract, [4u8; 32], "contoso", None); + insert_widget(&drive, &data_contract, [5u8; 32], "contoso", None); + + let document_type = data_contract + .document_type_for_name("widget") + .expect("widget"); + let brand_eq = WhereClause { + field: "brand".to_string(), + operator: WhereOperator::Equal, + value: Value::Text("acme".to_string()), + }; + let index = DriveDocumentCountQuery::find_countable_index_for_where_clauses( + document_type.indexes(), + std::slice::from_ref(&brand_eq), + ) + .expect("byBrand covers brand==acme"); + assert!( + index.range_countable, + "fixture: byBrand must be rangeCountable for this test to exercise the optimization" + ); + let query = DriveDocumentCountQuery { + document_type, + contract_id: data_contract.id().to_buffer(), + document_type_name: "widget".to_string(), + index, + where_clauses: vec![brand_eq.clone()], + }; + + // Shape assertion: path stops at `[..., "brand"]`, query + // selects `Key(serialize("acme"))`. + let path_query = query + .point_lookup_count_path_query(platform_version) + .expect("path query builds"); + // Path: [DataContractDocuments, contract_id, 1, "widget", + // "brand"] — 5 segments, last one is the prop name. + assert_eq!( + path_query.path.last().expect("non-empty path"), + &b"brand".to_vec(), + "rangeCountable Equal-only path must end at the property-name \ + subtree, NOT at the serialized value (which would re-introduce \ + the `[0]` descent)" + ); + let serialized_acme = document_type + .serialize_value_for_key("brand", &Value::Text("acme".to_string()), platform_version) + .expect("serialize brand key"); + let items = &path_query.query.query.items; + assert_eq!(items.len(), 1, "single Key item for Equal-only"); + assert_eq!( + items[0], + QueryItem::Key(serialized_acme.clone()), + "Equal-only rangeCountable selector must be Key(serialize(value)) — \ + a regression to Key([0]) would mean the optimization was reverted" + ); + assert_ne!( + items[0], + QueryItem::Key(vec![0]), + "Key([0]) is the normal-countable selector and must NOT appear here" + ); + let subquery_branch = &path_query.query.query.default_subquery_branch; + assert!( + subquery_branch.subquery.is_none() && subquery_branch.subquery_path.is_none(), + "Equal-only rangeCountable must not set a subquery (the resolved \ + element IS the count-bearing value tree)" + ); + + // Counts match: no-proof and prove agree, both report 3. + let no_proof = query + .execute_no_proof(&drive, None, platform_version) + .expect("no-proof"); + assert_eq!(no_proof.len(), 1); + assert_eq!(no_proof[0].count, Some(3), "acme has 3 widgets"); + + let proof_bytes = query + .execute_point_lookup_count_with_proof(&drive, None, platform_version) + .expect("prove count"); + assert!(!proof_bytes.is_empty()); + let (_root_hash, entries) = query + .verify_point_lookup_count_proof(&proof_bytes, platform_version) + .expect("verify"); + let summed: u64 = entries.iter().map(|e| e.count.unwrap_or(0)).sum(); + assert_eq!( + summed, 3, + "rangeCountable Equal-only verified count must equal the no-proof \ + total — different merk layer, same answer" + ); + } + + /// **In-on-terminator rangeCountable**: `brand IN [acme, contoso, + /// absent]` against single-property `byBrand` (rangeCountable). + /// Outer Keys land directly on CountTree value trees; no + /// subquery is set. The verifier picks up the In value from + /// `grove_key` (since `path.len() == base_path_len`) rather than + /// `path[base_path_len]` like the normal-countable shape. + #[test] + fn in_on_rangecountable_terminator_path_query_has_no_subquery() { + let drive = setup_drive_with_initial_state_structure(None); + let platform_version = PlatformVersion::latest(); + let data_contract = build_by_brand_range_countable_contract(); + drive + .apply_contract( + &data_contract, + BlockInfo::default(), + true, + StorageFlags::optional_default_as_cow(), + None, + platform_version, + ) + .expect("apply contract"); + + insert_widget(&drive, &data_contract, [1u8; 32], "acme", None); + insert_widget(&drive, &data_contract, [2u8; 32], "acme", None); + insert_widget(&drive, &data_contract, [3u8; 32], "contoso", None); + // Note: no `absent` widgets — pins the "absent branches + // silently omitted" contract for the new shape too. + + let document_type = data_contract + .document_type_for_name("widget") + .expect("widget"); + let brand_in = WhereClause { + field: "brand".to_string(), + operator: WhereOperator::In, + value: Value::Array(vec![ + Value::Text("acme".to_string()), + Value::Text("contoso".to_string()), + Value::Text("absent".to_string()), + ]), + }; + let index = DriveDocumentCountQuery::find_countable_index_for_where_clauses( + document_type.indexes(), + std::slice::from_ref(&brand_in), + ) + .expect("byBrand covers brand IN [...]"); + assert!(index.range_countable); + let query = DriveDocumentCountQuery { + document_type, + contract_id: data_contract.id().to_buffer(), + document_type_name: "widget".to_string(), + index, + where_clauses: vec![brand_in.clone()], + }; + + let path_query = query + .point_lookup_count_path_query(platform_version) + .expect("path query builds"); + assert_eq!( + path_query.path.last().expect("non-empty path"), + &b"brand".to_vec(), + "In-on-terminator rangeCountable: path stops at the property-name \ + subtree (`[..., \"brand\"]`); outer Keys enumerate the In values" + ); + let items = &path_query.query.query.items; + assert_eq!( + items.len(), + 3, + "expected one outer Key per In value (acme, contoso, absent)" + ); + for it in items { + assert!( + matches!(it, QueryItem::Key(_)), + "outer items must all be Key(_) — got {:?}", + it + ); + } + let subquery_branch = &path_query.query.query.default_subquery_branch; + assert!( + subquery_branch.subquery.is_none() && subquery_branch.subquery_path.is_none(), + "In-on-rangeCountable-terminator must not set a subquery — the outer \ + Keys resolve directly to the value-tree CountTrees. \ + A regression that sets `Key([0])` as the subquery would silently \ + work (because grovedb would still find the CountTree under `[0]`) \ + but emits a bigger proof — exactly what this optimization aims \ + to avoid." + ); + + // End-to-end correctness. + let no_proof = query + .execute_no_proof(&drive, None, platform_version) + .expect("no-proof"); + // Per-In fan-out aggregates into a single summed entry on + // the no-proof side. + assert_eq!(no_proof.len(), 1); + assert_eq!(no_proof[0].count, Some(3), "2 acme + 1 contoso = 3"); + + let proof_bytes = query + .execute_point_lookup_count_with_proof(&drive, None, platform_version) + .expect("prove count"); + let (_root_hash, entries) = query + .verify_point_lookup_count_proof(&proof_bytes, platform_version) + .expect("verify"); + + // Absent branches are omitted, so only the 2 present brands + // surface — same omission semantics as the normal-countable + // path (see `test_point_lookup_proof_omits_absent_in_branches_from_entries`). + assert_eq!(entries.len(), 2); + let summed: u64 = entries.iter().map(|e| e.count.unwrap_or(0)).sum(); + assert_eq!(summed, 3); + + // Per-entry sanity: each entry's `key` is the serialized In + // value (lifted from `grove_key` by the verifier). + let key_acme = document_type + .serialize_value_for_key("brand", &Value::Text("acme".to_string()), platform_version) + .expect("serialize acme"); + let key_contoso = document_type + .serialize_value_for_key( + "brand", + &Value::Text("contoso".to_string()), + platform_version, + ) + .expect("serialize contoso"); + let acme_entry = entries + .iter() + .find(|e| e.key == key_acme) + .expect("acme entry present"); + assert_eq!(acme_entry.count, Some(2)); + let contoso_entry = entries + .iter() + .find(|e| e.key == key_contoso) + .expect("contoso entry present"); + assert_eq!(contoso_entry.count, Some(1)); + } + + /// **Compound rangeCountable**: `brand IN [acme, contoso] AND + /// color = "red"` against `byBrandColor` (rangeCountable + /// terminator = `color`). The In is on a prefix and `color` is + /// the trailing Equal; the optimization lifts the terminator + /// value into the subquery's `Key(serialize("red"))` so the + /// subquery_path ends at the terminator's property-name segment + /// `["color"]` rather than `["color", serialize("red")]`. + /// + /// This shape is the one most likely to drift in a refactor — + /// the trailing-Equal loop in `point_lookup_count_path_query` + /// pushes `(name, value)` pairs into `subquery_path_extension`, + /// and the optimization pops the last value out at the end. A + /// regression that forgets to pop (or pops the wrong element) + /// would silently produce a bigger proof or a wrong path query. + #[test] + fn compound_in_prefix_plus_trailing_equal_on_rangecountable_terminator() { + let drive = setup_drive_with_initial_state_structure(None); + let platform_version = PlatformVersion::latest(); + let data_contract = build_by_brand_color_range_countable_contract(); + drive + .apply_contract( + &data_contract, + BlockInfo::default(), + true, + StorageFlags::optional_default_as_cow(), + None, + platform_version, + ) + .expect("apply contract"); + + // (brand, color): + // acme/red ×3, acme/blue ×1 + // contoso/red ×2, contoso/green ×1 + // stark/red ×1 (excluded by In) + // Expected for `brand IN [acme, contoso] AND color = red`: + // acme: 3, contoso: 2, total: 5. + let docs = [ + ("acme", "red"), + ("acme", "red"), + ("acme", "red"), + ("acme", "blue"), + ("contoso", "red"), + ("contoso", "red"), + ("contoso", "green"), + ("stark", "red"), + ]; + for (i, (brand, color)) in docs.iter().enumerate() { + insert_widget( + &drive, + &data_contract, + [(i + 1) as u8; 32], + brand, + Some(color), + ); + } + + let document_type = data_contract + .document_type_for_name("widget") + .expect("widget"); + let brand_in = WhereClause { + field: "brand".to_string(), + operator: WhereOperator::In, + value: Value::Array(vec![ + Value::Text("acme".to_string()), + Value::Text("contoso".to_string()), + ]), + }; + let color_eq = WhereClause { + field: "color".to_string(), + operator: WhereOperator::Equal, + value: Value::Text("red".to_string()), + }; + let clauses = vec![brand_in, color_eq]; + let index = DriveDocumentCountQuery::find_countable_index_for_where_clauses( + document_type.indexes(), + &clauses, + ) + .expect("byBrandColor covers brand IN + color ="); + assert!(index.range_countable); + assert_eq!(index.properties.len(), 2); + let query = DriveDocumentCountQuery { + document_type, + contract_id: data_contract.id().to_buffer(), + document_type_name: "widget".to_string(), + index, + where_clauses: clauses, + }; + + let path_query = query + .point_lookup_count_path_query(platform_version) + .expect("path query builds"); + // base_path ends at `[..., "brand"]` (the In-bearing prop's + // property-name subtree). + assert_eq!( + path_query.path.last().expect("non-empty path"), + &b"brand".to_vec() + ); + + // Subquery shape: `set_subquery_path = ["color"]`, + // `subquery.items = [Key(serialize("red"))]`. The legacy + // shape would have had `set_subquery_path = ["color", + // serialize("red")]` + `subquery.items = [Key([0])]`. + let subquery_branch = &path_query.query.query.default_subquery_branch; + let subquery_path = subquery_branch + .subquery_path + .as_ref() + .expect("compound rangeCountable trailing Equal must set subquery_path"); + assert_eq!( + subquery_path, + &vec![b"color".to_vec()], + "subquery_path must end at the terminator's property-name segment \ + (`color`), with the terminator's serialized value lifted into \ + the subquery's Key — a regression that left the value here would \ + re-introduce the `[0]` descent" + ); + let subquery = subquery_branch + .subquery + .as_ref() + .expect("compound rangeCountable must set subquery"); + let serialized_red = document_type + .serialize_value_for_key("color", &Value::Text("red".to_string()), platform_version) + .expect("serialize color key"); + assert_eq!(subquery.items.len(), 1); + assert_eq!( + subquery.items[0], + QueryItem::Key(serialized_red), + "subquery selector must be Key(serialize(terminator_value)) — \ + NOT Key([0])" + ); + assert_ne!(subquery.items[0], QueryItem::Key(vec![0])); + + // Correctness end-to-end. + let no_proof = query + .execute_no_proof(&drive, None, platform_version) + .expect("no-proof"); + assert_eq!(no_proof.len(), 1); + assert_eq!(no_proof[0].count, Some(5), "3 acme/red + 2 contoso/red"); + + let proof_bytes = query + .execute_point_lookup_count_with_proof(&drive, None, platform_version) + .expect("prove count"); + let (_root_hash, entries) = query + .verify_point_lookup_count_proof(&proof_bytes, platform_version) + .expect("verify"); + let summed: u64 = entries.iter().map(|e| e.count.unwrap_or(0)).sum(); + assert_eq!(summed, 5); + } + + /// **Optimization is uniform across countability tiers** — pins + /// that a plain `countable: true` index (NOT `rangeCountable`) + /// also gets the compact value-tree-direct proof shape. + /// + /// This used to be the inverse pin (the legacy `Key([0])` shape + /// is preserved for non-range_countable indexes), but the + /// insertion side now makes the terminator value tree a + /// `CountTree` for any countable index — not just rangeCountable + /// ones — so the optimization activates uniformly. A regression + /// to the old layout (`NormalTree` value trees + `[0]` descent + /// for non-range_countable) would fail the shape assertion here + /// AND silently break counts at runtime (`NormalTree`'s + /// `count_value_or_default()` returns 1, not the doc count). + /// + /// `rangeCountable` is no longer needed for the smaller-proof + /// win — it's now strictly an opt-in for `AggregateCountOnRange` + /// (the property-name tree upgrade to `ProvableCountTree`). + #[test] + fn plain_countable_path_query_targets_value_tree_directly() { + let drive = setup_drive_with_initial_state_structure(None); + let platform_version = PlatformVersion::latest(); + let data_contract = build_by_category_normal_countable_contract(); + drive + .apply_contract( + &data_contract, + BlockInfo::default(), + true, + StorageFlags::optional_default_as_cow(), + None, + platform_version, + ) + .expect("apply contract"); + + insert_gizmo(&drive, &data_contract, [1u8; 32], "tools"); + insert_gizmo(&drive, &data_contract, [2u8; 32], "tools"); + + let document_type = data_contract + .document_type_for_name("gizmo") + .expect("gizmo"); + let category_eq = WhereClause { + field: "category".to_string(), + operator: WhereOperator::Equal, + value: Value::Text("tools".to_string()), + }; + let index = DriveDocumentCountQuery::find_countable_index_for_where_clauses( + document_type.indexes(), + std::slice::from_ref(&category_eq), + ) + .expect("byCategory covers category=tools"); + assert!( + index.countable.is_countable(), + "fixture: byCategory must be countable (any tier) so the \ + value-tree-direct optimization activates" + ); + assert!( + !index.range_countable, + "fixture: byCategory must NOT be `rangeCountable` so this test \ + actually exercises the plain-countable arm of the generalization" + ); + let query = DriveDocumentCountQuery { + document_type, + contract_id: data_contract.id().to_buffer(), + document_type_name: "gizmo".to_string(), + index, + where_clauses: vec![category_eq], + }; + + let path_query = query + .point_lookup_count_path_query(platform_version) + .expect("path query builds"); + let serialized_tools = document_type + .serialize_value_for_key( + "category", + &Value::Text("tools".to_string()), + platform_version, + ) + .expect("serialize category"); + // Optimized shape: path ends at the property-name segment + // (NOT at the serialized value), and the query item is + // `Key(serialized_value)`. A regression that re-introduced + // the `[0]` descent for plain countable would fire here. + assert_eq!( + path_query.path.last().expect("non-empty path"), + &b"category".to_vec(), + "plain `countable: true` Equal-only path must end at the \ + property-name subtree (matching the rangeCountable shape) — \ + the insertion side now stores the value tree as `CountTree` \ + regardless of `range_countable`, so the optimization applies \ + uniformly." + ); + let items = &path_query.query.query.items; + assert_eq!(items.len(), 1); + assert_eq!( + items[0], + QueryItem::Key(serialized_tools), + "selector must be `Key(serialize(value))` so the resolved \ + element is the terminator value-tree CountTree itself" + ); + assert_ne!( + items[0], + QueryItem::Key(vec![0]), + "`Key([0])` is the legacy descent and must NOT appear here — \ + the optimization is now active for every countable tier" + ); + + // Counts agree across no-proof and prove. + let no_proof = query + .execute_no_proof(&drive, None, platform_version) + .expect("no-proof"); + assert_eq!(no_proof[0].count, Some(2)); + let proof_bytes = query + .execute_point_lookup_count_with_proof(&drive, None, platform_version) + .expect("prove count"); + let (_root_hash, entries) = query + .verify_point_lookup_count_proof(&proof_bytes, platform_version) + .expect("verify"); + let summed: u64 = entries.iter().map(|e| e.count.unwrap_or(0)).sum(); + assert_eq!(summed, 2); + } } diff --git a/packages/rs-drive/src/query/mod.rs b/packages/rs-drive/src/query/mod.rs index 054489e7f72..3111cfe6f03 100644 --- a/packages/rs-drive/src/query/mod.rs +++ b/packages/rs-drive/src/query/mod.rs @@ -14,7 +14,8 @@ pub use { #[cfg(feature = "server")] pub use drive_document_count_query::{ - DocumentCountRequest, DocumentCountResponse, RangeCountOptions, + CountMode, DocumentCountRequest, DocumentCountResponse, RangeCountOptions, + MAX_LIMIT_AS_FAILSAFE, }; // Imports available when either "server" or "verify" features are enabled #[cfg(any(feature = "server", feature = "verify"))] @@ -655,14 +656,14 @@ impl<'a> DriveDocumentQuery<'a> { WhereClause::from_components(clauses_components) } else { Err(Error::Query(QuerySyntaxError::InvalidFormatWhereClause( - "where clause must be an array", + "where clause must be an array".to_string(), ))) } }) .collect::, Error>>() } else { Err(Error::Query(QuerySyntaxError::InvalidFormatWhereClause( - "where clause must be an array", + "where clause must be an array".to_string(), ))) } })?; @@ -783,13 +784,13 @@ impl<'a> DriveDocumentQuery<'a> { WhereClause::from_components(clauses_components) } else { Err(Error::Query(QuerySyntaxError::InvalidFormatWhereClause( - "where clause must be an array", + "where clause must be an array".to_string(), ))) } }) .collect::, Error>>(), _ => Err(Error::Query(QuerySyntaxError::InvalidFormatWhereClause( - "where clause must be an array", + "where clause must be an array".to_string(), ))), }?; diff --git a/packages/rs-drive/src/verify/document_count/mod.rs b/packages/rs-drive/src/verify/document_count/mod.rs index 8d0bebf1596..095c17547d8 100644 --- a/packages/rs-drive/src/verify/document_count/mod.rs +++ b/packages/rs-drive/src/verify/document_count/mod.rs @@ -10,6 +10,12 @@ /// Aggregate-count proof verification (`AggregateCountOnRange` /// primitive) — returns a single `u64`. pub mod verify_aggregate_count_proof; +/// Carrier-aggregate-count proof verification (carrier +/// `AggregateCountOnRange` composition with outer `Keys` per +/// grovedb PR #663) — returns one `(in_key, u64)` per resolved In +/// branch. Used by `group_by = [in_field]` count queries that +/// carry both an `In` clause and a range clause. +pub mod verify_carrier_aggregate_count_proof; /// Distinct-count proof verification (regular range proof against a /// `ProvableCountTree`) — returns the per-`(in_key, key)` entries the /// proof commits to. diff --git a/packages/rs-drive/src/verify/document_count/verify_carrier_aggregate_count_proof/mod.rs b/packages/rs-drive/src/verify/document_count/verify_carrier_aggregate_count_proof/mod.rs new file mode 100644 index 00000000000..79341a98921 --- /dev/null +++ b/packages/rs-drive/src/verify/document_count/verify_carrier_aggregate_count_proof/mod.rs @@ -0,0 +1,53 @@ +mod v0; + +use crate::error::drive::DriveError; +use crate::error::Error; +use crate::query::DriveDocumentCountQuery; +use crate::verify::RootHash; +use dpp::version::PlatformVersion; + +impl DriveDocumentCountQuery<'_> { + /// Verifies a **carrier** `AggregateCountOnRange` proof and + /// returns `(root_hash, per_key_counts)` — one `(in_key, u64)` + /// pair per resolved In branch in serialized lex-asc order. + /// + /// Counterpart to the prover-side + /// [`execute_carrier_aggregate_count_with_proof`](Self::execute_carrier_aggregate_count_with_proof): + /// rebuilds the same `PathQuery` via + /// [`carrier_aggregate_count_path_query`](Self::carrier_aggregate_count_path_query) + /// and calls + /// [`grovedb::GroveDb::verify_aggregate_count_query_per_key`]. + /// The caller is responsible for combining the returned + /// `root_hash` with the surrounding tenderdash signature — see + /// `rs-drive-proof-verifier`'s wrapper for the canonical + /// composition. + /// + /// # Arguments + /// * `proof` — raw grovedb proof bytes. + /// * `platform_version` — selects the method version. + /// + /// The `Vec<(Vec, u64)>` payload mirrors grovedb's per-key + /// carrier shape — see the v0 inner method for the rationale. + #[allow(clippy::type_complexity)] + pub fn verify_carrier_aggregate_count_proof( + &self, + proof: &[u8], + limit: Option, + platform_version: &PlatformVersion, + ) -> Result<(RootHash, Vec<(Vec, u64)>), Error> { + match platform_version + .drive + .methods + .verify + .document_count + .verify_carrier_aggregate_count_proof + { + 0 => self.verify_carrier_aggregate_count_proof_v0(proof, limit, platform_version), + version => Err(Error::Drive(DriveError::UnknownVersionMismatch { + method: "DriveDocumentCountQuery::verify_carrier_aggregate_count_proof".to_string(), + known_versions: vec![0], + received: version, + })), + } + } +} diff --git a/packages/rs-drive/src/verify/document_count/verify_carrier_aggregate_count_proof/v0/mod.rs b/packages/rs-drive/src/verify/document_count/verify_carrier_aggregate_count_proof/v0/mod.rs new file mode 100644 index 00000000000..4a7d195fd40 --- /dev/null +++ b/packages/rs-drive/src/verify/document_count/verify_carrier_aggregate_count_proof/v0/mod.rs @@ -0,0 +1,48 @@ +use crate::error::Error; +use crate::query::DriveDocumentCountQuery; +use crate::verify::RootHash; +use dpp::version::PlatformVersion; +use grovedb::GroveDb; + +impl DriveDocumentCountQuery<'_> { + /// v0 of [`Self::verify_carrier_aggregate_count_proof`]. + /// + /// Rebuilds the same `PathQuery` the prover used via + /// [`Self::carrier_aggregate_count_path_query`] and feeds it + /// through + /// [`grovedb::GroveDb::verify_aggregate_count_query_per_key`]. + /// The merk-level carrier composition emits one aggregate + /// `u64` per outer In key (each independently cryptographically + /// committed via `node_hash_with_count` — see + /// [grovedb PR #663](https://github.com/dashpay/grovedb/pull/663)). + /// + /// Prover/verifier byte-for-byte path query agreement is + /// load-bearing: any drift in serialization of the In-key + /// bytes, the subquery path, the range query item, or the + /// limit field would break the merk-root recomputation. Both + /// sides share [`Self::carrier_aggregate_count_path_query`] + /// for that reason. + /// + /// The `Vec<(Vec, u64)>` payload is the grovedb-native + /// per-key carrier shape (one serialized In-key + its + /// aggregate `u64`); naming it via a `type` alias would only + /// rebrand the same nested tuple without making the call site + /// clearer. + #[inline(always)] + #[allow(clippy::type_complexity)] + pub(super) fn verify_carrier_aggregate_count_proof_v0( + &self, + proof: &[u8], + limit: Option, + platform_version: &PlatformVersion, + ) -> Result<(RootHash, Vec<(Vec, u64)>), Error> { + let path_query = self.carrier_aggregate_count_path_query(limit, platform_version)?; + let (root_hash, entries) = GroveDb::verify_aggregate_count_query_per_key( + proof, + &path_query, + &platform_version.drive.grove_version, + ) + .map_err(|e| Error::GroveDB(Box::new(e)))?; + Ok((root_hash, entries)) + } +} diff --git a/packages/rs-drive/src/verify/document_count/verify_distinct_count_proof/v0/mod.rs b/packages/rs-drive/src/verify/document_count/verify_distinct_count_proof/v0/mod.rs index e1184c9245b..b6eae52a849 100644 --- a/packages/rs-drive/src/verify/document_count/verify_distinct_count_proof/v0/mod.rs +++ b/packages/rs-drive/src/verify/document_count/verify_distinct_count_proof/v0/mod.rs @@ -71,7 +71,18 @@ impl DriveDocumentCountQuery<'_> { } else { None }; - out.push(SplitCountEntry { in_key, key, count }); + // Distinct-count proof emits one entry per + // verified `KVCount` op in the proof — always + // `Some(_)`. SDK-side synthesis can add `None` + // entries for missing-from-proof keys if the + // caller's request named them (only meaningful + // for In-grouped paths; range-distinct doesn't + // enumerate keys in advance). + out.push(SplitCountEntry { + in_key, + key, + count: Some(count), + }); } } Ok((root_hash, out)) diff --git a/packages/rs-drive/src/verify/document_count/verify_point_lookup_count_proof/v0/mod.rs b/packages/rs-drive/src/verify/document_count/verify_point_lookup_count_proof/v0/mod.rs index e8a2ca2f446..85cc16e20e0 100644 --- a/packages/rs-drive/src/verify/document_count/verify_point_lookup_count_proof/v0/mod.rs +++ b/packages/rs-drive/src/verify/document_count/verify_point_lookup_count_proof/v0/mod.rs @@ -10,30 +10,74 @@ impl DriveDocumentCountQuery<'_> { /// Rebuilds the same `PathQuery` the prover used via /// [`Self::point_lookup_count_path_query`], feeds it through /// `GroveDb::verify_query`, and walks the verified - /// `(path, key, Option)` triples to build the per-branch - /// entry list. + /// `(path, grove_key, Option)` triples to build the + /// per-branch entry list. /// - /// For the compound shape (`In` at any index position, with 0..N - /// trailing Equals afterwards) the In value sits at - /// `path[base_path_len]` — the first extra path segment beyond - /// the path query's `path`. The builder stops `base_path` at the - /// In-bearing property's property-name subtree (see - /// [`Self::point_lookup_count_path_query`]), regardless of how - /// many trailing Equals exist, so the In value lands at the same - /// offset in every compound emission. For the Equal-only shape - /// the emitted path equals `path_query.path` so the entry's `key` + /// ## Single terminator shape: value-tree-direct (kept in sync with the builder) + /// + /// The insertion side stores **every** countable index's + /// terminator value tree as a `CountTree` (with sibling + /// continuations wrapped `Element::NonCounted` so they don't + /// pollute the parent's count). The builder takes advantage of + /// this uniformly: proofs target the value tree directly via + /// `Key(serialized_value)` instead of descending one more layer + /// to a `Key([0])` CountTree child. The proof is exactly one + /// merk hash shallower per resolved branch than the legacy `[0]`- + /// child shape would have been. + /// + /// Emitted-path layouts: + /// - **Equal-only**: `path == base_path` (ends at the + /// terminator's property-name segment, e.g. `[..., "color"]`), + /// `grove_key = serialized_terminator_value`. The verified + /// element is the terminator value tree's CountTree. + /// - **In-on-terminator**: `path == base_path` (ends at the + /// In-bearing prop's name subtree), `grove_key = serialized_In_value`. + /// The outer `Key(in_value)` resolves directly to each + /// per-In CountTree. + /// - **In + trailing Equals (terminator is a trailing Equal)**: + /// `path` extends through the In value + trailing `(name, + /// value)` pairs and ends at the terminator's property-name + /// segment; `grove_key = serialized_terminator_value`. The In + /// value sits at `path[base_path_len]`. + /// + /// ## In-value extraction + /// + /// For compound (In) shapes the In value is the per-branch user- + /// visible key. The discriminator is `path.len() vs base_path_len`: + /// + /// - `path.len() > base_path_len`: the descent walked past + /// `base_path` through trailing-Equal segments. The In value + /// sits at `path[base_path_len]`. + /// - `path.len() == base_path_len`: only reachable for the + /// In-on-terminator shape, where no subquery is set and the + /// outer `Key(in_value)` resolves to the value tree directly. + /// The In value is `grove_key`. + /// + /// For Equal-only shapes (`has_in_clause = false`) the per-key + /// dimension is structurally meaningless and the entry's `key` /// stays empty. /// - /// `GroveDb::verify_query` is appropriate here for the same reason - /// as the distinct-count verifier: because each branch's count is - /// returned as its own entry, a missing `Key` branch (no documents - /// at that In value) surfaces as a missing entry rather than a - /// wrong total — the caller can detect "I asked for 3 In values - /// but got entries for 2" directly. We don't need - /// `absence_proofs_for_non_existing_searched_keys: true` for - /// soundness; it would be a useful future addition for "prove this - /// In value has zero entries" but isn't required for the unmerged - /// per-branch contract. + /// `GroveDb::verify_query` returns `(path, grove_key, + /// Option)` triples. The path query built by + /// [`Self::point_lookup_count_path_query`] does NOT set + /// `absence_proofs_for_non_existing_searched_keys: true`, so: + /// + /// - **Present branches** → `Some(element)` triples → + /// `Some(element.count_value_or_default())` on the entry. The + /// element is the terminator value tree's CountTree, whose + /// `count_value_or_default()` returns the per-branch doc count + /// directly. + /// - **Absent branches** (queried In value with no element in + /// the merk tree) → silently omitted from the elements stream. + /// Callers detect "queried but absent" by diffing the + /// request's In array against the returned entries. See + /// `tests::test_point_lookup_proof_omits_absent_in_branches_from_entries` + /// for the end-to-end contract pin. + /// + /// The `elem.map(...)` below preserves grovedb's `Option` + /// shape so a future variant that flips + /// `absence_proofs_for_non_existing_searched_keys: true` surfaces + /// absent branches as `count: None`. #[inline(always)] pub(super) fn verify_point_lookup_count_proof_v0( &self, @@ -43,10 +87,10 @@ impl DriveDocumentCountQuery<'_> { let path_query = self.point_lookup_count_path_query(platform_version)?; let base_path_len = path_query.path.len(); // Set once an `In` clause is present anywhere on the covering - // index — the builder stops `base_path` at the In-bearing - // property's name subtree regardless of how many trailing - // Equals descend further, so the In value always sits at - // `path[base_path_len]` in the compound emission. + // index. The In value's emission offset depends on the + // terminator shape (see in-value-extraction section of this + // fn's docstring); we discriminate inline via `path.len() + // == base_path_len`. let has_in_clause = self .where_clauses .iter() @@ -56,35 +100,47 @@ impl DriveDocumentCountQuery<'_> { .map_err(|e| Error::GroveDB(Box::new(e)))?; let mut out: Vec = Vec::with_capacity(elements.len()); - for (path, _grove_key, elem) in elements { - // `_grove_key` is the trailing key on the path (always - // `[0]` here — the CountTree key under the value tree); - // we don't store it in the entry because the count's - // user-visible key is the In value (compound shape) or - // empty (Equal-only). - let Some(e) = elem else { continue }; - let count = e.count_value_or_default(); - if count == 0 { - continue; - } - // Compound shape (In at any index position, 0..N - // trailing Equals afterwards): the In value sits at - // `path[base_path_len]` — the first extra segment past - // the path query's base path. When trailing Equals are - // present the descent continues through - // `[trailing_prop_name_1, trailing_value_1, ..., - // trailing_prop_name_n, trailing_value_n, 0]`, but the - // In value is still at the same offset because - // `base_path` stops at the In-bearing property's - // property-name subtree regardless of how many trailing - // segments follow. Equal-only shape: the emitted path - // equals `path_query.path` (no extra segments) so the - // `key` field is empty. - let key = if has_in_clause && path.len() > base_path_len { - path[base_path_len].clone() + for (path, grove_key, elem) in elements { + // For compound (In) shapes the In value is at: + // - `path[base_path_len]` when the descent walked past + // `base_path` (the In + trailing Equals shape — outer + // key + trailing `(name, value)` pairs land the + // resolved element past base_path); + // - `grove_key` when no descent happened beyond + // `base_path` (the In-on-terminator shape, where outer + // `Key(in_value)` resolves to the value tree directly + // with no subquery). + // + // For Equal-only shapes (`has_in_clause = false`) the + // entry has no per-key dimension; `key` stays empty. + let key = if has_in_clause { + if path.len() > base_path_len { + path[base_path_len].clone() + } else { + // In-on-terminator shape — `grove_key` is the + // serialized In value. + grove_key + } } else { Vec::new() }; + // Propagate grovedb's `Option` directly: + // `Some(element)` → `Some(count_value_or_default())` + // `None` → `None` (not produced by today's + // path query — see fn docstring; + // forward-compat for an absence-proof + // variant). + // `count_value_or_default()` reads the terminator value + // tree's own count — the insertion side stores every + // countable terminator value tree as a CountTree with + // sibling continuations `NonCounted`-wrapped, so this + // count equals the per-branch doc count exactly. + // Zero-count CountTree elements aren't materialized in + // the merk tree (a CountTree is removed when its last + // doc is deleted), so `Some(0)` from this branch would + // mean a malformed proof — pass it through verbatim + // rather than swallow it. + let count = elem.map(|e| e.count_value_or_default()); out.push(SplitCountEntry { in_key: None, key, diff --git a/packages/rs-platform-version/Cargo.toml b/packages/rs-platform-version/Cargo.toml index 95195cea75d..810b613cb4c 100644 --- a/packages/rs-platform-version/Cargo.toml +++ b/packages/rs-platform-version/Cargo.toml @@ -11,7 +11,7 @@ license = "MIT" thiserror = { version = "2.0.12" } bincode = { version = "=2.0.1" } versioned-feature-core = { git = "https://github.com/dashpay/versioned-feature-core", version = "1.0.0" } -grovedb-version = { git = "https://github.com/dashpay/grovedb", rev = "a917d92d2477672eed73c4c08e53e93449a6a094" } +grovedb-version = { git = "https://github.com/dashpay/grovedb", rev = "7a649386ac8a06a608a614385a2333e03cd931c3" } [features] mock-versions = [] 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 e1ea399d02b..4b198177f77 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 @@ -8,8 +8,6 @@ pub struct DriveAbciQueryVersions { pub response_metadata: FeatureVersion, pub proofs_query: FeatureVersion, pub document_query: FeatureVersionBounds, - pub document_count_query: FeatureVersionBounds, - pub document_split_count_query: FeatureVersionBounds, pub prefunded_specialized_balances: DriveAbciQueryPrefundedSpecializedBalancesVersions, pub identity_based_queries: DriveAbciQueryIdentityVersions, pub token_queries: DriveAbciQueryTokenVersions, 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 ef9b8c5519f..1f9c399f035 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 @@ -13,18 +13,16 @@ pub const DRIVE_ABCI_QUERY_VERSIONS_V1: DriveAbciQueryVersions = DriveAbciQueryV proofs_query: 0, document_query: FeatureVersionBounds { min_version: 0, - max_version: 0, - default_current_version: 0, - }, - document_count_query: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - document_split_count_query: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, + // Accept v0 (legacy `getDocuments`) and v1 (unified + // SQL-shaped surface with select / group_by / having). + // New clients default to v1 — it's the canonical surface, + // covers everything v0 does plus count queries (replacing + // the removed `getDocumentsCount` endpoint), and exposes + // explicit `select` / `group_by` / `having` knobs. v0 + // still accepted on the wire so old clients keep working + // until they re-pin their versions. + max_version: 1, + default_current_version: 1, }, prefunded_specialized_balances: DriveAbciQueryPrefundedSpecializedBalancesVersions { balance: FeatureVersionBounds { 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 8a840c4d43d..3e81fa55745 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 @@ -52,6 +52,7 @@ pub struct DriveVerifyDocumentMethodVersions { #[derive(Clone, Debug, Default)] pub struct DriveVerifyDocumentCountMethodVersions { pub verify_aggregate_count_proof: FeatureVersion, + pub verify_carrier_aggregate_count_proof: FeatureVersion, pub verify_distinct_count_proof: FeatureVersion, pub verify_point_lookup_count_proof: FeatureVersion, pub verify_primary_key_count_tree_proof: FeatureVersion, 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 8ea2bc10914..e24cc0e57b3 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 @@ -20,6 +20,7 @@ pub const DRIVE_VERIFY_METHOD_VERSIONS_V1: DriveVerifyMethodVersions = DriveVeri }, document_count: DriveVerifyDocumentCountMethodVersions { verify_aggregate_count_proof: 0, + verify_carrier_aggregate_count_proof: 0, verify_distinct_count_proof: 0, verify_point_lookup_count_proof: 0, verify_primary_key_count_tree_proof: 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 968068efb26..2871e55c336 100644 --- a/packages/rs-platform-version/src/version/mocks/v2_test.rs +++ b/packages/rs-platform-version/src/version/mocks/v2_test.rs @@ -176,16 +176,6 @@ pub const TEST_PLATFORM_V2: PlatformVersion = PlatformVersion { max_version: 0, default_current_version: 0, }, - document_count_query: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - document_split_count_query: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, prefunded_specialized_balances: DriveAbciQueryPrefundedSpecializedBalancesVersions { balance: FeatureVersionBounds { min_version: 0, diff --git a/packages/rs-platform-wallet-ffi/src/tokens/group_info.rs b/packages/rs-platform-wallet-ffi/src/tokens/group_info.rs index 78595b5050c..b5c75a01a09 100644 --- a/packages/rs-platform-wallet-ffi/src/tokens/group_info.rs +++ b/packages/rs-platform-wallet-ffi/src/tokens/group_info.rs @@ -94,7 +94,7 @@ mod tests { fn test_decode_other_signer_null_action_id() { unsafe { let result = decode_group_info(2, 0, std::ptr::null(), false); - assert!(matches!(result, Err(_)), "expected Err(NullPointer)"); + assert!(result.is_err(), "expected Err(NullPointer)"); } } @@ -120,7 +120,7 @@ mod tests { fn test_decode_invalid_kind() { unsafe { let result = decode_group_info(99, 0, std::ptr::null(), false); - assert!(matches!(result, Err(_)), "expected Err(InvalidParameter)"); + assert!(result.is_err(), "expected Err(InvalidParameter)"); } } } diff --git a/packages/rs-platform-wallet-ffi/tests/integration_tests.rs b/packages/rs-platform-wallet-ffi/tests/integration_tests.rs index 09adb69a20f..de826eddf43 100644 --- a/packages/rs-platform-wallet-ffi/tests/integration_tests.rs +++ b/packages/rs-platform-wallet-ffi/tests/integration_tests.rs @@ -50,7 +50,6 @@ fn test_wallet_from_mnemonic() { let result = platform_wallet_info_create_from_mnemonic( Network::Testnet.into(), mnemonic.as_ptr(), - std::ptr::null(), &mut handle, ); @@ -266,7 +265,6 @@ fn test_full_workflow() { let result = platform_wallet_info_create_from_mnemonic( Network::Testnet.into(), mnemonic.as_ptr(), - std::ptr::null(), &mut wallet_handle, ); assert_eq!(result.code, PlatformWalletFFIResultCode::Success); diff --git a/packages/rs-platform-wallet/Cargo.toml b/packages/rs-platform-wallet/Cargo.toml index c766d7759ef..973c010bf2b 100644 --- a/packages/rs-platform-wallet/Cargo.toml +++ b/packages/rs-platform-wallet/Cargo.toml @@ -48,7 +48,7 @@ image = { version = "0.25", default-features = false, features = ["png", "jpeg", zeroize = "1" # Shielded pool (optional, behind `shielded` feature) -grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "a917d92d2477672eed73c4c08e53e93449a6a094", optional = true } +grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "7a649386ac8a06a608a614385a2333e03cd931c3", optional = true } zip32 = { version = "0.2.0", default-features = false, optional = true } [dev-dependencies] diff --git a/packages/rs-platform-wallet/src/wallet/identity/network/profile.rs b/packages/rs-platform-wallet/src/wallet/identity/network/profile.rs index 860139c4cde..f1298284c2c 100644 --- a/packages/rs-platform-wallet/src/wallet/identity/network/profile.rs +++ b/packages/rs-platform-wallet/src/wallet/identity/network/profile.rs @@ -155,6 +155,7 @@ impl IdentityWallet { // Build query: profile documents WHERE $ownerId = identity_id. let query = dash_sdk::platform::DocumentQuery { + select: dash_sdk::dapi_grpc::platform::v0::get_documents_request::get_documents_request_v1::Select::Documents, data_contract: Arc::clone(dashpay_contract), document_type_name: "profile".to_string(), where_clauses: vec![WhereClause { @@ -162,6 +163,8 @@ impl IdentityWallet { operator: WhereOperator::Equal, value: platform_value!(identity_id), }], + group_by: vec![], + having: vec![], order_by_clauses: vec![], limit: 1, start: None, @@ -425,6 +428,7 @@ impl IdentityWallet { use dpp::platform_value::platform_value; let query = dash_sdk::platform::DocumentQuery { + select: dash_sdk::dapi_grpc::platform::v0::get_documents_request::get_documents_request_v1::Select::Documents, data_contract: Arc::clone(&dashpay_contract), document_type_name: "profile".to_string(), where_clauses: vec![WhereClause { @@ -432,6 +436,8 @@ impl IdentityWallet { operator: WhereOperator::Equal, value: platform_value!(identity_id), }], + group_by: vec![], + having: vec![], order_by_clauses: vec![], limit: 1, start: None, diff --git a/packages/rs-platform-wallet/src/wallet/platform_addresses/wallet.rs b/packages/rs-platform-wallet/src/wallet/platform_addresses/wallet.rs index f7d83a2fff3..aec6d5b4f9d 100644 --- a/packages/rs-platform-wallet/src/wallet/platform_addresses/wallet.rs +++ b/packages/rs-platform-wallet/src/wallet/platform_addresses/wallet.rs @@ -117,11 +117,7 @@ impl PlatformAddressWallet { .platform_payment_managed_account_at_index_mut(*account_index) { for (p2pkh, funds) in account_state.found() { - account.set_address_credit_balance( - *p2pkh, - funds.balance, - None, - ); + account.set_address_credit_balance(*p2pkh, funds.balance, None); } } } diff --git a/packages/rs-sdk-ffi/src/document/queries/count.rs b/packages/rs-sdk-ffi/src/document/queries/count.rs index 83ec4c5adaf..358c51bc7e0 100644 --- a/packages/rs-sdk-ffi/src/document/queries/count.rs +++ b/packages/rs-sdk-ffi/src/document/queries/count.rs @@ -1,32 +1,31 @@ //! Unified document-count FFI for iOS / native callers. //! -//! Wraps the rs-sdk `DocumentSplitCounts::fetch` flow (which handles -//! every count mode — total, per-`In`-value, per-distinct-value-in- -//! range, summed-over-range) so callers can obtain document counts -//! without having to construct `GetDocumentsCountRequest` payloads -//! themselves. +//! Wraps the rs-sdk `DocumentSplitCounts::fetch` flow (which +//! handles every count mode — total, per-group entries, summed +//! aggregate) so callers can obtain document counts without +//! constructing `GetDocumentsRequest` v1 payloads directly. //! -//! The previous version exposed two functions (`dash_sdk_document_count` -//! returning a single u64, `dash_sdk_document_split_count` returning a -//! per-key map). Now that the count endpoint carries -//! `return_distinct_counts_in_range`, `order_by`, and `limit`, the -//! split path subsumes the simple-total case (total count becomes a -//! one-entry map with empty key), so we expose one entry point with -//! all the knobs. +//! Surface mirrors the v1 wire shape one-to-one: callers pass +//! `where_json`, optional `order_by_json`, optional +//! `group_by_json` (`[]` → aggregate, `[""]` → per-group +//! entries, `["", ""]` → compound +//! distinct), and `limit`. The split path subsumes the simple- +//! total case (`group_by_json = null` returns a one-entry map +//! with an empty key), so one entry point covers every count +//! mode the server supports. use std::collections::BTreeMap; use std::ffi::{CStr, CString}; use std::os::raw::c_char; +use dash_sdk::dapi_grpc::platform::v0::get_documents_request::get_documents_request_v1::Select; use dash_sdk::dpp::platform_value::Value; use dash_sdk::dpp::prelude::DataContract; use dash_sdk::drive::query::{OrderClause, WhereClause, WhereOperator}; -use dash_sdk::platform::documents::document_count_query::DocumentCountQuery; use dash_sdk::platform::documents::document_query::DocumentQuery; use dash_sdk::platform::Fetch; use drive_proof_verifier::DocumentSplitCounts; use serde::{Deserialize, Serialize}; -use serde_json; use crate::sdk::SDKWrapper; use crate::types::{DataContractHandle, SDKHandle}; @@ -52,9 +51,8 @@ struct OrderClauseJson { struct DocumentCountResult { /// Per-key counts. Keys are hex-encoded so iOS callers can match /// them against the corresponding platform-value-encoded property - /// bytes. For total-count requests (no `in` clause and - /// `return_distinct_counts_in_range = false`) this is a one-entry - /// map with an empty key. + /// bytes. For total-count requests (empty / null `group_by_json`) + /// this is a one-entry map with an empty key. counts: BTreeMap, } @@ -145,6 +143,36 @@ fn json_to_platform_value(json: serde_json::Value) -> Result { } } +/// Parse the optional `group_by_json` C string parameter into a +/// `Vec`. `null` and empty string are accepted as +/// equivalent to "no grouping" (aggregate count). Valid input +/// is a JSON array of field-name strings, e.g.: +/// +/// - `null` or `""` → `[]` (aggregate) +/// - `"[\"color\"]"` → `["color"]` (per-distinct-`color` entries) +/// - `"[\"category\",\"color\"]"` → `["category", "color"]` +/// (compound distinct entries; only valid for +/// `(in_field, range_field)` shapes — other multi-field +/// group_by values return `QuerySyntaxError::Unsupported`) +/// +/// Mirrors the wire-level `group_by: repeated string` field on +/// `GetDocumentsRequestV1` directly — no implicit translation, +/// no transform, no SDK-internal helper between FFI and wire. +#[allow(clippy::result_large_err)] +unsafe fn parse_group_by_json(group_by_json: *const c_char) -> Result, FFIError> { + if group_by_json.is_null() { + return Ok(Vec::new()); + } + let s = CStr::from_ptr(group_by_json) + .to_str() + .map_err(FFIError::from)?; + if s.is_empty() { + return Ok(Vec::new()); + } + serde_json::from_str(s) + .map_err(|e| FFIError::InternalError(format!("Invalid group_by JSON: {}", e))) +} + #[allow(clippy::result_large_err)] unsafe fn build_base_query( data_contract: &DataContract, @@ -199,56 +227,127 @@ unsafe fn build_base_query( Ok(query) } +/// Decode the C ABI `limit: i64` per the +/// [`dash_sdk_document_count`] contract: +/// +/// - `-1` → SDK's `0` "unset" sentinel (maps to `None` on the V1 +/// wire, asking the server to apply its default). +/// - `> 0` → explicit cap, returned as `u32`. +/// - `0` → rejected ([`FFIError::InternalError`]). The v1 wire +/// rejects `Some(0)` uniformly across SELECT modes (see proto +/// docs); the FFI surfaces the same rejection at decode time +/// instead of relaying through the SDK's `0`-as-unset +/// internal sentinel, where it would silently mean "use +/// server default" and contradict the `-1 = default` contract. +/// - `< -1` → rejected. Any negative value other than the +/// explicit `-1` sentinel is malformed input; the previous +/// lenient decode mapped `-2`, `-100`, etc. all to "use +/// server default", which masked caller bugs (uninitialized +/// memory, arithmetic underflow). Single-valued per input is +/// the FFI contract. +/// - `> u32::MAX` → rejected (overflow). +/// +/// Extracted from the call site so the decode can be unit- +/// tested directly without standing up an SDK / data contract / +/// runtime — see the bottom-of-module tests. +fn decode_ffi_limit(limit: i64) -> Result { + match limit { + -1 => Ok(0), // SDK-internal "unset" sentinel; maps to `None` on the V1 wire. + n if n < -1 => Err(FFIError::InternalError(format!( + "limit {} is invalid; use -1 for server default or a positive \ + integer for an explicit cap", + n + ))), + 0 => Err(FFIError::InternalError( + "limit 0 is invalid; use -1 for server default or a positive \ + integer for an explicit cap (zero-cap query is structurally \ + meaningless and is rejected on the v1 wire as well)" + .to_string(), + )), + n if n > u32::MAX as i64 => Err(FFIError::InternalError(format!( + "limit {} exceeds u32::MAX", + n + ))), + n => Ok(n as u32), + } +} + /// Count documents matching a query. /// -/// Returns a JSON string of shape `{"counts": {"": , ...}}`. -/// Hex keys correspond to the platform-value-encoded property values -/// from the underlying CountTree / ProvableCountTree path; iOS callers -/// should hex-decode them and decode against the contract's index- -/// property type if they need a typed key. +/// Returns a JSON string of shape +/// `{"counts": {"": , ...}}`. Hex keys +/// correspond to the platform-value-encoded property values from +/// the underlying CountTree / ProvableCountTree path; iOS callers +/// should hex-decode them and decode against the contract's +/// index-property type if they need a typed key. /// -/// For simple total counts (no `in` clause in `where_json` and -/// `return_distinct_counts_in_range = false`) the result is a one-entry -/// map with an empty key — `counts[""]` is the total. +/// For simple total counts (empty/null `group_by_json`) the +/// result is a one-entry map with an empty key — `counts[""]` +/// is the total. /// /// Per-key result shapes: -/// - **`in` clause**: one entry per (deduped) value in the In array. -/// - **range clause + `return_distinct_counts_in_range = true`**: one -/// entry per distinct property value within the range. For compound -/// queries (`in` on a prefix property + range on the terminator), the -/// per-`in_key`/per-`key` entries are summed by `key` into a flat -/// map. Callers needing the unmerged compound shape should use a -/// richer binding (not yet exposed via this entry point). +/// - **`group_by_json = [""]`** (where `` +/// is constrained by an `in` clause): one entry per (deduped) +/// value in the In array. +/// - **`group_by_json = [""]`** (where +/// `` is constrained by a range clause): one +/// entry per distinct property value within the range. +/// - **`group_by_json = ["", ""]`** for +/// compound queries (`in` on a prefix property + range on the +/// terminator): per-`(in_key, key)` entries are summed by `key` +/// into a flat map. Callers needing the unmerged compound +/// shape should use a richer binding (not yet exposed via this +/// entry point). /// /// # Tunables -/// - `return_distinct_counts_in_range`: when `true` AND the query has -/// a range clause, returns per-distinct-value entries instead of a -/// single sum. No-op when there's no range clause. +/// - `group_by_json`: optional JSON array of field names mirroring +/// the wire `group_by` field directly. Null/empty → aggregate +/// count. See per-key shape rules above and the proto docs for +/// the supported `(select, group_by, where)` combinations; any +/// combination outside that set returns +/// `QuerySyntaxError::Unsupported`. /// - `order_by_json`: optional JSON `[{"field": "", "direction": -/// "asc"|"desc"}]`. The first clause's direction controls split-mode -/// entry ordering server-side; on the `RangeDistinctProof` prove -/// path it is part of the path-query bytes the SDK reconstructs to -/// verify the proof (prover and verifier must agree — empty -/// `order_by` defaults to ascending on both sides). On the -/// `PointLookupProof` path (`(In, prove, no-range)`) order_by is -/// not consulted: the path-query builder sorts In keys lex- -/// ascending unconditionally for prove/no-proof parity. Null or -/// empty → no orderBy (ascending default for split-mode entry +/// "asc"|"desc"}]`. The first clause's direction controls +/// split-mode entry ordering server-side; on the +/// `RangeDistinctProof` prove path it is part of the path-query +/// bytes the SDK reconstructs to verify the proof (prover and +/// verifier must agree — empty `order_by` defaults to ascending +/// on both sides). On the `PointLookupProof` path +/// (`(In, prove, no-range)`) order_by is not consulted: the +/// path-query builder sorts In keys lex-ascending +/// unconditionally for prove/no-proof parity. Null or empty → +/// no orderBy (ascending default for split-mode entry /// direction). -/// - `limit`: `-1` = use server default -/// (`default_query_limit` on no-proof paths, -/// `crate::config::DEFAULT_QUERY_LIMIT` on the prove-distinct path — -/// the compile-time constant the SDK verifier reads, so proof bytes -/// stay deterministic across operators). `≥ 0` = explicit cap -/// (clamped to `max_query_limit` on no-proof paths, rejected with -/// `InvalidLimit` if too large on the prove-distinct path — silent -/// clamping would invisibly break verification). +/// - `limit`: sentinel-encoded `int64` on the C ABI. +/// - `-1`: use server default +/// (`default_query_limit` on no-proof paths, +/// `crate::config::DEFAULT_QUERY_LIMIT` on the prove-distinct +/// path — the compile-time constant the SDK verifier reads, +/// so proof bytes stay deterministic across operators). +/// - `> 0`: explicit cap (clamped to `max_query_limit` on +/// no-proof paths, rejected with `InvalidLimit` if too large +/// on the prove-distinct path — silent clamping would +/// invisibly break verification). +/// - `0`: **rejected with `InvalidParameter`** at the FFI +/// boundary. The v1 wire's `optional uint32 limit` rejects +/// `Some(0)` uniformly across SELECT modes (see proto +/// docs); the FFI surfaces that contract at decode time +/// rather than relaying the value through the SDK's +/// `0`-as-unset internal sentinel where it would silently +/// mean "use server default" — that would contradict the +/// `-1 = default` contract documented here. +/// - `< -1`: **rejected with `InvalidParameter`**. Any +/// negative value other than the explicit `-1` sentinel is +/// malformed input; clients shouldn't expect it to be +/// normalized to `-1` because that hides bugs in caller +/// code that miscomputes negative values. /// /// # Safety /// - `sdk_handle` and `data_contract_handle` must be valid, non-null pointers. /// - `document_type` must be a NUL-terminated C string valid for the duration of the call. /// - `where_json` may be null; if non-null it must be a NUL-terminated JSON string of `[{field, operator, value}]`. /// - `order_by_json` may be null; if non-null it must be a NUL-terminated JSON string of `[{field, direction}]`. +/// - `group_by_json` may be null; if non-null it must be a NUL-terminated JSON string of `["", ...]`. /// - On success, returns a heap-allocated C string pointer; caller must free it using SDK routines. #[no_mangle] pub unsafe extern "C" fn dash_sdk_document_count( @@ -257,7 +356,7 @@ pub unsafe extern "C" fn dash_sdk_document_count( document_type: *const c_char, where_json: *const c_char, order_by_json: *const c_char, - return_distinct_counts_in_range: bool, + group_by_json: *const c_char, limit: i64, ) -> DashSDKResult { if sdk_handle.is_null() || data_contract_handle.is_null() || document_type.is_null() { @@ -273,26 +372,18 @@ pub unsafe extern "C" fn dash_sdk_document_count( let result: Result = wrapper.runtime.block_on(async { let base_query = build_base_query(data_contract, document_type, where_json, order_by_json)?; - // Sentinel decoding for the C ABI. `-1` means "unset; use - // server-side default". The Rust-side request field is - // `Option` so `None` here is the same as the request - // omitting the field on the wire. - let limit_opt = if limit < 0 { - None - } else if limit > u32::MAX as i64 { - return Err(FFIError::InternalError(format!( - "limit {} exceeds u32::MAX", - limit - ))); - } else { - Some(limit as u32) - }; - - let count_query = DocumentCountQuery { - document_query: base_query, - return_distinct_counts_in_range, - limit: limit_opt, - }; + let limit_u32 = decode_ffi_limit(limit)?; + + // `group_by_json` mirrors the wire's `repeated string` + // field one-to-one. No FFI-side translation: callers ask + // for exactly the per-group shape they want; the server + // rejects unsupported `(select, group_by, where)` + // combinations (see proto docs). + let group_by = parse_group_by_json(group_by_json)?; + let count_query = base_query + .with_select(Select::Count) + .with_group_by_fields(group_by) + .with_limit(limit_u32); // `DocumentSplitCounts::fetch` handles every count mode — // for total-count requests the result is a one-entry map @@ -326,3 +417,127 @@ pub unsafe extern "C" fn dash_sdk_document_count( Err(e) => DashSDKResult::error(e.into()), } } + +#[cfg(test)] +mod tests { + //! Unit tests for the C ABI `limit: i64` decode contract. + //! + //! The decode is extracted into [`decode_ffi_limit`] so these + //! tests don't need to stand up an SDK / data contract / + //! runtime to pin the per-input behavior — every test below + //! exercises a single sentinel category and asserts the exact + //! mapping the docstring on [`dash_sdk_document_count`] + //! promises. + + use super::*; + + /// `-1` is the documented "use server default" sentinel. + /// Maps to the SDK's internal `0` unset sentinel (translated + /// to `None` on the V1 wire). + #[test] + fn decode_ffi_limit_minus_one_is_unset_sentinel() { + assert_eq!( + decode_ffi_limit(-1).expect("`-1` must decode to the unset sentinel"), + 0, + "the FFI's `-1` sentinel must map to the SDK's `0` unset \ + sentinel; any other value would silently change the wire \ + representation" + ); + } + + /// `0` is invalid at the FFI boundary — the v1 wire rejects + /// `Some(0)` uniformly across SELECT modes, and the FFI + /// surfaces that rejection at decode time instead of relaying + /// through the SDK's `0`-as-unset internal sentinel (where + /// it would silently mean "use server default" and + /// contradict the `-1 = default` contract). + /// + /// This is the load-bearing test for the new tightening — a + /// regression that re-collapses `0` into the unset sentinel + /// (e.g. someone reverts to `if limit < 0 { 0 }`) would mask + /// caller bugs that pass uninitialized memory. + #[test] + fn decode_ffi_limit_zero_is_rejected() { + let err = decode_ffi_limit(0).expect_err("`0` must be rejected at the FFI boundary"); + let msg = err.to_string(); + assert!( + msg.contains("limit 0 is invalid"), + "expected explicit `limit 0 is invalid` rejection; got: {}", + msg + ); + assert!( + msg.contains("-1") && msg.contains("positive"), + "rejection message must point callers at the valid alternatives \ + (-1 for default, positive for explicit cap); got: {}", + msg + ); + } + + /// Any negative value other than `-1` is malformed input. + /// The previous lenient decode mapped `-2`, `-100`, ... all + /// to `0` (i.e. "use server default"), which masked caller + /// bugs from arithmetic underflow or uninitialized memory. + #[test] + fn decode_ffi_limit_negative_other_than_minus_one_is_rejected() { + for bad in [-2i64, -100, i64::MIN] { + // `.err().unwrap_or_else(|| panic!(...))` rather than + // `.expect_err(&format!(...))` — the latter trips + // clippy::expect_fun_call (CI runs `-D warnings`). + let err = decode_ffi_limit(bad) + .err() + .unwrap_or_else(|| panic!("`{}` must be rejected (not -1)", bad)); + let msg = err.to_string(); + assert!( + msg.contains(&bad.to_string()), + "rejection message for `{}` must include the offending \ + value so callers can locate the bug; got: {}", + bad, + msg + ); + assert!( + msg.contains("-1") && msg.contains("positive"), + "rejection message for `{}` must direct callers to the \ + valid alternatives; got: {}", + bad, + msg + ); + } + } + + /// `> 0` decodes verbatim as `u32`. + #[test] + fn decode_ffi_limit_positive_decodes_verbatim() { + // Edge values + a typical caller-provided cap. + for n in [1i64, 50, 1000, u32::MAX as i64] { + // `.unwrap_or_else(|e| panic!(...))` rather than + // `.expect(&format!(...))` — same clippy::expect_fun_call + // rationale as the negative test above. + let decoded = decode_ffi_limit(n) + .unwrap_or_else(|e| panic!("`{}` must decode to {} but errored: {}", n, n, e)); + assert_eq!( + decoded, n as u32, + "positive `{}` must decode unchanged; any normalization \ + would silently shift the explicit cap callers requested", + n + ); + } + } + + /// Values exceeding `u32::MAX` overflow the wire field and + /// are rejected. Distinct from the `< -1` rejection so + /// callers can locate overflow bugs vs. malformed-negative + /// bugs from the error message. + #[test] + fn decode_ffi_limit_over_u32_max_is_rejected() { + let too_big = u32::MAX as i64 + 1; + let err = decode_ffi_limit(too_big) + .expect_err("values > u32::MAX must be rejected to prevent silent truncation"); + let msg = err.to_string(); + assert!( + msg.contains(&too_big.to_string()) && msg.contains("u32::MAX"), + "overflow-rejection message must name both the offending value \ + AND the limit so callers can fix their caps; got: {}", + msg + ); + } +} diff --git a/packages/rs-sdk/Cargo.toml b/packages/rs-sdk/Cargo.toml index f16146d20ba..dd7e8774e54 100644 --- a/packages/rs-sdk/Cargo.toml +++ b/packages/rs-sdk/Cargo.toml @@ -18,7 +18,7 @@ drive = { path = "../rs-drive", default-features = false, features = [ ] } drive-proof-verifier = { path = "../rs-drive-proof-verifier", default-features = false } -grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "a917d92d2477672eed73c4c08e53e93449a6a094", features = ["client", "sqlite"], optional = true } +grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "7a649386ac8a06a608a614385a2333e03cd931c3", features = ["client", "sqlite"], optional = true } dash-async = { path = "../rs-dash-async" } dash-context-provider = { path = "../rs-context-provider", default-features = false } dash-platform-macros = { path = "../rs-dash-platform-macros" } diff --git a/packages/rs-sdk/src/mock/requests.rs b/packages/rs-sdk/src/mock/requests.rs index 485c9f2588f..45ee8d485e1 100644 --- a/packages/rs-sdk/src/mock/requests.rs +++ b/packages/rs-sdk/src/mock/requests.rs @@ -584,14 +584,25 @@ impl MockResponse for drive_proof_verifier::DocumentCount { } } +/// Wire shape for `DocumentSplitCounts` mock round-trip: +/// `(in_key, key, count)` triples preserving the In dimension +/// AND the verified-vs-absent count distinction. Shared by +/// `mock_serialize`/`mock_deserialize` below — single source of +/// truth so the encode/decode generics align by construction, +/// and clippy's `type_complexity` lint (CI runs with +/// `-D warnings`) doesn't fire on the inline form. +type DocumentSplitCountTriples = Vec<(Option>, Vec, Option)>; + impl MockResponse for drive_proof_verifier::DocumentSplitCounts { fn mock_serialize(&self, _sdk: &MockDashPlatformSdk) -> Vec { let bincode_config = standard(); - // Serialize as `(Option>, Vec, u64)` triples so - // the In dimension survives the mock roundtrip. Required for - // compound (`In + range + distinct`) test fixtures to keep - // their `in_key` values across the mock encode/decode hop. - let triples: Vec<(Option>, Vec, u64)> = self + // Serialize as `(in_key, key, count)` triples so the In + // dimension AND the verified-vs-absent count distinction + // both survive the mock roundtrip. Required for compound + // (`In + range + distinct`) test fixtures to keep their + // `in_key` values, and for GroupByIn-absent-branch + // fixtures to keep their `None` counts. + let triples: DocumentSplitCountTriples = self .0 .iter() .map(|e| (e.in_key.clone(), e.key.clone(), e.count)) @@ -603,11 +614,8 @@ impl MockResponse for drive_proof_verifier::DocumentSplitCounts { where Self: Sized, { - // Alias the wire triple so clippy doesn't flag the bincode - // generic as too complex. Same shape mock_serialize emits. - type DecodedTriples = Vec<(Option>, Vec, u64)>; let bincode_config = standard(); - let (triples, _): (DecodedTriples, _) = + let (triples, _): (DocumentSplitCountTriples, _) = bincode::decode_from_slice(buf, bincode_config).expect("decode DocumentSplitCounts"); let entries: Vec = triples .into_iter() diff --git a/packages/rs-sdk/src/mock/sdk.rs b/packages/rs-sdk/src/mock/sdk.rs index 764e3734573..9e52c297d24 100644 --- a/packages/rs-sdk/src/mock/sdk.rs +++ b/packages/rs-sdk/src/mock/sdk.rs @@ -134,12 +134,6 @@ impl MockDashPlatformSdk { match request_type { "DocumentQuery" => load_expectation::(&mut dapi, filename)?, - "DocumentCountQuery" => load_expectation::< - crate::platform::documents::document_count_query::DocumentCountQuery, - >(&mut dapi, filename)?, - "GetDocumentsCountRequest" => { - load_expectation::(&mut dapi, filename)? - } "GetEpochsInfoRequest" => { load_expectation::(&mut dapi, filename)? } diff --git a/packages/rs-sdk/src/platform/dashpay/contact_request_queries.rs b/packages/rs-sdk/src/platform/dashpay/contact_request_queries.rs index e9ea07d001c..802d7537ec8 100644 --- a/packages/rs-sdk/src/platform/dashpay/contact_request_queries.rs +++ b/packages/rs-sdk/src/platform/dashpay/contact_request_queries.rs @@ -41,6 +41,7 @@ impl Sdk { // Query for sent contact requests (where this identity is the owner) // Note: We need to filter by $ownerId to get only this identity's sent requests let query = DocumentQuery { + select: dapi_grpc::platform::v0::get_documents_request::get_documents_request_v1::Select::Documents, data_contract: dashpay_contract, document_type_name: "contactRequest".to_string(), where_clauses: vec![WhereClause { @@ -48,6 +49,8 @@ impl Sdk { operator: WhereOperator::Equal, value: platform_value!(identity_id), }], + group_by: vec![], + having: vec![], order_by_clauses: vec![], limit: limit.unwrap_or(100), start: None, @@ -80,6 +83,7 @@ impl Sdk { // Query for received contact requests (where this identity is toUserId) let query = DocumentQuery { + select: dapi_grpc::platform::v0::get_documents_request::get_documents_request_v1::Select::Documents, data_contract: dashpay_contract, document_type_name: "contactRequest".to_string(), where_clauses: vec![WhereClause { @@ -87,6 +91,8 @@ impl Sdk { operator: WhereOperator::Equal, value: platform_value!(identity_id), }], + group_by: vec![], + having: vec![], order_by_clauses: vec![], limit: limit.unwrap_or(100), start: None, diff --git a/packages/rs-sdk/src/platform/documents/count_proof_helpers.rs b/packages/rs-sdk/src/platform/documents/count_proof_helpers.rs new file mode 100644 index 00000000000..d9d7df12382 --- /dev/null +++ b/packages/rs-sdk/src/platform/documents/count_proof_helpers.rs @@ -0,0 +1,244 @@ +//! Shared count-proof dispatch used by [`DocumentCount`] and +//! [`DocumentSplitCounts`]. +//! +//! Both consumers reduce to "give me a verified +//! `Vec` for this `DocumentQuery`" — +//! [`DocumentCount`] sums the entries into a single `u64`, +//! [`DocumentSplitCounts`] passes them through. Putting the +//! four-way proof dispatch behind one helper means the per-shape +//! routing (which proof primitive to use, which index to pick, +//! how to wrap the result) lives in exactly one place; the +//! consumers become thin wrappers. +//! +//! [`DocumentCount`]: drive_proof_verifier::DocumentCount +//! [`DocumentSplitCounts`]: drive_proof_verifier::DocumentSplitCounts + +use crate::platform::documents::document_query::DocumentQuery; +use dapi_grpc::platform::v0::get_documents_request::get_documents_request_v1::Select; +use dapi_grpc::platform::v0::{GetDocumentsResponse, Proof, ResponseMetadata}; +use dapi_grpc::platform::VersionedGrpcResponse; +use dash_context_provider::ContextProvider; +use dpp::version::PlatformVersion; +use dpp::{ + data_contract::accessors::v0::DataContractV0Getters, + data_contract::document_type::accessors::{DocumentTypeV0Getters, DocumentTypeV2Getters}, +}; +use drive::query::DriveDocumentCountQuery; +use drive_proof_verifier::{ + verify_aggregate_count_proof, verify_distinct_count_proof, verify_point_lookup_count_proof, + verify_primary_key_count_tree_proof, SplitCountEntry, +}; + +/// Validate that the caller-built [`DocumentQuery`] actually +/// targets the count surface. Without this check a caller who +/// forgets `.with_select(Select::Count)` would silently send a +/// `Documents` request and fail later inside the proof verifier +/// with an inscrutable "wrong wire shape" error; this surfaces +/// the misuse at the SDK boundary with a clear pointer to the +/// fix. +pub(super) fn assert_select_is_count( + request: &DocumentQuery, +) -> Result<(), drive_proof_verifier::Error> { + if request.select != Select::Count { + return Err(drive_proof_verifier::Error::RequestError { + error: format!( + "DocumentCount / DocumentSplitCounts require `select = Count`, got {:?}. \ + Call `.with_select(Select::Count)` on the DocumentQuery before fetching.", + request.select + ), + }); + } + Ok(()) +} + +/// Translate the SDK's `u32`-with-`0`-sentinel limit into the +/// `u16` the proof verifier wants to rebuild the prover's path +/// query. +/// +/// `0` falls back to [`drive::config::DEFAULT_QUERY_LIMIT`] — the +/// same compile-time constant the server's prove-distinct +/// dispatcher reads (NOT the operator-tunable +/// `drive_config.default_query_limit`, which the SDK can't see). +/// With both sides anchored to the shared constant the path-query +/// bytes match byte-for-byte across operators, so merk-root +/// recomputation succeeds regardless of any operator's tuning. +/// +/// Non-zero values must fit in `u16` since the wire's +/// `optional uint32` is wider than the verifier's path-query +/// representation. We `try_from` rather than truncate so a caller +/// passing `limit > u16::MAX` fails loudly at the SDK boundary +/// rather than silently producing a mismatched path query. +fn limit_to_u16_or_default(limit: u32) -> Result { + if limit == 0 { + return Ok(drive::config::DEFAULT_QUERY_LIMIT); + } + u16::try_from(limit).map_err(|_| drive_proof_verifier::Error::RequestError { + error: format!( + "limit {} exceeds u16::MAX; the prove-distinct path query cannot represent it", + limit + ), + }) +} + +/// Verify a count-shape proof and return per-branch entries. +/// +/// Single source of truth for the four-way count-proof dispatch: +/// +/// 1. **range + non-empty `group_by`** → `RangeDistinctProof`. +/// Emits one entry per distinct value via +/// `verify_distinct_count_proof`. Path-query reconstruction +/// uses [`limit_to_u16_or_default`] anchored to the shared +/// `DEFAULT_QUERY_LIMIT` so proof bytes are deterministic +/// across operators. +/// 2. **range + empty `group_by`** → `AggregateCountOnRange`. +/// Primitive emits a single u64; wrapped here as a single +/// empty-key entry so callers see a uniform `Vec<...>` shape. +/// 3. **no range + empty `where` + `documents_countable`** → +/// primary-key CountTree fast path. `verify_primary_key_count_tree_proof` +/// returns a `u64`; wrapped here as a single empty-key entry. +/// 4. **no range + covering `countable: true` index** → +/// `PointLookupProof`. `verify_point_lookup_count_proof` +/// emits one entry per **present** queried branch. Absent +/// In values are omitted from the returned list (the current +/// path query doesn't request absence proofs); callers that +/// need to surface "queried but absent" diff their request's +/// In array against the returned entries by key. See +/// `verify_point_lookup_count_proof_v0`'s docstring for the +/// forward-compat path to per-branch `count: None`. +/// +/// Wrapping (2) and (3) as single empty-key entries is the only +/// shape massage this helper does — the underlying primitives +/// genuinely emit `u64`s, and consumers ([`DocumentCount`] sums, +/// [`DocumentSplitCounts`] passes through) want a uniform +/// per-entry vec regardless. +/// +/// [`DocumentCount`]: drive_proof_verifier::DocumentCount +/// [`DocumentSplitCounts`]: drive_proof_verifier::DocumentSplitCounts +pub(super) fn verify_count_query( + request: DocumentQuery, + response: GetDocumentsResponse, + platform_version: &PlatformVersion, + provider: &dyn ContextProvider, +) -> Result<(Option>, ResponseMetadata, Proof), drive_proof_verifier::Error> { + let document_type = request + .data_contract + .document_type_for_name(&request.document_type_name) + .map_err(|e| drive_proof_verifier::Error::RequestError { + error: format!( + "document type {} not found in contract: {}", + request.document_type_name, e + ), + })?; + let proof = response + .proof() + .or(Err(drive_proof_verifier::Error::NoProofInResult))?; + let mtd = response + .metadata() + .or(Err(drive_proof_verifier::Error::EmptyResponseMetadata))?; + + let has_range = request + .where_clauses + .iter() + .any(|wc| DriveDocumentCountQuery::is_range_operator(wc.operator)); + + if has_range { + // Range path: either RangeDistinctProof (entries) or + // AggregateCountOnRange (single u64 wrapped as one entry). + let index = DriveDocumentCountQuery::find_range_countable_index_for_where_clauses( + document_type.indexes(), + &request.where_clauses, + ) + .ok_or_else(|| drive_proof_verifier::Error::RequestError { + error: "range count requires a `range_countable: true` index whose last \ + property matches the range field" + .to_string(), + })?; + let count_query = DriveDocumentCountQuery { + document_type, + contract_id: request.data_contract.id().to_buffer(), + document_type_name: request.document_type_name.clone(), + index, + where_clauses: request.where_clauses.clone(), + }; + + if !request.group_by.is_empty() { + let limit_u16 = limit_to_u16_or_default(request.limit)?; + let left_to_right = request + .order_by_clauses + .first() + .map(|c| c.ascending) + .unwrap_or(true); + let entries = verify_distinct_count_proof( + &count_query, + proof, + mtd, + limit_u16, + left_to_right, + platform_version, + provider, + )?; + return Ok((Some(entries), mtd.clone(), proof.clone())); + } + + let count = + verify_aggregate_count_proof(&count_query, proof, mtd, platform_version, provider)?; + return Ok(( + Some(single_empty_key_entry(count)), + mtd.clone(), + proof.clone(), + )); + } + + // No range: documents_countable fast path or covering + // countable index. + if request.where_clauses.is_empty() && document_type.documents_countable() { + let contract_id = request.data_contract.id().to_buffer(); + let count = verify_primary_key_count_tree_proof( + contract_id, + &request.document_type_name, + proof, + mtd, + platform_version, + provider, + )?; + return Ok(( + Some(single_empty_key_entry(count)), + mtd.clone(), + proof.clone(), + )); + } + + let index = DriveDocumentCountQuery::find_countable_index_for_where_clauses( + document_type.indexes(), + &request.where_clauses, + ) + .ok_or_else(|| drive_proof_verifier::Error::RequestError { + error: "prove count requires a `countable: true` index whose properties \ + exactly match the where clause fields, or `documentsCountable: \ + true` on the document type for unfiltered total counts" + .to_string(), + })?; + let count_query = DriveDocumentCountQuery { + document_type, + contract_id: request.data_contract.id().to_buffer(), + document_type_name: request.document_type_name.clone(), + index, + where_clauses: request.where_clauses.clone(), + }; + let entries = + verify_point_lookup_count_proof(&count_query, proof, mtd, platform_version, provider)?; + Ok((Some(entries), mtd.clone(), proof.clone())) +} + +/// Wrap a single `u64` from an aggregate proof primitive +/// (`AggregateCountOnRange` or `verify_primary_key_count_tree_proof`) +/// as a one-element `Vec` so callers see a +/// uniform shape regardless of which primitive verified the +/// proof. +fn single_empty_key_entry(count: u64) -> Vec { + vec![SplitCountEntry { + in_key: None, + key: Vec::new(), + count: Some(count), + }] +} diff --git a/packages/rs-sdk/src/platform/documents/document_count.rs b/packages/rs-sdk/src/platform/documents/document_count.rs new file mode 100644 index 00000000000..08b36c33eb3 --- /dev/null +++ b/packages/rs-sdk/src/platform/documents/document_count.rs @@ -0,0 +1,53 @@ +//! `FromProof` + `Fetch` for [`DocumentCount`] — the single-row +//! aggregate count view of the unified `getDocuments` endpoint. +//! +//! Callers build a [`DocumentQuery`] with +//! `.with_select(Select::Count)`, optionally adding a +//! `with_where(...)` clause; whatever the request shape, this +//! impl returns a single `u64` (the aggregate count). Per-shape +//! proof dispatch lives in +//! [`super::count_proof_helpers::verify_count_query`] — this +//! impl just sums the verified entries the helper returns. +//! +//! Empty entries (e.g. a verifier that emitted `None` for a +//! queried-but-absent branch) contribute 0 to the sum via +//! `filter_map(|e| e.count)`. + +use crate::platform::documents::count_proof_helpers::{assert_select_is_count, verify_count_query}; +use crate::platform::documents::document_query::DocumentQuery; +use crate::platform::Fetch; +use dapi_grpc::platform::v0::{GetDocumentsResponse, Proof, ResponseMetadata}; +use dash_context_provider::ContextProvider; +use dpp::dashcore::Network; +use dpp::version::PlatformVersion; +use drive_proof_verifier::{DocumentCount, FromProof}; + +impl FromProof for DocumentCount { + type Request = DocumentQuery; + type Response = GetDocumentsResponse; + + 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), drive_proof_verifier::Error> + where + Self: 'a, + { + let request: Self::Request = request.into(); + assert_select_is_count(&request)?; + let response: Self::Response = response.into(); + let (entries, mtd, proof) = + verify_count_query(request, response, platform_version, provider)?; + let count = entries + .map(|es| es.iter().filter_map(|e| e.count).sum::()) + .map(DocumentCount); + Ok((count, mtd, proof)) + } +} + +impl Fetch for DocumentCount { + type Request = DocumentQuery; +} diff --git a/packages/rs-sdk/src/platform/documents/document_count_query.rs b/packages/rs-sdk/src/platform/documents/document_count_query.rs deleted file mode 100644 index bb7aeaa44db..00000000000 --- a/packages/rs-sdk/src/platform/documents/document_count_query.rs +++ /dev/null @@ -1,771 +0,0 @@ -//! High-level SDK query for [`GetDocumentsCountRequest`]. -//! -//! [`DocumentCountQuery`] mirrors [`super::document_query::DocumentQuery`] for -//! the new count endpoint introduced by PR #3435: it wraps the data contract, -//! document type, and where clauses, converts to the gRPC request for -//! transport, and converts to a [`DriveDocumentQuery`] for proof verification. - -use std::sync::Arc; - -use crate::error::Error; -use crate::platform::documents::document_query::DocumentQuery; -use crate::platform::Fetch; -use ciborium::Value as CborValue; -use dapi_grpc::platform::v0::get_documents_count_request::{ - GetDocumentsCountRequestV0, Version as GetDocumentsCountRequestVersion, -}; -use dapi_grpc::platform::v0::{ - GetDocumentsCountRequest, GetDocumentsCountResponse, Proof, ResponseMetadata, -}; -use dapi_grpc::platform::VersionedGrpcResponse; -use dash_context_provider::ContextProvider; -use dpp::dashcore::Network; -use dpp::version::PlatformVersion; -use dpp::{ - data_contract::accessors::v0::DataContractV0Getters, - data_contract::document_type::accessors::{DocumentTypeV0Getters, DocumentTypeV2Getters}, - platform_value::Value, - prelude::DataContract, - ProtocolError, -}; -use drive::query::{ - DriveDocumentCountQuery, DriveDocumentQuery, OrderClause, WhereClause, WhereOperator, -}; -use drive_proof_verifier::{ - verify_aggregate_count_proof, verify_distinct_count_proof, verify_point_lookup_count_proof, - verify_primary_key_count_tree_proof, DocumentCount, DocumentSplitCounts, FromProof, -}; -use rs_dapi_client::transport::{ - AppliedRequestSettings, BoxFuture, TransportError, TransportRequest, -}; - -/// SDK-side query for the `GetDocumentsCount` endpoint. -/// -/// Wraps a [`DocumentQuery`] (so we can reuse its [`DriveDocumentQuery`] -/// conversion machinery) and is consumed by [`DocumentCount::fetch`]. -/// -/// Field defaults match the gRPC defaults: total-count summed result, -/// ascending order, no limit, proof-verifying transport. Setters -/// override individual fields without disturbing the rest. -#[derive(Debug, Clone, dash_platform_macros::Mockable)] -#[cfg_attr(feature = "mocks", derive(serde::Serialize, serde::Deserialize))] -pub struct DocumentCountQuery { - /// Underlying document query — the count endpoint takes the same - /// data-contract / document-type / where-clauses inputs as the - /// regular document query. - pub document_query: DocumentQuery, - /// `return_distinct_counts_in_range` request flag. Meaningful - /// when the where clauses contain a range operator: routes the - /// request to the per-distinct-value execution path on both - /// no-proof (`RangeNoProof`) AND prove (`RangeDistinctProof`) - /// transports. The prove path returns a regular range proof - /// against the property-name `ProvableCountTree` whose `KVCount` - /// ops carry per-distinct-value counts; the SDK's - /// `FromProof` for `DocumentSplitCounts` - /// extracts them via `verify_distinct_count_proof`. Default: - /// `false`. - pub return_distinct_counts_in_range: bool, - /// `limit` cap for distinct-mode entries. - /// - **No-proof paths**: server clamps to its `max_query_limit` - /// config; passing a larger value just gets clamped, not - /// rejected. - /// - **Prove path** (`RangeDistinctProof`): validate-don't-clamp. - /// `limit > max_query_limit` is rejected by the server with - /// `Error::Query(QuerySyntaxError::InvalidLimit(...))` because - /// silent clamping would invisibly break proof verification. - /// Unset falls back to `drive::config::DEFAULT_QUERY_LIMIT` - /// (the same compile-time constant the SDK verifier reads), - /// so proof bytes are deterministic across operators - /// regardless of their runtime `default_query_limit` tuning. - /// - /// No cursor field: pagination is expressed by narrowing the - /// underlying range itself (`color > `), which is equivalent in expressivity and avoids the - /// ambiguity a single-`bytes` cursor would have for compound - /// (`In + range + distinct`) queries whose natural sort is - /// `(in_key, key)`. - pub limit: Option, - // Order direction lives on the wrapped `document_query` — - // `DocumentQuery::order_by_clauses` is serialized into the - // request's `order_by` field. The first clause's direction - // controls split-mode entry ordering server-side; clauses are - // also load-bearing for `(In + prove)` walk determinism (see the - // `FromProof` impl below). -} - -impl DocumentCountQuery { - /// Build a count query from a contract reference and document type name. - pub fn new>>( - contract: C, - document_type_name: &str, - ) -> Result { - Ok(Self { - document_query: DocumentQuery::new(contract, document_type_name)?, - return_distinct_counts_in_range: false, - limit: None, - }) - } - - /// Add a where clause to the underlying query. - pub fn with_where(mut self, clause: WhereClause) -> Self { - self.document_query = self.document_query.with_where(clause); - self - } - - /// Add an order_by clause to the underlying query. The first - /// clause's direction controls split-mode entry ordering - /// server-side and is part of the path query bytes on the - /// `RangeDistinctProof` prove path (so prover and verifier must - /// agree; empty `order_by` defaults to ascending on both sides). - /// Unused on the `PointLookupProof` path — the builder sorts In - /// keys lex-ascending unconditionally for prove/no-proof parity. - pub fn with_order_by(mut self, clause: OrderClause) -> Self { - self.document_query = self.document_query.with_order_by(clause); - self - } - - /// Set `return_distinct_counts_in_range`. Meaningful with a - /// range where-clause on both no-proof and prove transports - /// (see field doc). - pub fn with_distinct_counts_in_range(mut self, distinct: bool) -> Self { - self.return_distinct_counts_in_range = distinct; - self - } - - /// Cap distinct-mode entry count. - /// - No-proof paths: server clamps to its `max_query_limit`. - /// - Prove path: server rejects `limit > max_query_limit` with - /// `InvalidLimit` rather than clamping silently (clamping - /// would invisibly break verification). Unset falls back to - /// `drive::config::DEFAULT_QUERY_LIMIT`, the same compile-time - /// constant the SDK verifier uses — see the field doc for - /// the deterministic-across-operators rationale. - pub fn with_limit(mut self, limit: Option) -> Self { - self.limit = limit; - self - } -} - -impl<'a> From<&'a DriveDocumentQuery<'a>> for DocumentCountQuery { - fn from(value: &'a DriveDocumentQuery<'a>) -> Self { - Self { - document_query: value.into(), - return_distinct_counts_in_range: false, - limit: None, - } - } -} - -impl<'a> From> for DocumentCountQuery { - fn from(value: DriveDocumentQuery<'a>) -> Self { - Self { - document_query: value.into(), - return_distinct_counts_in_range: false, - limit: None, - } - } -} - -impl TryFrom for GetDocumentsCountRequest { - type Error = Error; - - fn try_from(query: DocumentCountQuery) -> Result { - let where_bytes = serialize_where_clauses_to_cbor(&query.document_query.where_clauses)?; - let order_by_bytes = - serialize_order_by_clauses_to_cbor(&query.document_query.order_by_clauses)?; - Ok(GetDocumentsCountRequest { - version: Some(GetDocumentsCountRequestVersion::V0( - GetDocumentsCountRequestV0 { - data_contract_id: query.document_query.data_contract.id().to_vec(), - document_type: query.document_query.document_type_name.clone(), - r#where: where_bytes, - return_distinct_counts_in_range: query.return_distinct_counts_in_range, - order_by: order_by_bytes, - limit: query.limit, - // **Count Fetch always proves.** The SDK `Fetch` - // path is wired through `FromProof`, - // which only knows how to decode the `Proof(...)` - // response variant — the no-proof `Counts(...)` / - // `Entries(...)` variants need a different decoder - // entry point that doesn't exist yet on the SDK - // side. Setting this to anything other than - // `true` would either silently fail at decode - // time or strip the verification guarantee the - // rest of the SDK assumes. - // - // `SdkBuilder::with_proofs(false)` is consequently - // a **no-op** for `DocumentCountQuery` — the - // blanket `Query for T` impl in - // `packages/rs-sdk/src/platform/query.rs:119-124` - // emits a `tracing::warn!` at `Fetch::fetch` - // time when proofs are disabled, but the request - // still ships with `prove: true` and the - // response is decoded through - // `FromProof`. The server's - // unified `GetDocumentsCount` endpoint supports - // no-proof modes (`Total` / `PerInValue` / - // `RangeNoProof`) but the SDK has no typed - // decoder for them yet — shadowing the blanket - // impl to intercept the flag is blocked by - // Rust's coherence rules (`Query for T` - // covers all `T: TransportRequest`, and - // `DocumentCountQuery` IS its own - // `TransportRequest`). Wiring a no-proof - // decoder is tracked as - // dashpay/platform#3630. - prove: true, - }, - )), - }) - } -} - -impl TransportRequest for DocumentCountQuery { - type Client = ::Client; - type Response = ::Response; - const SETTINGS_OVERRIDES: rs_dapi_client::RequestSettings = - ::SETTINGS_OVERRIDES; - - fn request_name(&self) -> &'static str { - "GetDocumentsCountRequest" - } - - fn method_name(&self) -> &'static str { - "get_documents_count" - } - - fn execute_transport<'c>( - self, - client: &'c mut Self::Client, - settings: &AppliedRequestSettings, - ) -> BoxFuture<'c, Result> { - // CBOR-serializing the where clauses can fail on values that - // aren't representable (the conversion goes through ciborium). - // Surface that as a recoverable transport error rather than - // panicking — callers expect `Fetch` failures to be matchable - // on `Error::DapiClientError`, not aborts. - let request: GetDocumentsCountRequest = match self.try_into() { - Ok(r) => r, - Err(e) => { - let status = dapi_grpc::tonic::Status::internal(format!( - "DocumentCountQuery -> GetDocumentsCountRequest conversion failed: {}", - e - )); - return Box::pin(async move { Err(TransportError::Grpc(status)) }); - } - }; - request.execute_transport(client, settings) - } -} - -impl FromProof for DocumentCount { - type Request = DocumentCountQuery; - type Response = GetDocumentsCountResponse; - - 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), drive_proof_verifier::Error> - where - Self: 'a, - { - let request: Self::Request = request.into(); - - // Range queries arrive with a grovedb `AggregateCountOnRange` - // proof (produced by `Drive::execute_document_count_range_proof`) - // that the materialize-and-count path below can't decode. Pivot - // to the merk-level aggregate verifier instead, building the - // exact same `PathQuery` the prover used via the shared - // `DriveDocumentCountQuery::aggregate_count_path_query` builder - // (kept in rs-drive under `cfg(any(server, verify))` so prover - // and verifier never drift). - if request - .document_query - .where_clauses - .iter() - .any(|wc| DriveDocumentCountQuery::is_range_operator(wc.operator)) - { - let response: Self::Response = response.into(); - - let document_type = request - .document_query - .data_contract - .document_type_for_name(&request.document_query.document_type_name) - .map_err(|e| drive_proof_verifier::Error::RequestError { - error: format!( - "document type {} not found in contract: {}", - request.document_query.document_type_name, e - ), - })?; - let index = DriveDocumentCountQuery::find_range_countable_index_for_where_clauses( - document_type.indexes(), - &request.document_query.where_clauses, - ) - .ok_or_else(|| drive_proof_verifier::Error::RequestError { - error: "range count requires a `range_countable: true` index whose last \ - property matches the range field" - .to_string(), - })?; - - let count_query = DriveDocumentCountQuery { - document_type, - contract_id: request.document_query.data_contract.id().to_buffer(), - document_type_name: request.document_query.document_type_name.clone(), - index, - where_clauses: request.document_query.where_clauses.clone(), - }; - let proof = response - .proof() - .or(Err(drive_proof_verifier::Error::NoProofInResult))?; - let mtd = response - .metadata() - .or(Err(drive_proof_verifier::Error::EmptyResponseMetadata))?; - - // Dispatch on `return_distinct_counts_in_range`. The - // server's `detect_mode` routes - // `(range, prove=true, distinct=true)` to - // `RangeDistinctProof` (emits per-key `KVCount` ops) and - // `(range, prove=true, distinct=false)` to `RangeProof` - // (emits a single `AggregateCountOnRange` aggregate); - // the two proof shapes are NOT interchangeable. - // Decoding a distinct proof with the aggregate verifier - // would fail merk-root recomputation because the path - // queries differ structurally. - if request.return_distinct_counts_in_range { - // Mirror the SDK's prove-distinct dispatcher (see the - // `FromProof for DocumentSplitCounts` - // impl below) to rebuild the same path query the - // prover signed. The limit anchors to the compile-time - // `DEFAULT_QUERY_LIMIT` constant (matching the - // server's `drive_dispatcher.rs` `RangeDistinctProof` - // arm) so proof bytes are deterministic across - // operators. Direction comes from the first - // `order_by` clause, defaulting to ascending. - let limit_u16 = match request.limit { - Some(l) => { - u16::try_from(l).map_err(|_| drive_proof_verifier::Error::RequestError { - error: format!( - "limit {} exceeds u16::MAX; the prove-distinct path query \ - cannot represent it", - l - ), - })? - } - None => drive::config::DEFAULT_QUERY_LIMIT, - }; - let left_to_right = request - .document_query - .order_by_clauses - .first() - .map(|c| c.ascending) - .unwrap_or(true); - - let entries = verify_distinct_count_proof( - &count_query, - proof, - mtd, - limit_u16, - left_to_right, - platform_version, - provider, - )?; - // `DocumentCount` collapses to a single aggregate - // u64. Sum the verified per-key counts. The proof's - // `KVCount` ops are merk-root-bound via - // `node_hash_with_count`, so the sum is - // cryptographically committed — same forge-resistance - // as `AggregateCountOnRange`, just expressed as a - // post-verification reduction in Rust. - let total: u64 = entries.iter().map(|e| e.count).sum(); - return Ok((Some(DocumentCount(total)), mtd.clone(), proof.clone())); - } - - // Range + prove + !distinct: aggregate proof path. The - // verifier helper rebuilds the prover's path query - // internally via `count_query.aggregate_count_path_query` - // — same builder both sides share, so the path query - // bytes match byte-for-byte and the merk root - // recomputation succeeds. - let count = - verify_aggregate_count_proof(&count_query, proof, mtd, platform_version, provider)?; - return Ok((Some(DocumentCount(count)), mtd.clone(), proof.clone())); - } - - // No range clause: route through the count-tree proof - // primitives. Two sub-cases mirror the server-side dispatch: - // - // 1. **documents_countable + empty where**: the doctype's - // primary-key tree is itself a CountTree. The server - // proves that element directly; the SDK verifies and - // extracts `count_value`. O(log n) proof, no index. - // 2. **Else**: must have a `countable: true` index whose - // properties exactly match the where clauses. Server - // proves the per-branch CountTree elements; SDK sums their - // `count_value`s. Rejection on missing covering index is - // symmetric with the no-proof side. - let response: Self::Response = response.into(); - let document_type = request - .document_query - .data_contract - .document_type_for_name(&request.document_query.document_type_name) - .map_err(|e| drive_proof_verifier::Error::RequestError { - error: format!( - "document type {} not found in contract: {}", - request.document_query.document_type_name, e - ), - })?; - let proof = response - .proof() - .or(Err(drive_proof_verifier::Error::NoProofInResult))?; - let mtd = response - .metadata() - .or(Err(drive_proof_verifier::Error::EmptyResponseMetadata))?; - - // documents_countable fast path - if request.document_query.where_clauses.is_empty() && document_type.documents_countable() { - let contract_id = request.document_query.data_contract.id().to_buffer(); - let count = verify_primary_key_count_tree_proof( - contract_id, - &request.document_query.document_type_name, - proof, - mtd, - platform_version, - provider, - )?; - return Ok((Some(DocumentCount(count)), mtd.clone(), proof.clone())); - } - - let index = DriveDocumentCountQuery::find_countable_index_for_where_clauses( - document_type.indexes(), - &request.document_query.where_clauses, - ) - .ok_or_else(|| drive_proof_verifier::Error::RequestError { - error: "prove count requires a `countable: true` index whose properties \ - exactly match the where clause fields, or `documentsCountable: \ - true` on the document type for unfiltered total counts" - .to_string(), - })?; - let count_query = DriveDocumentCountQuery { - document_type, - contract_id: request.document_query.data_contract.id().to_buffer(), - document_type_name: request.document_query.document_type_name.clone(), - index, - where_clauses: request.document_query.where_clauses.clone(), - }; - - let entries = - verify_point_lookup_count_proof(&count_query, proof, mtd, platform_version, provider)?; - // `DocumentCount` is a single aggregate u64 — sum the per- - // branch CountTree entries. For Equal-only fully-covered the - // verifier returns a single entry (empty `key`) and the sum - // is just that entry's count; for Equal-prefix + In-on-last - // it sums the per-In-value counts. A branch with zero docs is - // omitted by the verifier so missing entries contribute 0. - let total: u64 = entries.iter().map(|e| e.count).sum(); - Ok((Some(DocumentCount(total)), mtd.clone(), proof.clone())) - } -} - -impl Fetch for DocumentCount { - type Request = DocumentCountQuery; -} - -/// Per-key counts view of the unified count endpoint. -/// -/// Backed by the same [`DocumentCountQuery`] as [`DocumentCount`]; the only -/// difference is response shape — `DocumentSplitCounts` returns the full -/// `entries` map keyed by the splitting property's serialized value, while -/// `DocumentCount` returns the sum. -/// -/// Splitting is signalled by an `In` where-clause on the request: the field -/// of that clause becomes the split property and each value in the array -/// becomes one entry in the result. Without an `In` clause the response is -/// a single entry with empty key (i.e., the total count). -impl FromProof for DocumentSplitCounts { - type Request = DocumentCountQuery; - type Response = GetDocumentsCountResponse; - - 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), drive_proof_verifier::Error> - where - Self: 'a, - { - let request: Self::Request = request.into(); - - // `has_in` controls the single-empty-key-entry guarantee on - // the no-range prove path: Equal-only fully-covered queries - // promise one entry with empty key (the verified count, even - // if zero); In-on-last queries promise one entry per emitted - // In value (zero-count branches are simply absent). - let has_in = request - .document_query - .where_clauses - .iter() - .any(|wc| wc.operator == WhereOperator::In); - - let has_range = request - .document_query - .where_clauses - .iter() - .any(|wc| DriveDocumentCountQuery::is_range_operator(wc.operator)); - - // Range + distinct (with or without In on prefix): per- - // distinct-value counts via a regular merk range proof - // (no `AggregateCountOnRange` wrapper). The proof's - // `KVCount` ops carry per-`(in_key, key)` counts that the - // merk root commits to via `node_hash_with_count`, so - // `verify_distinct_count_proof` runs the standard hash - // chain check and reads the counts back as a verified - // `Vec`. For compound queries the In - // value is preserved in each entry's `in_key` — callers can - // reduce by `key` via `DocumentSplitCounts::into_flat_map` - // if they want the merged-histogram shape. Only reachable - // when the SDK builder set - // `with_distinct_counts_in_range(true)`. - if has_range && request.return_distinct_counts_in_range { - let response: Self::Response = response.into(); - - let document_type = request - .document_query - .data_contract - .document_type_for_name(&request.document_query.document_type_name) - .map_err(|e| drive_proof_verifier::Error::RequestError { - error: format!( - "document type {} not found in contract: {}", - request.document_query.document_type_name, e - ), - })?; - let index = DriveDocumentCountQuery::find_range_countable_index_for_where_clauses( - document_type.indexes(), - &request.document_query.where_clauses, - ) - .ok_or_else(|| drive_proof_verifier::Error::RequestError { - error: "distinct range count requires a `range_countable: true` index whose \ - last property matches the range field" - .to_string(), - })?; - - let count_query = DriveDocumentCountQuery { - document_type, - contract_id: request.document_query.data_contract.id().to_buffer(), - document_type_name: request.document_query.document_type_name.clone(), - index, - where_clauses: request.document_query.where_clauses.clone(), - }; - // Match the prover's defaults for limit and order so - // the verifier helper can rebuild the same path query - // internally. The server's prove-distinct dispatcher - // anchors its fallback to `crate::config::DEFAULT_QUERY_LIMIT` - // (the same compile-time constant we read here) and - // rejects any value above its `max_query_limit` — - // explicitly NOT the operator-tunable - // `drive_config.default_query_limit`, since the SDK - // can't know an operator's tuned config. With both - // sides anchored to the shared constant, the path - // query bytes match regardless of operator configuration. - // See `drive_dispatcher.rs`'s `RangeDistinctProof` arm - // for the symmetric reasoning on the server side. - // - // Direction comes from the first `order_by` clause; empty - // `order_by` defaults to ascending — the server's - // prove-distinct dispatcher derives `left_to_right` from - // the same source (see drive_dispatcher.rs), so both - // sides must land on the same value or the merk-root - // recomputation fails. - // Use `try_from` so a caller passing - // `limit > u16::MAX` fails loudly at the SDK boundary - // rather than silently truncating to a wrong value the - // verifier would then build a mismatched path query - // against. The server-side guard in - // `drive_dispatcher.rs`'s `RangeDistinctProof` arm - // already rejects `effective_limit > max_query_limit` - // (and `max_query_limit` is itself a `u16`), so today - // the truncation path is only hypothetical — but - // defense-in-depth keeps the failure mode explicit if - // a future code path widens the wire limit type or - // lifts the server cap. - let limit_u16 = match request.limit { - Some(l) => { - u16::try_from(l).map_err(|_| drive_proof_verifier::Error::RequestError { - error: format!( - "limit {} exceeds u16::MAX; the prove-distinct path query cannot \ - represent it", - l - ), - })? - } - None => drive::config::DEFAULT_QUERY_LIMIT, - }; - let left_to_right = request - .document_query - .order_by_clauses - .first() - .map(|c| c.ascending) - .unwrap_or(true); - - let proof = response - .proof() - .or(Err(drive_proof_verifier::Error::NoProofInResult))?; - let mtd = response - .metadata() - .or(Err(drive_proof_verifier::Error::EmptyResponseMetadata))?; - - let entries = verify_distinct_count_proof( - &count_query, - proof, - mtd, - limit_u16, - left_to_right, - platform_version, - provider, - )?; - return Ok(( - Some(DocumentSplitCounts::from_verified(entries)), - mtd.clone(), - proof.clone(), - )); - } - - // No range clause + `prove = true`: route through the count- - // tree proof primitives, mirroring `DocumentCount`'s dispatch. - // Two sub-cases: - // - // 1. **documents_countable + empty where**: prove the - // doctype's primary-key CountTree directly. Result is a - // single empty-key entry with the verified count. - // 2. **Else**: require a covering countable index. Server - // proves the per-branch CountTree elements; SDK returns - // them as Vec. For Equal-only fully- - // covered the verifier returns one empty-key entry - // (re-emitted as zero-count if absent); for Equal-prefix - // + In-on-last it returns one entry per In value (zero- - // count In branches are simply absent). - let response: Self::Response = response.into(); - let document_type = request - .document_query - .data_contract - .document_type_for_name(&request.document_query.document_type_name) - .map_err(|e| drive_proof_verifier::Error::RequestError { - error: format!( - "document type {} not found in contract: {}", - request.document_query.document_type_name, e - ), - })?; - let proof = response - .proof() - .or(Err(drive_proof_verifier::Error::NoProofInResult))?; - let mtd = response - .metadata() - .or(Err(drive_proof_verifier::Error::EmptyResponseMetadata))?; - - // documents_countable fast path → single empty-key entry. - if request.document_query.where_clauses.is_empty() && document_type.documents_countable() { - let contract_id = request.document_query.data_contract.id().to_buffer(); - let count = verify_primary_key_count_tree_proof( - contract_id, - &request.document_query.document_type_name, - proof, - mtd, - platform_version, - provider, - )?; - let entries = vec![drive_proof_verifier::SplitCountEntry { - in_key: None, - key: Vec::new(), - count, - }]; - return Ok(( - Some(DocumentSplitCounts::from_verified(entries)), - mtd.clone(), - proof.clone(), - )); - } - - let index = DriveDocumentCountQuery::find_countable_index_for_where_clauses( - document_type.indexes(), - &request.document_query.where_clauses, - ) - .ok_or_else(|| drive_proof_verifier::Error::RequestError { - error: "prove count requires a `countable: true` index whose properties \ - exactly match the where clause fields, or `documentsCountable: \ - true` on the document type for unfiltered total counts" - .to_string(), - })?; - let count_query = DriveDocumentCountQuery { - document_type, - contract_id: request.document_query.data_contract.id().to_buffer(), - document_type_name: request.document_query.document_type_name.clone(), - index, - where_clauses: request.document_query.where_clauses.clone(), - }; - - let mut entries = - verify_point_lookup_count_proof(&count_query, proof, mtd, platform_version, provider)?; - // Total-count case (Equal-only fully-covered) MUST surface as - // a single empty-key entry — callers distinguish "verified - // zero" from "no proof returned" purely by structure. If the - // verifier dropped the entry because count was 0, re-emit it. - if !has_in && entries.is_empty() { - entries.push(drive_proof_verifier::SplitCountEntry { - in_key: None, - key: Vec::new(), - count: 0, - }); - } - Ok(( - Some(DocumentSplitCounts::from_verified(entries)), - mtd.clone(), - proof.clone(), - )) - } -} - -impl Fetch for DocumentSplitCounts { - type Request = DocumentCountQuery; -} - -fn serialize_where_clauses_to_cbor(clauses: &[WhereClause]) -> Result, Error> { - if clauses.is_empty() { - return Ok(Vec::new()); - } - - let value_array = Value::Array(clauses.iter().cloned().map(Value::from).collect()); - - let cbor_value: CborValue = TryInto::::try_into(value_array) - .map_err(|e| Error::Protocol(ProtocolError::EncodingError(e.to_string())))?; - - let mut serialized = Vec::new(); - ciborium::ser::into_writer(&cbor_value, &mut serialized) - .map_err(|e| Error::Protocol(ProtocolError::EncodingError(e.to_string())))?; - - Ok(serialized) -} - -/// CBOR-encode an order_by clause list for the -/// `GetDocumentsCountRequestV0.order_by` field. Mirrors -/// [`serialize_where_clauses_to_cbor`]; empty → empty bytes (the -/// server treats that as `Value::Null` = no clauses). -fn serialize_order_by_clauses_to_cbor(clauses: &[OrderClause]) -> Result, Error> { - if clauses.is_empty() { - return Ok(Vec::new()); - } - - let value_array = Value::Array(clauses.iter().cloned().map(Value::from).collect()); - - let cbor_value: CborValue = TryInto::::try_into(value_array) - .map_err(|e| Error::Protocol(ProtocolError::EncodingError(e.to_string())))?; - - let mut serialized = Vec::new(); - ciborium::ser::into_writer(&cbor_value, &mut serialized) - .map_err(|e| Error::Protocol(ProtocolError::EncodingError(e.to_string())))?; - - Ok(serialized) -} diff --git a/packages/rs-sdk/src/platform/documents/document_query.rs b/packages/rs-sdk/src/platform/documents/document_query.rs index 849b6d2039d..39f2b5d24b7 100644 --- a/packages/rs-sdk/src/platform/documents/document_query.rs +++ b/packages/rs-sdk/src/platform/documents/document_query.rs @@ -4,10 +4,14 @@ use std::sync::Arc; use crate::{error::Error, sdk::Sdk}; use ciborium::Value as CborValue; -use dapi_grpc::platform::v0::get_documents_request::Version::V0; +use dapi_grpc::platform::v0::get_documents_request::Version::V1; use dapi_grpc::platform::v0::{ self as platform_proto, - get_documents_request::{get_documents_request_v0::Start, GetDocumentsRequestV0}, + get_documents_request::{ + get_documents_request_v0::Start, + get_documents_request_v1::{Select, Start as V1Start}, + GetDocumentsRequestV1, + }, GetDocumentsRequest, Proof, ResponseMetadata, }; use dash_context_provider::ContextProvider; @@ -41,15 +45,48 @@ use crate::platform::Fetch; #[derive(Debug, Clone, PartialEq, dash_platform_macros::Mockable)] #[cfg_attr(feature = "mocks", derive(serde::Serialize, serde::Deserialize))] pub struct DocumentQuery { + /// SQL-shaped `SELECT` projection. `Documents` returns matched + /// rows; `Count` returns either a single aggregate (empty + /// `group_by`) or per-group entries (non-empty `group_by`). + /// Defaults to `Documents` so callers that don't opt into the + /// count surface get plain document fetch semantics. + /// + /// `#[serde(default)]` here (and on `group_by` / `having` + /// below) is wire-format-compat for mock vectors captured + /// before the SQL-shaped surface was added: `Select::default() + /// == Select::Documents` (the proto-generated enum's 0-value + /// variant), `Vec` and `Vec` default to empty — together + /// those mean an old fixture without these fields + /// deserializes to the documents-fetch shape it was originally + /// captured under. New fixtures should serialize the fields + /// explicitly. + #[cfg_attr(feature = "mocks", serde(default))] + pub select: Select, /// Data contract pub data_contract: Arc, /// Document type for the data contract pub document_type_name: String, /// `where` clauses for the query pub where_clauses: Vec, + /// SQL `GROUP BY` field names, in left-to-right order. Empty = + /// no explicit grouping (aggregate count for `select=Count`). + /// Only meaningful when `select=Count`; non-empty with + /// `select=Documents` is rejected by the server as unsupported. + #[cfg_attr(feature = "mocks", serde(default))] + pub group_by: Vec, + /// SQL `HAVING` clauses, CBOR-encoded the same way as + /// `where_clauses`. Non-empty values are rejected by the + /// server with + /// `QuerySyntaxError::Unsupported("HAVING clause is not yet + /// implemented")`. The wire field is reserved so the SDK + /// can encode `HAVING` once the server gains support, without + /// another version bump. + #[cfg_attr(feature = "mocks", serde(default))] + pub having: Vec, /// `order_by` clauses for the query pub order_by_clauses: Vec, - /// queryset limit + /// queryset limit. `0` is the sentinel for "unset / default" and + /// is translated to `None` on the V1 wire (`optional uint32`). pub limit: u32, /// first object to start with pub start: Option, @@ -68,9 +105,12 @@ impl DocumentQuery { .map_err(ProtocolError::DataContractError)?; Ok(Self { + select: Select::Documents, data_contract: Arc::clone(&contract), document_type_name: document_type_name.to_string(), where_clauses: vec![], + group_by: Vec::new(), + having: Vec::new(), order_by_clauses: vec![], limit: 0, start: None, @@ -129,6 +169,76 @@ impl DocumentQuery { self } + + /// Set the SQL-shaped `SELECT` projection. + /// + /// - [`Select::Documents`] (the default) returns matched + /// rows via `Document::fetch_many` and friends. + /// - [`Select::Count`] switches to the count surface: + /// pair it with [`DocumentCount::fetch`] for a single + /// aggregate (empty `group_by`) or + /// [`DocumentSplitCounts::fetch`] for per-group entries + /// (non-empty `group_by`). + pub fn with_select(mut self, select: Select) -> Self { + self.select = select; + self + } + + /// Set the `GROUP BY` field to a single field name. + /// + /// Convenience wrapper around [`Self::with_group_by_fields`]. + /// Replaces any previously set `group_by`. Pair with + /// [`Self::with_select`]`(Select::Count)` for the per-group + /// entries shape. + pub fn with_group_by>(mut self, field: S) -> Self { + self.group_by = vec![field.into()]; + self + } + + /// Set the full `GROUP BY` field list (replaces any previously + /// set `group_by`). + /// + /// Multi-field `group_by` is only accepted by the server for + /// `(in_field, range_field)` matching a compound `In + range` + /// where clause against a `rangeCountable: true` index. Other + /// non-empty shapes return `QuerySyntaxError::Unsupported`. + pub fn with_group_by_fields(mut self, fields: I) -> Self + where + I: IntoIterator, + S: Into, + { + self.group_by = fields.into_iter().map(Into::into).collect(); + self + } + + /// Set the `HAVING` clause CBOR bytes (replaces any prior + /// value). + /// + /// Non-empty values are rejected by the server with + /// `QuerySyntaxError::Unsupported("HAVING clause is not yet + /// implemented")`. The builder exists so SDK callers can + /// encode `HAVING` ahead of server support landing without + /// another version bump. + pub fn with_having(mut self, having: Vec) -> Self { + self.having = having; + self + } + + /// Set the query limit. `0` means "unset" — translated to + /// `None` on the V1 wire (the proto field is `optional uint32`). + /// + /// On `select=Count` with non-empty `group_by` against the + /// prove path, the server validates rather than clamps: + /// `limit > max_query_limit` is rejected with + /// `InvalidLimit` rather than silently truncated, since + /// clamping would invisibly break proof verification. + /// Leaving the limit unset (`0`) falls back to + /// `drive::config::DEFAULT_QUERY_LIMIT` on the proof verifier + /// side, keeping proof bytes deterministic across operators. + pub fn with_limit(mut self, limit: u32) -> Self { + self.limit = limit; + self + } } impl TransportRequest for DocumentQuery { @@ -231,23 +341,48 @@ impl FromProof for drive_proof_verifier::types::Documents { impl TryFrom for platform_proto::GetDocumentsRequest { type Error = Error; fn try_from(dapi_request: DocumentQuery) -> Result { - // TODO implement where and order_by clause - let where_clauses = serialize_vec_to_cbor(dapi_request.where_clauses.clone()) .expect("where clauses serialization should never fail"); let order_by = serialize_vec_to_cbor(dapi_request.order_by_clauses.clone())?; - // Order clause + // `limit: u32` with `0` sentinel → `optional uint32` on the + // V1 wire. `None` lets the server apply its own default; + // explicit `0` would be a strange "return zero rows" request. + let limit = if dapi_request.limit == 0 { + None + } else { + Some(dapi_request.limit) + }; + // V0 and V1 ship separate `Start` enums even though the + // shape is identical. Translate at the wire boundary so the + // `DocumentQuery.start` field stays stable for callers + // already using the V0 type. + let start_v1 = dapi_request.start.clone().map(|s| match s { + Start::StartAfter(b) => V1Start::StartAfter(b), + Start::StartAt(b) => V1Start::StartAt(b), + }); //todo: transform this into PlatformVersionedTryFrom Ok(GetDocumentsRequest { - version: Some(V0(GetDocumentsRequestV0 { + version: Some(V1(GetDocumentsRequestV1 { data_contract_id: dapi_request.data_contract.id().to_vec(), document_type: dapi_request.document_type_name.clone(), r#where: where_clauses, order_by, - limit: dapi_request.limit, + limit, + // Document fetch always proves via this conversion. + // Count fetch uses the same wire shape; both paths + // go through the `FromProof` decoders which expect + // the `Proof(...)` response variant. `SdkBuilder:: + // with_proofs(false)` is consequently a no-op for + // both — see the blanket `Query for T` impl in + // `packages/rs-sdk/src/platform/query.rs` for the + // `tracing::warn!` emitted at fetch time when proofs + // are disabled. prove: true, - start: dapi_request.start.clone(), + start: start_v1, + select: dapi_request.select as i32, + group_by: dapi_request.group_by.clone(), + having: dapi_request.having.clone(), })), }) } @@ -271,9 +406,15 @@ impl<'a> From<&'a DriveDocumentQuery<'a>> for DocumentQuery { }; Self { + // `DriveDocumentQuery` has no SELECT/GROUP BY/HAVING + // concept — it's a documents-only query. Default to the + // v1 documents shape. + select: Select::Documents, data_contract: Arc::new(data_contract), document_type_name: document_type_name.to_string(), where_clauses, + group_by: Vec::new(), + having: Vec::new(), order_by_clauses, limit, start, @@ -299,9 +440,15 @@ impl<'a> From> for DocumentQuery { }; Self { + // `DriveDocumentQuery` has no SELECT/GROUP BY/HAVING + // concept — it's a documents-only query. Default to the + // v1 documents shape. + select: Select::Documents, data_contract: Arc::new(data_contract), document_type_name: document_type_name.to_string(), where_clauses, + group_by: Vec::new(), + having: Vec::new(), order_by_clauses, limit, start, diff --git a/packages/rs-sdk/src/platform/documents/document_split_counts.rs b/packages/rs-sdk/src/platform/documents/document_split_counts.rs new file mode 100644 index 00000000000..d0221e0d33c --- /dev/null +++ b/packages/rs-sdk/src/platform/documents/document_split_counts.rs @@ -0,0 +1,68 @@ +//! `FromProof` + `Fetch` for [`DocumentSplitCounts`] — the +//! per-group-entry view of the unified `getDocuments` endpoint. +//! +//! Backed by the same [`DocumentQuery`] as +//! [`drive_proof_verifier::DocumentCount`]; the only difference +//! is response shape — `DocumentSplitCounts` returns the full +//! `entries` list keyed by the splitting property's serialized +//! value, while `DocumentCount` returns the sum. +//! +//! Per-shape proof dispatch lives in +//! [`super::count_proof_helpers::verify_count_query`] — this +//! impl passes the verified entries through unchanged. +//! +//! Shapes emitted by `verify_count_query`: +//! - `group_by = []` (aggregate): one entry with empty `key` +//! carrying the verified total. `AggregateCountOnRange`, +//! primary-key CountTree, and point-lookup-on-Equal-only paths +//! all collapse to this shape. +//! - `group_by = [in_field]` (per-In entries): one entry per +//! **present** queried In value, with `count: Some(n)`. Absent +//! In branches are omitted from `entries` — the current +//! point-lookup path query doesn't request absence proofs, +//! so grovedb's `verify_query` surfaces only present +//! `(path, key, Some(Element))` triples. Callers that need to +//! distinguish "verified zero" from "queried but absent" diff +//! their request's In array against the returned entries by +//! `key` (each entry's `key` is `serialize_value_for_key(in_field, v)`). +//! - `group_by = [range_field]` / `[in_field, range_field]` +//! (distinct walk): one entry per distinct value in the range +//! (compound queries: per `(in_key, key)` pair). Zero-count +//! ranges are simply absent — the range itself is unbounded so +//! there's no enumerable key set to ever-emit. + +use crate::platform::documents::count_proof_helpers::{assert_select_is_count, verify_count_query}; +use crate::platform::documents::document_query::DocumentQuery; +use crate::platform::Fetch; +use dapi_grpc::platform::v0::{GetDocumentsResponse, Proof, ResponseMetadata}; +use dash_context_provider::ContextProvider; +use dpp::dashcore::Network; +use dpp::version::PlatformVersion; +use drive_proof_verifier::{DocumentSplitCounts, FromProof}; + +impl FromProof for DocumentSplitCounts { + type Request = DocumentQuery; + type Response = GetDocumentsResponse; + + 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), drive_proof_verifier::Error> + where + Self: 'a, + { + let request: Self::Request = request.into(); + assert_select_is_count(&request)?; + let response: Self::Response = response.into(); + let (entries, mtd, proof) = + verify_count_query(request, response, platform_version, provider)?; + Ok((entries.map(DocumentSplitCounts::from_verified), mtd, proof)) + } +} + +impl Fetch for DocumentSplitCounts { + type Request = DocumentQuery; +} diff --git a/packages/rs-sdk/src/platform/documents/mod.rs b/packages/rs-sdk/src/platform/documents/mod.rs index e4994e1d0fb..1237b1fcbd1 100644 --- a/packages/rs-sdk/src/platform/documents/mod.rs +++ b/packages/rs-sdk/src/platform/documents/mod.rs @@ -1,3 +1,5 @@ -pub mod document_count_query; +pub(super) mod count_proof_helpers; +pub mod document_count; pub mod document_query; +pub mod document_split_counts; pub mod transitions; diff --git a/packages/rs-sdk/src/platform/dpns_usernames/mod.rs b/packages/rs-sdk/src/platform/dpns_usernames/mod.rs index 58c1b4a9792..4df2ff27f77 100644 --- a/packages/rs-sdk/src/platform/dpns_usernames/mod.rs +++ b/packages/rs-sdk/src/platform/dpns_usernames/mod.rs @@ -381,6 +381,7 @@ impl Sdk { // Query for existing domain with this label let query = DocumentQuery { + select: dapi_grpc::platform::v0::get_documents_request::get_documents_request_v1::Select::Documents, data_contract: dpns_contract, document_type_name: "domain".to_string(), where_clauses: vec![ @@ -395,6 +396,8 @@ impl Sdk { value: Value::Text(normalized_label), }, ], + group_by: vec![], + having: vec![], order_by_clauses: vec![], limit: 1, start: None, @@ -447,6 +450,7 @@ impl Sdk { // Query for domain with this label let query = DocumentQuery { + select: dapi_grpc::platform::v0::get_documents_request::get_documents_request_v1::Select::Documents, data_contract: dpns_contract, document_type_name: "domain".to_string(), where_clauses: vec![ @@ -461,6 +465,8 @@ impl Sdk { value: Value::Text(normalized_label), }, ], + group_by: vec![], + having: vec![], order_by_clauses: vec![], limit: 1, start: None, diff --git a/packages/rs-sdk/src/platform/dpns_usernames/queries.rs b/packages/rs-sdk/src/platform/dpns_usernames/queries.rs index ebee7a41fc3..e0675f62fd7 100644 --- a/packages/rs-sdk/src/platform/dpns_usernames/queries.rs +++ b/packages/rs-sdk/src/platform/dpns_usernames/queries.rs @@ -47,6 +47,7 @@ impl Sdk { // Query for domains with this identity in records.identity (the only indexed identity field) let records_identity_query = DocumentQuery { + select: dapi_grpc::platform::v0::get_documents_request::get_documents_request_v1::Select::Documents, data_contract: dpns_contract, document_type_name: "domain".to_string(), where_clauses: vec![WhereClause { @@ -54,6 +55,8 @@ impl Sdk { operator: WhereOperator::Equal, value: Value::Identifier(identity_id.to_buffer()), }], + group_by: vec![], + having: vec![], order_by_clauses: vec![], // Remove ordering by $createdAt as it might not be indexed limit, start: None, @@ -123,6 +126,7 @@ impl Sdk { let normalized_prefix = convert_to_homograph_safe_chars(prefix); let query = DocumentQuery { + select: dapi_grpc::platform::v0::get_documents_request::get_documents_request_v1::Select::Documents, data_contract: dpns_contract, document_type_name: "domain".to_string(), where_clauses: vec![ @@ -137,6 +141,8 @@ impl Sdk { value: Value::Text(normalized_prefix), }, ], + group_by: vec![], + having: vec![], order_by_clauses: vec![OrderClause { field: "normalizedLabel".to_string(), ascending: true, diff --git a/packages/rs-sdk/src/platform/query.rs b/packages/rs-sdk/src/platform/query.rs index c30e1ee9038..043cb5941b8 100644 --- a/packages/rs-sdk/src/platform/query.rs +++ b/packages/rs-sdk/src/platform/query.rs @@ -325,7 +325,15 @@ impl Query for () { impl Query for DriveDocumentQuery<'_> { fn query(self, prove: bool) -> Result { if !prove { - unimplemented!("queries without proofs are not supported yet"); + // dash-sdk only serves proof-verified responses. Raw, + // unverified gRPC responses are out of scope for the + // SDK fetch path — callers needing unverified data + // should talk to DAPI directly via rs-dapi-client. + return Err(Error::Config( + "dash-sdk does not support non-proven queries; proof verification is \ + mandatory on the SDK fetch path" + .to_string(), + )); } let q: DocumentQuery = (&self).into(); Ok(q) diff --git a/packages/rs-sdk/tests/fetch/document_count.rs b/packages/rs-sdk/tests/fetch/document_count.rs index b6c382cc274..41a98908c31 100644 --- a/packages/rs-sdk/tests/fetch/document_count.rs +++ b/packages/rs-sdk/tests/fetch/document_count.rs @@ -1,28 +1,40 @@ //! Mock-based integration tests for the SDK count-fetch paths. //! -//! Live-devnet end-to-end coverage requires test vectors generated against a -//! running platform; for now we exercise the SDK ↔ mock-DAPI path which proves -//! that: -//! - `DocumentCountQuery` builds + serializes through the mock transport -//! for every supported request shape (Total, `In`, distinct-range) -//! - `Fetch for DocumentCount` and `Fetch for DocumentSplitCounts` -//! correctly thread the query, response, and mock expectations -//! - `MockResponse for DocumentCount` round-trips a `u64` count -//! - `MockResponse for DocumentSplitCounts` round-trips per-`(in_key, key)` -//! entries (the split-count proof shape produced on `PointLookupProof` / -//! `RangeDistinctProof` server-side paths) +//! `DocumentCount::fetch(sdk, query)` and +//! `DocumentSplitCounts::fetch(sdk, query)` both consume a +//! [`DocumentQuery`] (the same type used by +//! `Document::fetch_many`), with the count-specific shape +//! signalled via `.with_select(Select::Count)` + optional +//! `.with_group_by(…)`. This file exercises the SDK ↔ mock-DAPI +//! seam: //! -//! The mock transport short-circuits the wire-level verifier path, so these -//! tests don't exercise proof bytes; they pin the SDK seam — query builder → -//! `TryInto` → mock match → `MockResponse` decode → -//! `Fetch` return type — which is exactly the surface that earlier SDK-only -//! regressions on this PR slipped through unnoticed. +//! - `DocumentQuery` builds + serializes through the mock +//! transport for every supported request shape (total, `In`- +//! grouped, distinct-range). +//! - `Fetch for DocumentCount` and `Fetch for DocumentSplitCounts` +//! correctly thread the query, response, and mock expectations. +//! - `MockResponse for DocumentCount` round-trips a `u64`. +//! - `MockResponse for DocumentSplitCounts` round-trips +//! per-`(in_key, key)` entries. +//! +//! The mock transport short-circuits the wire-level verifier +//! path, so these tests pin the SDK seam — query builder → +//! `TryInto` → mock match → `MockResponse` +//! decode → `Fetch` return type. Anything that ships only +//! through the live-network path is out of scope here. +//! +//! Because `DocumentQuery` is the `Request` type for three +//! different `Fetch` impls (`Document`, `DocumentCount`, +//! `DocumentSplitCounts`), each `expect_fetch` call carries an +//! explicit turbofish so the mock recorder knows which response +//! type to register. use std::sync::Arc; use super::common::{mock_data_contract, mock_document_type}; +use dapi_grpc::platform::v0::get_documents_request::get_documents_request_v1::Select; use dash_sdk::{ - platform::{documents::document_count_query::DocumentCountQuery, Fetch}, + platform::{documents::document_query::DocumentQuery, Fetch}, Sdk, }; use dpp::data_contract::document_type::accessors::DocumentTypeV0Getters; @@ -37,13 +49,14 @@ async fn test_mock_fetch_document_count_returns_expected() { let document_type = mock_document_type(); let data_contract = mock_data_contract(Some(&document_type)); - let query = DocumentCountQuery::new(Arc::new(data_contract), document_type.name()) - .expect("build DocumentCountQuery"); + let query = DocumentQuery::new(Arc::new(data_contract), document_type.name()) + .expect("build DocumentQuery") + .with_select(Select::Count); let expected = DocumentCount(7); sdk.mock() - .expect_fetch(query.clone(), Some(expected.clone())) + .expect_fetch::(query.clone(), Some(expected.clone())) .await .expect("expectation should be added"); @@ -62,13 +75,14 @@ async fn test_mock_fetch_document_count_zero() { let document_type = mock_document_type(); let data_contract = mock_data_contract(Some(&document_type)); - let query = DocumentCountQuery::new(Arc::new(data_contract), document_type.name()) - .expect("build DocumentCountQuery"); + let query = DocumentQuery::new(Arc::new(data_contract), document_type.name()) + .expect("build DocumentQuery") + .with_select(Select::Count); let expected = DocumentCount(0); sdk.mock() - .expect_fetch(query.clone(), Some(expected.clone())) + .expect_fetch::(query.clone(), Some(expected.clone())) .await .expect("expectation should be added"); @@ -86,11 +100,12 @@ async fn test_mock_fetch_document_count_not_found() { let document_type = mock_document_type(); let data_contract = mock_data_contract(Some(&document_type)); - let query = DocumentCountQuery::new(Arc::new(data_contract), document_type.name()) - .expect("build DocumentCountQuery"); + let query = DocumentQuery::new(Arc::new(data_contract), document_type.name()) + .expect("build DocumentQuery") + .with_select(Select::Count); sdk.mock() - .expect_fetch(query.clone(), None as Option) + .expect_fetch::(query.clone(), None as Option) .await .expect("expectation should be added"); @@ -101,29 +116,22 @@ async fn test_mock_fetch_document_count_not_found() { assert!(retrieved.is_none()); } -/// `DocumentSplitCounts::fetch` with an `In` where-clause exercises the SDK -/// seam that routes `(In, prove=true, no-range)` requests to the -/// `PointLookupProof` server path and decodes the response as per-`In`-value -/// entries. -/// -/// Pins: -/// - `DocumentCountQuery::with_where(in_clause)` builds and serializes -/// through `TryInto` without rejecting the -/// In operator. -/// - `Fetch for DocumentSplitCounts` correctly returns the mocked -/// per-`(in_key, key)` entries. -/// - `MockResponse for DocumentSplitCounts` round-trips `Vec` -/// with `in_key: None`, `key: `, and `count` for the -/// point-lookup shape (this is the on-the-wire shape produced by -/// `verify_point_lookup_count_proof`). +/// `DocumentSplitCounts::fetch` with an `In` where-clause + +/// explicit `with_group_by("a")` exercises the SDK seam that +/// routes `(In, prove=true, group_by=[in_field])` requests to +/// the server's `PointLookupProof` dispatch and decodes the +/// response as per-`In`-value entries. The same `(In, prove=true)` +/// request with empty `group_by` would route to the aggregate +/// path instead — the `group_by` field is what selects the +/// per-value shape. #[tokio::test] async fn test_mock_fetch_document_split_counts_with_in_clause() { let mut sdk = Sdk::new_mock(); let document_type = mock_document_type(); let data_contract = mock_data_contract(Some(&document_type)); - let query = DocumentCountQuery::new(Arc::new(data_contract), document_type.name()) - .expect("build DocumentCountQuery") + let query = DocumentQuery::new(Arc::new(data_contract), document_type.name()) + .expect("build DocumentQuery") .with_where(WhereClause { field: "a".to_string(), operator: WhereOperator::In, @@ -131,26 +139,25 @@ async fn test_mock_fetch_document_split_counts_with_in_clause() { Value::Text("alpha".to_string()), Value::Text("beta".to_string()), ]), - }); + }) + .with_select(Select::Count) + .with_group_by("a"); - // Mock the wire-shape entries the SDK would receive from a server-side - // `PointLookupProof` proof verification: one entry per In branch with - // a non-zero count, sorted lex-asc by the point-lookup builder. let expected = DocumentSplitCounts::from_verified(vec![ SplitCountEntry { in_key: None, key: b"alpha".to_vec(), - count: 7, + count: Some(7), }, SplitCountEntry { in_key: None, key: b"beta".to_vec(), - count: 3, + count: Some(3), }, ]); sdk.mock() - .expect_fetch(query.clone(), Some(expected.clone())) + .expect_fetch::(query.clone(), Some(expected.clone())) .await .expect("expectation should be added"); @@ -161,33 +168,22 @@ async fn test_mock_fetch_document_split_counts_with_in_clause() { assert_eq!(retrieved, expected); assert_eq!(retrieved.0.len(), 2); - let summed: u64 = retrieved.0.iter().map(|e| e.count).sum(); + let summed: u64 = retrieved.0.iter().map(|e| e.count.unwrap_or(0)).sum(); assert_eq!(summed, 10, "alpha(7) + beta(3) = 10 docs"); } -/// `DocumentSplitCounts::fetch` with `with_distinct_counts_in_range(true)` -/// on a range query exercises the SDK seam that routes -/// `(range, prove=true, distinct=true)` requests to the -/// `RangeDistinctProof` server path and decodes the response as -/// per-distinct-value entries. -/// -/// Pins: -/// - `DocumentCountQuery::with_distinct_counts_in_range(true)` + a range -/// operator builds and serializes — both knobs reach the wire request. -/// - `Fetch for DocumentSplitCounts` returns the mocked per-distinct-value -/// entries unchanged. -/// - `with_limit(Some(N))` and `with_order_by(desc)` thread through the -/// query without altering the response decode path; the limit / direction -/// are wire-level controls for the server-side walk, not client-side -/// filtering. +/// `DocumentSplitCounts::fetch` with a range clause + explicit +/// `with_group_by(range_field)` exercises the SDK seam that +/// routes `(range, prove=true, group_by=[range_field])` +/// requests to the server's `RangeDistinctProof` dispatch. #[tokio::test] async fn test_mock_fetch_document_split_counts_with_distinct_range() { let mut sdk = Sdk::new_mock(); let document_type = mock_document_type(); let data_contract = mock_data_contract(Some(&document_type)); - let query = DocumentCountQuery::new(Arc::new(data_contract), document_type.name()) - .expect("build DocumentCountQuery") + let query = DocumentQuery::new(Arc::new(data_contract), document_type.name()) + .expect("build DocumentQuery") .with_where(WhereClause { field: "a".to_string(), operator: WhereOperator::GreaterThan, @@ -197,27 +193,25 @@ async fn test_mock_fetch_document_split_counts_with_distinct_range() { field: "a".to_string(), ascending: false, }) - .with_distinct_counts_in_range(true) - .with_limit(Some(50)); + .with_select(Select::Count) + .with_group_by("a") + .with_limit(50); - // Mock the wire-shape entries from a server-side `RangeDistinctProof` - // proof verification: per-distinct-value-in-range entries, descending - // by terminator value because the request set `ascending: false`. let expected = DocumentSplitCounts::from_verified(vec![ SplitCountEntry { in_key: None, key: b"red".to_vec(), - count: 12, + count: Some(12), }, SplitCountEntry { in_key: None, key: b"green".to_vec(), - count: 8, + count: Some(8), }, ]); sdk.mock() - .expect_fetch(query.clone(), Some(expected.clone())) + .expect_fetch::(query.clone(), Some(expected.clone())) .await .expect("expectation should be added"); @@ -227,55 +221,39 @@ async fn test_mock_fetch_document_split_counts_with_distinct_range() { .expect("split counts should be present"); assert_eq!(retrieved, expected); - // Verify pagination knobs round-trip without disturbing the entry list. assert_eq!(retrieved.0.len(), 2); assert_eq!(retrieved.0[0].key, b"red"); assert_eq!(retrieved.0[1].key, b"green"); } -/// `DocumentCount::fetch` with `with_distinct_counts_in_range(true)` -/// on a range query exercises the SDK seam that routes through the -/// `RangeDistinctProof` verifier and sums the verified per-key -/// entries to produce a single aggregate count. -/// -/// Before this fix, `FromProof for DocumentCount` -/// routed every range query through `verify_aggregate_count_proof`, -/// ignoring `return_distinct_counts_in_range`. The server emits a -/// regular range proof (`KVCount` ops) when `distinct = true`, not -/// an `AggregateCountOnRange` proof, so the aggregate verifier -/// rebuilds a different `PathQuery` and verification fails outright. -/// -/// Pin: `DocumentCount::fetch` with `with_distinct_counts_in_range(true)` -/// returns the correct aggregate (sum of per-key counts) via the -/// mock transport. Any future regression to a single-verifier path -/// would either misroute distinct queries back to the aggregate -/// verifier (verification failure) or stop summing the per-key -/// counts (wrong result). +/// `DocumentCount::fetch` with a range clause + explicit +/// `with_group_by(range_field)` exercises the SDK seam that +/// routes through the `RangeDistinctProof` verifier and sums +/// the verified per-key entries to produce a single aggregate +/// count. The non-grouped range path returns an +/// `AggregateCountOnRange` proof shape that's NOT interchangeable +/// with the distinct path, so it matters that `group_by` drives +/// the dispatch even when the caller asks for a single `u64`. #[tokio::test] async fn test_mock_fetch_document_count_with_distinct_range_sums_entries() { let mut sdk = Sdk::new_mock(); let document_type = mock_document_type(); let data_contract = mock_data_contract(Some(&document_type)); - let query = DocumentCountQuery::new(Arc::new(data_contract), document_type.name()) - .expect("build DocumentCountQuery") + let query = DocumentQuery::new(Arc::new(data_contract), document_type.name()) + .expect("build DocumentQuery") .with_where(WhereClause { field: "a".to_string(), operator: WhereOperator::GreaterThan, value: Value::Text("blue".to_string()), }) - .with_distinct_counts_in_range(true); - - // The mock transport short-circuits proof verification — we - // assert on the `DocumentCount` aggregate the SDK returns - // when the FromProof impl correctly dispatches to the distinct - // verifier path. With a sum of 12+8 = 20, a regression that - // routes back through the aggregate verifier would either - // return a different value or fail to decode at all. + .with_select(Select::Count) + .with_group_by("a"); + let expected = DocumentCount(20); sdk.mock() - .expect_fetch(query.clone(), Some(expected.clone())) + .expect_fetch::(query.clone(), Some(expected.clone())) .await .expect("expectation should be added"); @@ -287,3 +265,74 @@ async fn test_mock_fetch_document_count_with_distinct_range_sums_entries() { assert_eq!(retrieved, expected); assert_eq!(retrieved.0, 20); } + +/// `DocumentSplitCounts` round-trips entries carrying both +/// `Some(_)` (verified) and `None` (caller asked but verifier was +/// silent) through the mock transport. +/// +/// The mock path doesn't exercise the SDK's synthesis logic (that +/// requires a real proof + verifier), but it pins the wire/mock +/// shape: a fixture built with mixed `Some` / `None` counts must +/// survive the mock serialize/deserialize hop unchanged. Any +/// regression that flattens `None` to `Some(0)` or drops `None` +/// entries silently would fail here. +#[tokio::test] +async fn test_mock_fetch_document_split_counts_preserves_none_for_absent_in_values() { + let mut sdk = Sdk::new_mock(); + + let document_type = mock_document_type(); + let data_contract = mock_data_contract(Some(&document_type)); + let query = DocumentQuery::new(Arc::new(data_contract), document_type.name()) + .expect("build DocumentQuery") + .with_where(WhereClause { + field: "a".to_string(), + operator: WhereOperator::In, + value: Value::Array(vec![ + Value::Text("alpha".to_string()), + Value::Text("beta".to_string()), + Value::Text("gamma".to_string()), + ]), + }) + .with_select(Select::Count) + .with_group_by("a"); + + // Mixed-shape fixture: `alpha` has a verified count, `beta` is + // verified-zero (Some(0) from a hypothetical no-proof path or + // a future absence-proof-equipped verifier), `gamma` is + // verified-silent (None — the SDK synthesizes this on the + // proof path when an In value's CountTree element doesn't + // exist in the merk index). + let expected = DocumentSplitCounts::from_verified(vec![ + SplitCountEntry { + in_key: None, + key: b"alpha".to_vec(), + count: Some(7), + }, + SplitCountEntry { + in_key: None, + key: b"beta".to_vec(), + count: Some(0), + }, + SplitCountEntry { + in_key: None, + key: b"gamma".to_vec(), + count: None, + }, + ]); + + sdk.mock() + .expect_fetch::(query.clone(), Some(expected.clone())) + .await + .expect("expectation should be added"); + + let retrieved = DocumentSplitCounts::fetch(&sdk, query) + .await + .expect("fetch should succeed") + .expect("split counts should be present"); + + assert_eq!(retrieved, expected); + assert_eq!(retrieved.0.len(), 3); + assert_eq!(retrieved.0[0].count, Some(7), "alpha verified count"); + assert_eq!(retrieved.0[1].count, Some(0), "beta verified zero"); + assert_eq!(retrieved.0[2].count, None, "gamma absent from proof"); +} diff --git a/packages/wasm-sdk/src/dpns.rs b/packages/wasm-sdk/src/dpns.rs index 4d0f73a781f..a594f94d450 100644 --- a/packages/wasm-sdk/src/dpns.rs +++ b/packages/wasm-sdk/src/dpns.rs @@ -269,6 +269,7 @@ impl WasmSdk { let dpns_contract = self.get_dpns_contract().await?; let query = DocumentQuery { + select: dash_sdk::dapi_grpc::platform::v0::get_documents_request::get_documents_request_v1::Select::Documents, data_contract: dpns_contract, document_type_name: DPNS_DOCUMENT_TYPE.to_string(), where_clauses: vec![WhereClause { @@ -276,6 +277,8 @@ impl WasmSdk { operator: WhereOperator::Equal, value: Value::Identifier(identity_id.to_buffer()), }], + group_by: vec![], + having: vec![], order_by_clauses: vec![], limit: resolve_dpns_usernames_limit(limit), start: None, diff --git a/packages/wasm-sdk/src/queries/document.rs b/packages/wasm-sdk/src/queries/document.rs index 0f1656e59c1..27432c94f40 100644 --- a/packages/wasm-sdk/src/queries/document.rs +++ b/packages/wasm-sdk/src/queries/document.rs @@ -2,11 +2,11 @@ use crate::queries::utils::deserialize_required_query; use crate::queries::ProofMetadataResponseWasm; use crate::sdk::WasmSdk; use crate::WasmSdkError; +use dash_sdk::dapi_grpc::platform::v0::get_documents_request::get_documents_request_v1::Select; use dash_sdk::dpp::data_contract::accessors::v0::DataContractV0Getters; use dash_sdk::dpp::document::Document; use dash_sdk::dpp::platform_value::Value; use dash_sdk::dpp::prelude::Identifier; -use dash_sdk::platform::documents::document_count_query::DocumentCountQuery; use dash_sdk::platform::documents::document_query::DocumentQuery; use dash_sdk::platform::Fetch; use dash_sdk::platform::FetchMany; @@ -97,18 +97,26 @@ export interface DocumentsQuery { startAt?: IdentifierLike /** - * Count-query knob: when `true` AND the query carries a range - * clause, the server returns per-distinct-value entries within - * the range instead of a single sum. Ignored by the regular - * document-fetch path. + * Count-query knob: SQL-shaped `GROUP BY` field list. Mirrors + * the v1 wire's `group_by: repeated string` directly. Ignored + * by the regular document-fetch path. + * + * - `[]` or omitted → aggregate count (a single row). + * - `[""]` where `` matches an `In` + * constraint → per-`In`-value entries (PerInValue). + * - `[""]` where `` matches a range + * constraint → per-distinct-value entries within the range + * (RangeDistinct). + * - `["", ""]` for compound `In + range` + * queries → compound distinct entries. * * Entry direction comes from the first `orderBy` clause's * direction (which also drives walk order on the materialize + * prove path); set `orderBy: [["", "asc"|"desc"]]` - * alongside `returnDistinctCountsInRange: true` to control sort. - * @default false + * alongside `groupBy: [""]` to control sort. + * @default [] */ - returnDistinctCountsInRange?: boolean; + groupBy?: string[]; } "#; @@ -133,12 +141,13 @@ struct DocumentsQueryInput { start_after: Option, #[serde(rename = "startAt", default)] start_at: Option, - /// Count-query knob: when `true` AND the query carries a range - /// clause, the server returns per-distinct-value entries within - /// the range instead of a single sum. Ignored by the regular - /// document-fetch path. Default `false`. - #[serde(default)] - return_distinct_counts_in_range: Option, + /// Count-query knob: SQL-shaped `GROUP BY` field list, + /// mirroring the v1 wire `group_by: repeated string` field + /// one-to-one. Ignored by the regular document-fetch path. + /// See the TypeScript declaration for the supported shapes. + /// Default empty (aggregate count). + #[serde(rename = "groupBy", default)] + group_by: Option>, // Order direction for count results flows through the existing // `orderBy` field — the first clause's direction controls // split-mode entry ordering and `(In + prove)` walk order. No @@ -149,9 +158,9 @@ async fn build_documents_query( sdk: &WasmSdk, input: DocumentsQueryInput, ) -> Result { - // `return_distinct_counts_in_range` on the shared input struct is - // a count-query-only knob; the regular document-fetch path - // destructured here just drops it. + // `group_by` on the shared input struct is a count-query-only + // knob; the regular document-fetch path destructured here just + // drops it. let DocumentsQueryInput { data_contract_id, document_type_name, @@ -160,7 +169,7 @@ async fn build_documents_query( limit, start_after, start_at, - return_distinct_counts_in_range: _, + group_by: _, } = input; let contract_id: Identifier = data_contract_id.into(); @@ -215,41 +224,41 @@ async fn parse_documents_query( build_documents_query(sdk, input).await } -/// Parse a JS query object into a [`DocumentCountQuery`] — the count- -/// query analogue of [`parse_documents_query`]. The inner -/// [`DocumentQuery`] is built from the same `DocumentsQueryInput` -/// (data-contract / document-type / where-clauses / orderBy), and the -/// count-specific knobs (`return_distinct_counts_in_range`, `limit`) -/// are forwarded to the outer `DocumentCountQuery`. The inner -/// `DocumentQuery.limit` is unused on the count path — count queries -/// route through `FromProof` straight to the -/// count-tree / aggregate / distinct verifiers, never through -/// `DriveDocumentQuery`'s document-materialization path — so the -/// outer-field forwarding is the only thing that controls split-mode -/// entry pagination. +/// Parse a JS query object into a [`DocumentQuery`] configured +/// for the count surface (`select = Count`, with `group_by` +/// taken directly from the input — no implicit translation). +/// +/// The JS `groupBy` field mirrors the wire's `group_by: repeated +/// string` one-to-one. Callers ask for exactly the per-group +/// shape they want; the server rejects unsupported +/// `(select, group_by, where)` combinations with +/// `QuerySyntaxError::Unsupported`. /// -/// `orderBy` clauses ARE consumed by `build_documents_query` and -/// stored on `document_query.order_by_clauses`, which the SDK request -/// builder serializes into the wire `order_by` field — the first -/// clause's direction controls split-mode entry ordering and is -/// load-bearing for `(In + prove)` walk determinism. +/// `orderBy` clauses are consumed by `build_documents_query` and +/// stored on `DocumentQuery.order_by_clauses`, which the SDK +/// request builder serializes into the wire `order_by` field — +/// the first clause's direction controls split-mode entry +/// ordering and is load-bearing for `(In + prove)` walk +/// determinism. async fn parse_documents_count_query( sdk: &WasmSdk, query: DocumentsQueryJs, -) -> Result { +) -> Result { let input: DocumentsQueryInput = deserialize_required_query(query, "Query object is required", "documents count query")?; - let return_distinct_counts_in_range = input.return_distinct_counts_in_range.unwrap_or(false); - let limit = input.limit; + let group_by = input.group_by.clone().unwrap_or_default(); + // DocumentQuery `limit: u32` uses `0` as the "unset" sentinel + // (translated to `None` on the V1 wire's `optional uint32`). + // `None` from the JS input maps to that sentinel. + let limit = input.limit.unwrap_or(0); let base_query = build_documents_query(sdk, input).await?; - Ok(DocumentCountQuery { - document_query: base_query, - return_distinct_counts_in_range, - limit, - }) + Ok(base_query + .with_select(Select::Count) + .with_group_by_fields(group_by) + .with_limit(limit)) } /// Parse JSON where clause into WhereClause @@ -527,10 +536,10 @@ impl WasmSdk { /// /// Returns a `Map` keyed by the platform-value- /// encoded property value (hex-encoded). For simple total counts - /// (no `in` clause and `return_distinct_counts_in_range = false`) - /// the map has a single entry with empty-string key — - /// `result.get("")` is the total. For per-`In`-value or per- - /// distinct-value-in-range modes, each key maps to its count. + /// (empty / omitted `groupBy`) the map has a single entry with + /// empty-string key — `result.get("")` is the total. For + /// per-group modes (non-empty `groupBy`), each key maps to its + /// count. /// /// Query-object knobs (all camelCase on the JS side): /// - `where: [[field, op, value], ...]` @@ -543,22 +552,25 @@ impl WasmSdk { /// range) doesn't read `orderBy` — its builder sorts In keys /// lex-ascending unconditionally for prove/no-proof parity. /// - `limit?: number` — caps the number of entries returned in - /// per-key modes. On no-proof paths the server clamps to its - /// `max_query_limit`. On the prove-distinct path the server - /// rejects oversized requests with `InvalidLimit` rather than - /// silently clamping (silent clamping would break proof - /// verification); unset falls back to a compile-time constant - /// the SDK verifier reads, so proof bytes are deterministic - /// across operators regardless of their runtime config. - /// - `returnDistinctCountsInRange?: boolean` — when `true` AND - /// the query carries a range clause, returns per-distinct- - /// value entries instead of a single sum. + /// per-group modes. On no-proof paths the server clamps to + /// its `max_query_limit`. On the prove-distinct path the + /// server rejects oversized requests with `InvalidLimit` + /// rather than silently clamping (silent clamping would break + /// proof verification); unset falls back to a compile-time + /// constant the SDK verifier reads, so proof bytes are + /// deterministic across operators regardless of their runtime + /// config. + /// - `groupBy?: string[]` — SQL-shaped GROUP BY, mirroring the + /// wire `group_by` field one-to-one. See the `DocumentsQuery` + /// TypeScript declaration for the supported shapes (aggregate + /// / per-`In`-value / per-distinct-range / compound). The + /// server rejects unsupported `(select, group_by, where)` + /// combinations with `QuerySyntaxError::Unsupported`. /// /// One entry point per `[plain | withProofInfo]` variant covers - /// every count mode (total / per-`In`-value / per-distinct-value- - /// in-range / summed-over-range) because `DocumentSplitCounts:: - /// fetch` (which this wraps) dispatches on the request shape - /// internally. For compound `In + range + distinct` queries the + /// every count mode because `DocumentSplitCounts::fetch` (which + /// this wraps) dispatches on the request shape internally. For + /// compound `In + range` queries with a 2-field `groupBy` the /// per-`(in_key, key)` entries are summed by `key` into the flat /// map; callers needing the unmerged compound shape should use a /// richer binding (not yet exposed here).