From 80b1dae1a7482c8819b5866e93b7864fe0d2a26f Mon Sep 17 00:00:00 2001 From: thephez Date: Wed, 8 Apr 2026 15:31:46 -0400 Subject: [PATCH 1/4] docs(reference): remove stale getProofs schema and fix start_epoch type MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove getProofs section (outdated identities/contracts/documents schema no longer exists in platform.proto; endpoint is internal DAPI-to-Drive only) - Remove getProofs row from endpoint overview table - Fix getEpochsInfo start_epoch parameter type: Bytes → Integer Co-Authored-By: Claude Sonnet 4.6 --- .../dapi-endpoints-platform-endpoints.md | 101 +----------------- docs/reference/dapi-endpoints.md | 1 - 2 files changed, 5 insertions(+), 97 deletions(-) diff --git a/docs/reference/dapi-endpoints-platform-endpoints.md b/docs/reference/dapi-endpoints-platform-endpoints.md index 75fdf3180..47ca03209 100644 --- a/docs/reference/dapi-endpoints-platform-endpoints.md +++ b/docs/reference/dapi-endpoints-platform-endpoints.md @@ -2707,7 +2707,7 @@ grpcurl -proto protos/platform/v0/platform.proto \ | Name | Type | Required | Description | | ------- | ------- | -------- | ----------- | -| `start_epoch` | Bytes | No | First epoch being requested +| `start_epoch` | Integer | No | First epoch being requested | `count` | Integer | No | Number of records to request | `ascending` | Boolean | No | Set to `true` to query in ascending order. Results are returned in descending order by default. | `prove` | Boolean | No | Set to `true` to receive a proof that contains the requested data contracts @@ -3029,101 +3029,10 @@ grpcurl -proto protos/platform/v0/platform.proto \ ::: :::: -### getProofs - -:::::{dropdown} ⚠️ For internal use only - - This endpoint is only used for communication between DAPI and Drive. All external requests are rejected. - - **Returns**: Proof information for the requested identities, contracts, and/or document(s) - - **Parameters**: - - A combination of one or more of the following are required fields are required: - - | Field | Type | Required | Description | - | - | - | - | - | - | `identities` | `IdentityRequest` | No | List of identity requests - | `contracts` | `ContractRequest` | No | List of contract requests - | `documents` | `DocumentRequest` | No | List of document requests - - **Request type details** - - | Field | Type | Required | Description | - | - | - | - | - | - | **IdentityRequest** | | | - | `identity_id` | Bytes | Yes | Identity ID - | `request_type` | Type (enum) | Yes | Type of identity proof data to request (options: FULL_IDENTITY, BALANCE, KEYS) - | --------------- | | | - | **ContractRequest** | | | - | `contract_id` | Bytes | Yes | A contract ID - | --------------- | | | - | **DocumentRequest** | | | - | `contract_id` | Bytes | Yes | A contract ID - | `document_type` | String | Yes | Type of contract document - | `document_type_keeps_history` | Boolean | No |Indicates if the document type maintains a history - | `document_id` | Bytes | Yes | Document ID - - **Example Request and Response** - - ::::{tab-set} - :::{tab-item} gRPCurl - :sync: grpcurl - ```shell - # Request proofs for an identity and a data contract - # `identity_id` and `contract_id` must be represented in base64 - grpcurl -proto protos/platform/v0/platform.proto \ - -d '{ - "v0": { - "identities": [ - { - "request_type": "FULL_IDENTITY", - "identity_id": "HxUSbKaFxbuvTUprfr5a0yU6u4EasTdSWvSxOwKjmxw=" - } - ], - "contracts": [ - { - "contract_id": "5mjGWa9mruHnLBht3ntbfgodcSoJxA1XIfYiv1PFMVU=" - } - ], - "documents": [] - } - }' \ - seed-1.testnet.networks.dash.org:1443 \ - org.dash.platform.dapi.v0.Platform/getProofs - ``` - ::: - :::: - ::::{tab-set} - :::{tab-item} Response (gRPCurl) - :sync: grpcurl - ```json - // GroveDB proof for the requested identity and contract - { - "v0": { - "proof": { - "grovedbProof": "AQYAAQDuAgHx2HzoF4wSud2eE4a+j9LczjcgboCJsEZJK+Bl/97hLAQBIAAkAgEgn2WlCmdZa3aGIz7NDvWCqFa+KfeLcarKW0WH8vLbYZgAAJpItikQWz3TcDudnxxiJSY5h5Ndejq2UOkZPubKDN0QAfhJDycGmgAM67TyQkPU3kuavJLc7wlcbvBD48JEelqeEQQBQAAkAgEgoqG0rG/vIuoqGmjoEjZEs1eHX2tBLBgQkoHBRueycbwA1L5TY2e0nwaAJolrXP7S6qWDVVTGeFpz4cjXIHoOPUoQAY6uNnLUV0nQB1qQqQWBLRyaJZfu/o/kBIBYXq4egeakBAFgAC0EASCfZaUKZ1lrdoYjP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mQgYSBub3JtYWxpemVkIGRvbWFpbiBuYW1lEghyZXF1aXJlZBUBEhBzYWx0ZWREb21haW5IYXNoEhRhZGRpdGlvbmFsUHJvcGVydGllcxMAEggkY29tbWVudBJKUHJlb3JkZXIgZG9jdW1lbnRzIGFyZSBpbW11dGFibGU6IG1vZGlmaWNhdGlvbiBhbmQgZGVsZXRpb24gYXJlIHJlc3RyaWN0ZWQAAjfsugQjtjFH1tziawxcHm6Itrtfd4HxFXit+EBuIEGCEAIBYN8CAb/jxzcNWFZEpbAUm+m8bHmGDiDoIp0nmnAVzK1RREtVAtYIgZuRPU70BrwnGYqsfr3rqOmCvT+uOZn5JD+z2Fb7EAHRk0v0/UW0amfTj5Q3RgNXsCy34jIVuLie5yXuiKURfQQgMBLBm5jsADOt2zbNZLf1EGcPKjUaQwS19plBRChu/awACwP9eCCC7wkAAAAApQ40uU7eIE6Lc7gSiikQMybwd7ICds9JRkR7mN9dsKsQAS6QXX9hmpIEs9jEW3eAXNz9stWYGeSq/BnIm9Y+L8XMERECiTcgqXvEL2837Y7t1JcjkYGVIFZ7NkS80ZLVeDUZzS0QAfdYjSzg2BIkhpiPAHQ5W4aN0OlpO7pNjwx46JLVtF5HEQLIaUC5PRYEMoQrfMJnG3PgKokrA37sdKCgo7Hxar/TcRABMapwxTKSfBkDooZq35By87R1c8Y4h4LvZXgOwY+CNfQR", - "quorumHash": "AAAAu4I2BiBDnydSZOLs2bV45yWb+vJFEKQi9wTc3hg=", - "signature": "t6IYrtqREmhCMGQva67DMYpqoY+4fIPB0245y/vhrs0L4qqv7+jDYFoppC7TzFCnCpXLxwOL15u8AOmGFsuMn7FA7qtz/rzJT0124Va1EL5ioeD0DwPVVCAEfQcN/7+6", - "round": 1, - "blockIdHash": "R6LgAhbTCMP2bbiktIm1nLnJ4csO0UvaK6vArGJ2ghs=", - "quorumType": 6 - }, - "metadata": { - "height": "9350", - "coreChainLockedHeight": 929436, - "epoch": 943, - "timeMs": "1702317747792", - "protocolVersion": 1, - "chainId": "dash-testnet-37" - } - } - } - - ``` - ::: - :::: - ::::: +```{eval-rst} +.. + Internal use only - getProofs is used for DAPI-to-Drive communication only; all external requests are rejected +``` ### getProtocolVersionUpgradeState diff --git a/docs/reference/dapi-endpoints.md b/docs/reference/dapi-endpoints.md index 81c5f8a9c..0e996f47d 100644 --- a/docs/reference/dapi-endpoints.md +++ b/docs/reference/dapi-endpoints.md @@ -83,7 +83,6 @@ Security groups provide a way to distribute token configuration and update autho | [`getFinalizedEpochInfos`](../reference/dapi-endpoints-platform-endpoints.md#getfinalizedepochinfos) | **Added in Dash Platform v2.0.0**
Retrieves finalized epoch information within a specified index range | | [`getPathElements`](../reference/dapi-endpoints-platform-endpoints.md#getpathelements) | *Added in Dash Platform v1.0.0*
Returns elements for a specified path in the Platform | | [`getPrefundedSpecializedBalance`](../reference/dapi-endpoints-platform-endpoints.md#getprefundedspecializedbalance) | *Added in Dash Platform v1.0.0*
Returns the pre-funded specialized balance for a specific identity | -| `getProofs` | **Disabled for external use in Dash Platform v1.0.0**
Returns proof information for the requested identities, contracts, and/or document(s) | | [`getProtocolVersionUpgradeState`](../reference/dapi-endpoints-platform-endpoints.md#getprotocolversionupgradestate) | Returns the number of votes cast for each protocol version | | [`getProtocolVersionUpgradeVoteStatus`](../reference/dapi-endpoints-platform-endpoints.md#getprotocolversionupgradevotestatus) | Returns protocol version upgrade status | | [`getStatus`](../reference/dapi-endpoints-platform-endpoints.md#getstatus) | *Added in Dash Platform v1.2.0*
Retrieves status information related to Dash Platform | From 6352c2e38a48ff76e64cdf9a7a5fb3bf749db94d Mon Sep 17 00:00:00 2001 From: thephez Date: Wed, 8 Apr 2026 17:07:35 -0400 Subject: [PATCH 2/4] docs(reference): update query-syntax with Between operators and where clause changes Add Between/BetweenExclude* operators with examples, clarify where clause is optional, add offset modifier, update startAt/startAfter examples, and fix DPNS index line numbers. --- docs/reference/query-syntax.md | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/docs/reference/query-syntax.md b/docs/reference/query-syntax.md index b82bcb905..dea1f2515 100644 --- a/docs/reference/query-syntax.md +++ b/docs/reference/query-syntax.md @@ -10,7 +10,7 @@ Generally queries will consist of a `where` clause plus optional [modifiers](#qu ## Where Clause -The Where clause must be a non-empty array containing not more than 10 conditions. For some operators, `value` will be an array. All fields referenced in a query's where clause must be defined in the same index. This includes `$createdAt` and `$updatedAt`. See the following general syntax example: +The Where clause is an optional array of conditions. If omitted or empty, all documents of the queried type are returned (subject to `limit`). For some operators, `value` will be an array. All fields referenced in a query's where clause must be defined in the same index. This includes system timestamp fields (e.g., `$createdAt`, `$updatedAt`, `$transferredAt`, and their block-height variants such as `$createdAtBlockHeight`). See the following general syntax example: ```json Syntax { @@ -27,7 +27,7 @@ Valid fields consist of the indices defined for the document being queried. For | Index Field(s) | Index Type | Unique | | - | - | :-: | -| [normalizedParentDomainName, normalizedLabel](https://github.com/dashpay/platform/blob/master/packages/dpns-contract/schema/v1/dpns-contract-documents.json#L5-L16) | Compound | Yes | +| [normalizedParentDomainName, normalizedLabel](https://github.com/dashpay/platform/blob/master/packages/dpns-contract/schema/v1/dpns-contract-documents.json#L11-L18) | Compound | Yes | | [records.identity](https://github.com/dashpay/platform/blob/master/packages/dpns-contract/schema/v1/dpns-contract-documents.json#L31-L39) | Single Field | No | ```{eval-rst} @@ -57,9 +57,13 @@ Valid fields consist of the indices defined for the document being queried. For | >= | Matches values that are greater than or equal to a specified value | | > | Matches values that are greater than a specified value | | in | Matches all document(s) where the value of the field equals any value in the specified array
Array may include up to 100 (unique) elements | +| Between | Matches values between two bounds (inclusive on both sides) — value must be a two-element array `[lower, upper]` with `lower < upper` | +| BetweenExcludeBounds | Matches values strictly between two bounds (exclusive on both sides) | +| BetweenExcludeLeft | Matches values between two bounds, excluding the lower bound | +| BetweenExcludeRight | Matches values between two bounds, excluding the upper bound | :::{tip} -- Only one range operator is allowed in a query (except for between behavior) +- Only one range operator is allowed in a query. `Between` and its variants are single operators that replace a `>=`/`<=` pair — the engine also normalizes two range operators on the same field into the equivalent `Between*` form automatically - The `in` operator is only allowed for last two indexed properties - Range operators are only allowed after `==` and `in` operators - Range operators are only allowed for the last two fields used in the where condition @@ -85,6 +89,21 @@ Valid fields consist of the indices defined for the document being queried. For ``` ::: +:::{tab-item} Between +```json +{ + where: [ + ["normalizedParentDomainName", "==", "dash"], + // Return names between "alice" and "carol" (inclusive) + ["normalizedLabel", "Between", ["alice", "carol"]], + ], + orderBy: [ + ["normalizedLabel", "asc"], + ] +} +``` +::: + :::{tab-item} in ```json in { @@ -120,9 +139,10 @@ The query modifiers described here determine how query results will be sorted an | Modifier | Effect | Example | | - | - | - | | `limit` | Restricts the number of results returned (maximum: 100) | `limit: 10` | -| `orderBy` | Returns records sorted by the field(s) provided (maximum: 2). Sorting must be by the last indexed property. Can only be used with `>`, `<`, `>=`, `<=`, and `startsWith` queries. | `orderBy: [['normalizedLabel', 'asc']]` | -| `startAt` | Returns records beginning with the document ID provided | `startAt: Buffer.from(Identifier.from())` | -| `startAfter` | Returns records beginning after the document ID provided | `startAfter: Buffer.from(Identifier.from())` | +| `orderBy` | Returns records sorted by the field(s) provided (maximum: 2). Sorting must be by the last indexed property. Can only be used with `>`, `<`, `>=`, `<=`, `Between`, `BetweenExcludeBounds`, `BetweenExcludeLeft`, `BetweenExcludeRight`, and `startsWith` queries. | `orderBy: [['normalizedLabel', 'asc']]` | +| `startAt` | Returns records beginning with the document ID provided | `startAt: ''` | +| `startAfter` | Returns records beginning after the document ID provided | `startAfter: ''` | +| `offset` | Skips the first N matching results (available at the CBOR/DAPI layer; not exposed in the JS SDK) | `offset: 10` | :::{attention} For indices composed of multiple fields ([example from the DPNS data contract](https://github.com/dashpay/platform/blob/master/packages/dpns-contract/schema/v1/dpns-contract-documents.json)), the sort order in an `orderBy` must either match the order defined in the data contract OR be the inverse order. From fcbb03c41cf3d4ff5b3670e44acc69478ef9d70e Mon Sep 17 00:00:00 2001 From: thephez Date: Wed, 8 Apr 2026 17:18:25 -0400 Subject: [PATCH 3/4] docs(reference): add evo-sdk tab to combined query example Co-Authored-By: Claude Sonnet 4.6 --- docs/reference/query-syntax.md | 35 ++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/docs/reference/query-syntax.md b/docs/reference/query-syntax.md index dea1f2515..b9f55b739 100644 --- a/docs/reference/query-syntax.md +++ b/docs/reference/query-syntax.md @@ -152,14 +152,35 @@ For indices composed of multiple fields ([example from the DPNS data contract](h The following query combines both a where clause and query modifiers. +::::{tab-set} +:::{tab-item} Query object ```javascript -import Dash from "dash" +const query = { + limit: 5, + startAt: '4Qp3menV9QjE92hc3BzkUCusAmHLxh1AU6gsVsPF4L2q', + where: [ + ['normalizedParentDomainName', '==', 'dash'], + ['normalizedLabel', 'startsWith', 'test'], + ], + orderBy: [ + ['normalizedLabel', 'asc'], + ], +} +``` +::: -const { Essentials: { Buffer }, PlatformProtocol: { Identifier } } = Dash; +:::{tab-item} Evo SDK example +```javascript +import { EvoSDK } from '@dashevo/evo-sdk'; -const query = { +const sdk = EvoSDK.testnetTrusted(); +await sdk.connect(); + +const results = await sdk.documents.query({ + dataContractId: 'GWRSAVFMjXx8HpQFaNJMqBV7MBgMK4br5UESsB4S31Ec', + documentTypeName: 'domain', limit: 5, - startAt: Buffer.from(Identifier.from('4Qp3menV9QjE92hc3BzkUCusAmHLxh1AU6gsVsPF4L2q')), + startAt: '4etYFuWbXRXB74gTDp53eLUqjLEAtNSfUX2XtrQ1uMdT', where: [ ['normalizedParentDomainName', '==', 'dash'], ['normalizedLabel', 'startsWith', 'test'], @@ -167,5 +188,11 @@ const query = { orderBy: [ ['normalizedLabel', 'asc'], ], +}); + +for (const [id, doc] of results) { + console.log(id.toString(), doc.toJSON()); } ``` +::: +:::: From 2390096337a4d4d1e66bb7a7f59a5aeb678ab5be Mon Sep 17 00:00:00 2001 From: thephez Date: Thu, 9 Apr 2026 11:38:13 -0400 Subject: [PATCH 4/4] docs(reference): fix query-syntax inaccuracies from audit - Add $createdAtCoreBlockHeight example to system timestamp fields - Document = as alias for == equality operator - Remove incorrect startsWith 255-character limit - Remove incorrect orderBy maximum: 2 constraint - Reorder range-operator tip to lead with normalisation behaviour - Guard doc?.toJSON() in Evo SDK example against undefined Co-Authored-By: Claude Sonnet 4.6 --- docs/reference/query-syntax.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/reference/query-syntax.md b/docs/reference/query-syntax.md index b9f55b739..266dcc899 100644 --- a/docs/reference/query-syntax.md +++ b/docs/reference/query-syntax.md @@ -10,7 +10,7 @@ Generally queries will consist of a `where` clause plus optional [modifiers](#qu ## Where Clause -The Where clause is an optional array of conditions. If omitted or empty, all documents of the queried type are returned (subject to `limit`). For some operators, `value` will be an array. All fields referenced in a query's where clause must be defined in the same index. This includes system timestamp fields (e.g., `$createdAt`, `$updatedAt`, `$transferredAt`, and their block-height variants such as `$createdAtBlockHeight`). See the following general syntax example: +The Where clause is an optional array of conditions. If omitted or empty, all documents of the queried type are returned (subject to `limit`). For some operators, `value` will be an array. All fields referenced in a query's where clause must be defined in the same index. This includes system timestamp fields (e.g., `$createdAt`, `$updatedAt`, `$transferredAt`, and their block-height variants such as `$createdAtBlockHeight` and `$createdAtCoreBlockHeight`). See the following general syntax example: ```json Syntax { @@ -46,7 +46,7 @@ Valid fields consist of the indices defined for the document being queried. For | Name | Description | | :-: | - | -| == | Matches values that are equal to a specified value | +| == (or =) | Matches values that are equal to a specified value | #### Range @@ -74,7 +74,7 @@ Valid fields consist of the indices defined for the document being queried. For | Name | Description | | :-: | - | -| startsWith | Selects documents where the value of a field begins with the specified characters (string, <= 255 characters). Must include an `orderBy` statement. | +| startsWith | Selects documents where the value of a field begins with the specified characters. Must include an `orderBy` statement. | ### Operator Examples @@ -139,7 +139,7 @@ The query modifiers described here determine how query results will be sorted an | Modifier | Effect | Example | | - | - | - | | `limit` | Restricts the number of results returned (maximum: 100) | `limit: 10` | -| `orderBy` | Returns records sorted by the field(s) provided (maximum: 2). Sorting must be by the last indexed property. Can only be used with `>`, `<`, `>=`, `<=`, `Between`, `BetweenExcludeBounds`, `BetweenExcludeLeft`, `BetweenExcludeRight`, and `startsWith` queries. | `orderBy: [['normalizedLabel', 'asc']]` | +| `orderBy` | Returns records sorted by the field(s) provided. Sorting must be by the last indexed property. Can only be used with `>`, `<`, `>=`, `<=`, `Between`, `BetweenExcludeBounds`, `BetweenExcludeLeft`, `BetweenExcludeRight`, and `startsWith` queries. | `orderBy: [['normalizedLabel', 'asc']]` | | `startAt` | Returns records beginning with the document ID provided | `startAt: ''` | | `startAfter` | Returns records beginning after the document ID provided | `startAfter: ''` | | `offset` | Skips the first N matching results (available at the CBOR/DAPI layer; not exposed in the JS SDK) | `offset: 10` | @@ -191,7 +191,7 @@ const results = await sdk.documents.query({ }); for (const [id, doc] of results) { - console.log(id.toString(), doc.toJSON()); + console.log(id.toString(), doc?.toJSON()); } ``` :::