diff --git a/docs/reference/dapi-endpoints-core-grpc-endpoints.md b/docs/reference/dapi-endpoints-core-grpc-endpoints.md index 2e27a2ac3..606438e81 100644 --- a/docs/reference/dapi-endpoints-core-grpc-endpoints.md +++ b/docs/reference/dapi-endpoints-core-grpc-endpoints.md @@ -75,16 +75,11 @@ corePromiseClient.client.broadcastTransaction({ transaction: tx.toBuffer() }) ::: :::: -### getBlock +### getBestBlockHeight -**Returns**: A raw block -**Parameters**: +**Returns**: The height of the best block in the chain -| Name | Type | Required | Description | -| ------------------------- | ------- | -------- | --------------------------------------------------- | -| **One of the following:** | | | | -| `hash` | Bytes | No | Return the block matching the block hash provided | -| `height` | Integer | No | Return the block matching the block height provided | +**Parameters**: None #### Example Request and Response @@ -101,8 +96,8 @@ const client = new DAPIClient({ }], }); -client.core.getBlockByHeight(1) - .then((response) => console.log(response.toString('hex'))); +client.core.getBestBlockHeight() + .then((response) => console.log(response)); ``` ::: @@ -112,31 +107,14 @@ client.core.getBlockByHeight(1) const { v0: { CorePromiseClient, + GetBestBlockHeightRequest, }, } = require('@dashevo/dapi-grpc'); const corePromiseClient = new CorePromiseClient('https://seed-1.testnet.networks.dash.org:1443'); -corePromiseClient.client.getBlock({ height: 1 }) - .then((response) => console.log(response.block.toString('hex'))); -``` -::: - -:::{tab-item} JavaScript (dapi-grpc) -```javascript -const { - v0: { - CorePromiseClient, - }, -} = require('@dashevo/dapi-grpc'); - -const corePromiseClient = new CorePromiseClient('https://seed-1.testnet.networks.dash.org:1443'); - -corePromiseClient.client.getBlock({ - hash: '0000047d24635e347be3aaaeb66c26be94901a2f962feccd4f95090191f208c1', -}).then((response) => { - console.log(response.block.toString('hex')); -}); +corePromiseClient.client.getBestBlockHeight(new GetBestBlockHeightRequest()) + .then((response) => console.log(response.height)); ``` ::: @@ -144,24 +122,17 @@ corePromiseClient.client.getBlock({ :sync: grpcurl ```shell grpcurl -proto protos/core/v0/core.proto \ - -d '{ - "height":1 - }' \ seed-1.testnet.networks.dash.org:1443 \ - org.dash.platform.dapi.v0.Core/getBlock + org.dash.platform.dapi.v0.Core/getBestBlockHeight ``` ::: :::: -> 📘 Block Encoding -> -> **Note:** The gRPCurl response block data is Base64 encoded - ::::{tab-set} :::{tab-item} Response (JavaScript) :sync: js-dapi-client -```shell -020000002cbcf83b62913d56f605c0e581a48872839428c92e5eb76cd7ad94bcaf0b00007f11dcce14075520e8f74cc4ddf092b4e26ebd23b8d8665a1ae5bfc41b58fdb4c3a95e53ffff0f1ef37a00000101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff0a510101062f503253482fffffffff0100743ba40b0000002321020131f38ae3eb0714531dbfc3f45491b4131d1211e3777177636388bb5a74c3e4ac00000000 +```text +1017420 ``` ::: @@ -169,7 +140,7 @@ grpcurl -proto protos/core/v0/core.proto \ :sync: grpcurl ```json { - "block": "AgAAACy8+DtikT1W9gXA5YGkiHKDlCjJLl63bNetlLyvCwAAfxHczhQHVSDo90zE3fCStOJuvSO42GZaGuW/xBtY/bTDqV5T//8PHvN6AAABAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////8KUQEBBi9QMlNIL/////8BAHQ7pAsAAAAjIQIBMfOK4+sHFFMdv8P0VJG0Ex0SEeN3cXdjY4i7WnTD5KwAAAAA" + "height": 1017420 } ``` ::: @@ -228,10 +199,6 @@ grpcurl -proto protos/core/v0/core.proto \ ::: :::: -> 📘 -> -> **Note:** The gRPCurl response `bestBlockHash` and `chainWork` data is Base64 encoded. - ::::{tab-set} :::{tab-item} Response (JavaScript) :sync: js-dapi-client @@ -272,6 +239,9 @@ grpcurl -proto protos/core/v0/core.proto \ :::{tab-item} Response (gRPCurl) :sync: grpcurl + +Note: The gRPCurl response `bestBlockHash` and `chainWork` data is Base64 encoded. + ```json { "version": { @@ -306,90 +276,6 @@ grpcurl -proto protos/core/v0/core.proto \ ::: :::: -### getMasternodeStatus - -**Returns**: Masternode status information from the Core chain -**Parameters**: None - -#### Example Request and Response - -::::{tab-set} -:::{tab-item} JavaScript (dapi-client) -:sync: js-dapi-client -```javascript -const DAPIClient = require('@dashevo/dapi-client'); - -const client = new DAPIClient({ - seeds: [{ - host: 'seed-1.testnet.networks.dash.org', - port: 1443, - }], -}); - -client.core.getMasternodeStatus() - .then((response) => console.log(response)); -``` -::: - -:::{tab-item} JavaScript (dapi-grpc) -:sync: js-dapi-gprc -```javascript -const { - v0: { - GetMasternodeStatusRequest, - CorePromiseClient, - }, -} = require('@dashevo/dapi-grpc'); - -const corePromiseClient = new CorePromiseClient('https://seed-1.testnet.networks.dash.org:1443'); - -corePromiseClient.client.getMasternodeStatus(new GetMasternodeStatusRequest()) - .then((response) => console.log(response)); -``` -::: - -:::{tab-item} Shell (gRPCurl) -:sync: grpcurl -```shell -# Run in the platform repository's `packages/dapi-grpc/` directory -grpcurl -proto protos/core/v0/core.proto \ - seed-1.testnet.networks.dash.org:1443 \ - org.dash.platform.dapi.v0.Core/getMasternodeStatus -``` -::: -:::: - -> 📘 -> -> **Note:** The gRPCurl response `bestBlockHash` and `chainWork` data is Base64 encoded. - -::::{tab-set} -:::{tab-item} Response (JavaScript) -:sync: js-dapi-client -```json -{ - "status": "READY", - "proTxHash": "", - "posePenalty": 0, - "isSynced": true, - "syncProgress": 1 -} -``` -::: - -:::{tab-item} Response (gRPCurl) -:sync: grpcurl -```json -{ - "status": "READY", - "proTxHash": "LkhlGi6cDLTy+3q4dAYapK8M0otZaVYx5qNa85UO9vs=", - "isSynced": true, - "syncProgress": 1 -} -``` -::: -:::: - ### getTransaction **Returns**: A raw transaction @@ -451,10 +337,6 @@ grpcurl -proto protos/core/v0/core.proto \ ::: :::: -> 📘 Transaction Encoding -> -> **Note:** The gRPCurl response `transaction` and `blockHash` data are Base64 encoded - ::::{tab-set} :::{tab-item} Response (JavaScript) :sync: js-dapi-client @@ -488,6 +370,9 @@ GetTransactionResponse { :::{tab-item} Response (gRPCurl) :sync: grpcurl + +Note: The gRPCurl response `transaction` and `blockHash` data are Base64 encoded + ```json { "transaction": "AwAFAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////8GA8JaBgEJ/////wLu/M8xAAAAABl2qRR+sl3Fr0cta/Gah3qW8KcHwsYbdoisZfu3SgAAAAAZdqkUHsXGbpeJxlWuBo01CItAczRf4LCIrAAAAABGAgDCWgYA3zSmucmdu7+CaY+6n4aGHySJHhbAxeiB3gNMGSIgYA1c6q3De0wxbi7HpAf4g4BgSUqhmkAxVflcQyddo+2zGA==", @@ -533,13 +418,13 @@ grpcurl -proto protos/core/v0/core.proto \ ::: :::: -> 📘 -> -> **Note:** The gRPCurl response `chainlock` and `headers` data is Base64 encoded ::::{tab-set} :::{tab-item} Response (gRPCurl) :sync: grpcurl + +Note: The gRPCurl response `chainlock` and `headers` data is Base64 encoded + ```json { "chainLock": "FZANAAJkZxaMU6888G2zlRNCD6EemlC7+OXEiGtLZJ21AAAAo7qvfeETyNxWVog47Yiyx9j9FSUCVkUWBrn0ZAfIbeU75kiccv4ilNmj1Peavv1oD+Ti9dqJYy9K8/MuDt7rYnVfmPWIUj03QYWKzQKr/PaMkavTaa+PCOrqQYxcLX/s" @@ -555,6 +440,43 @@ grpcurl -proto protos/core/v0/core.proto \ ::: :::: +### subscribeToMasternodeList + +This endpoint returns the full masternode list from the genesis block to the chain tip as the first +message and then streams masternode list updates with every new block. + +**Returns**: Streams the requested masternode list updates + +**Parameters**: None + +#### Example Request and Response + +::::{tab-set} +:::{tab-item} Shell (gRPCurl) +:sync: grpcurl +```shell +grpcurl -proto protos/core/v0/core.proto \ + seed-1.testnet.networks.dash.org:1443 \ + org.dash.platform.dapi.v0.Core/subscribeToMasternodeList +``` +::: +:::: + +::::{tab-set} +:::{tab-item} Response (gRPCurl) +:sync: grpcurl + +Note: The gRPCurl response `masternodeListDiff` data is Base64 encoded. This example shows one of +the update messages following a new block. + +```json +{ + "masternodeListDiff": "rGhuVmVyc2lvbgFtYmFzZUJsb2NrSGFzaHhAMDAwMDAwYm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MWEwZmZiNDk0Y2Y3OTUwNTY5N2ZkMDllNmZjZWNhNzNiYWRmYjI2OWI2NjkwOGU0ZmZiNjExZDZkZjc3MzlkY2JkNTUwYjdlMzYyYmQ0MDY0ZjBhOWI5ODAxMDAwMGpkZWxldGVkTU5zgGZtbkxpc3SAbmRlbGV0ZWRRdW9ydW1zgGpuZXdRdW9ydW1zgHBtZXJrbGVSb290TU5MaXN0eEAyMGQ2YjVjM2UzNjYxNTQwNTk1Y2ZjZDVhOWNiNTI5OGRmOTQyZGZjZDNlYjNiZDkyMDA3YzA5NjM4MWM0MTFjcW1lcmtsZVJvb3RRdW9ydW1zeEBkMjMyZTU5NTk4MjI0MTllN2RjZjhjNDNjM2E3NGI4MTc3ZmI4YjYxODJiNTI5ZGFlYTIxYzYwMTIyMTRiYmY4bXF1b3J1bXNDTFNpZ3OA" +} +``` +::: +:::: + ### subscribeToTransactionsWithProofs **Returns**: streams the requested transaction information @@ -596,13 +518,12 @@ grpcurl -proto protos/core/v0/core.proto \ ::: :::: -> 📘 -> -> **Note:** The gRPCurl response `transactions` and `rawMerkleBlock` data is Base64 encoded - ::::{tab-set} :::{tab-item} Response (gRPCurl) :sync: grpcurl + +Note: The gRPCurl response `transactions` and `rawMerkleBlock` data is Base64 encoded + ```json { "rawTransactions": { @@ -628,13 +549,210 @@ grpcurl -proto protos/core/v0/core.proto \ [/block] ``` +## Disabled Endpoints + +The following endpoints are disabled for the initial Dash Platform release until their performance +and security are more thoroughly evaluated. + +### getBlock + +:::{attention} +This endpoint is currently disabled until its security and performance are evaluated. +::: + +**Returns**: A raw block +**Parameters**: + +| Name | Type | Required | Description | +| ------------------------- | ------- | -------- | --------------------------------------------------- | +| **One of the following:** | | | | +| `hash` | Bytes | No | Return the block matching the block hash provided | +| `height` | Integer | No | Return the block matching the block height provided | + +#### Example Request and Response + +::::{tab-set} +:::{tab-item} JavaScript (dapi-client) +:sync: js-dapi-client +```javascript +const DAPIClient = require('@dashevo/dapi-client'); + +const client = new DAPIClient({ + seeds: [{ + host: 'seed-1.testnet.networks.dash.org', + port: 1443, + }], +}); + +client.core.getBlockByHeight(1) + .then((response) => console.log(response.toString('hex'))); +``` +::: + +:::{tab-item} JavaScript (dapi-grpc) +:sync: js-dapi-gprc +```javascript +const { + v0: { + CorePromiseClient, + }, +} = require('@dashevo/dapi-grpc'); + +const corePromiseClient = new CorePromiseClient('https://seed-1.testnet.networks.dash.org:1443'); + +corePromiseClient.client.getBlock({ height: 1 }) + .then((response) => console.log(response.block.toString('hex'))); +``` +::: + +:::{tab-item} JavaScript (dapi-grpc) +```javascript +const { + v0: { + CorePromiseClient, + }, +} = require('@dashevo/dapi-grpc'); + +const corePromiseClient = new CorePromiseClient('https://seed-1.testnet.networks.dash.org:1443'); + +corePromiseClient.client.getBlock({ + hash: '0000047d24635e347be3aaaeb66c26be94901a2f962feccd4f95090191f208c1', +}).then((response) => { + console.log(response.block.toString('hex')); +}); +``` +::: + +:::{tab-item} Shell (gRPCurl) +:sync: grpcurl +```shell +grpcurl -proto protos/core/v0/core.proto \ + -d '{ + "height":1 + }' \ + seed-1.testnet.networks.dash.org:1443 \ + org.dash.platform.dapi.v0.Core/getBlock +``` +::: +:::: + +::::{tab-set} +:::{tab-item} Response (JavaScript) +:sync: js-dapi-client +```shell +020000002cbcf83b62913d56f605c0e581a48872839428c92e5eb76cd7ad94bcaf0b00007f11dcce14075520e8f74cc4ddf092b4e26ebd23b8d8665a1ae5bfc41b58fdb4c3a95e53ffff0f1ef37a00000101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff0a510101062f503253482fffffffff0100743ba40b0000002321020131f38ae3eb0714531dbfc3f45491b4131d1211e3777177636388bb5a74c3e4ac00000000 +``` +::: + +:::{tab-item} Response (gRPCurl) +:sync: grpcurl + +Note: The gRPCurl response `block` data is Base64 encoded + +```json +{ + "block": "AgAAACy8+DtikT1W9gXA5YGkiHKDlCjJLl63bNetlLyvCwAAfxHczhQHVSDo90zE3fCStOJuvSO42GZaGuW/xBtY/bTDqV5T//8PHvN6AAABAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////8KUQEBBi9QMlNIL/////8BAHQ7pAsAAAAjIQIBMfOK4+sHFFMdv8P0VJG0Ex0SEeN3cXdjY4i7WnTD5KwAAAAA" +} +``` +::: +:::: + +### getMasternodeStatus + +:::{attention} +This endpoint is currently disabled until its security and performance are evaluated. +::: + +**Returns**: Masternode status information from the Core chain +**Parameters**: None + +#### Example Request and Response + +::::{tab-set} +:::{tab-item} JavaScript (dapi-client) +:sync: js-dapi-client +```javascript +const DAPIClient = require('@dashevo/dapi-client'); + +const client = new DAPIClient({ + seeds: [{ + host: 'seed-1.testnet.networks.dash.org', + port: 1443, + }], +}); + +client.core.getMasternodeStatus() + .then((response) => console.log(response)); +``` +::: + +:::{tab-item} JavaScript (dapi-grpc) +:sync: js-dapi-gprc +```javascript +const { + v0: { + GetMasternodeStatusRequest, + CorePromiseClient, + }, +} = require('@dashevo/dapi-grpc'); + +const corePromiseClient = new CorePromiseClient('https://seed-1.testnet.networks.dash.org:1443'); + +corePromiseClient.client.getMasternodeStatus(new GetMasternodeStatusRequest()) + .then((response) => console.log(response)); +``` +::: + +:::{tab-item} Shell (gRPCurl) +:sync: grpcurl +```shell +# Run in the platform repository's `packages/dapi-grpc/` directory +grpcurl -proto protos/core/v0/core.proto \ + seed-1.testnet.networks.dash.org:1443 \ + org.dash.platform.dapi.v0.Core/getMasternodeStatus +``` +::: +:::: + +::::{tab-set} +:::{tab-item} Response (JavaScript) +:sync: js-dapi-client +```json +{ + "status": "READY", + "proTxHash": "", + "posePenalty": 0, + "isSynced": true, + "syncProgress": 1 +} +``` +::: + +:::{tab-item} Response (gRPCurl) +:sync: grpcurl + +Note: The gRPCurl response `proTxHash` data is Base64 encoded. + +```json +{ + "status": "READY", + "proTxHash": "LkhlGi6cDLTy+3q4dAYapK8M0otZaVYx5qNa85UO9vs=", + "isSynced": true, + "syncProgress": 1 +} +``` +::: +:::: + ## Deprecated Endpoints The following endpoints were recently deprecated. See the [previous version of documentation](https://docs.dash.org/projects/platform/en/0.25.0/docs/reference/dapi-endpoints-core-grpc-endpoints.html) for additional information on these endpoints. ### getStatus -*Deprecated in Dash Platform v1.0.0-dev.12* +:::{attention} +Deprecated in Dash Platform v1.0.0 +::: **Returns**: Status information from the Core chain **Parameters**: None @@ -687,10 +805,6 @@ grpcurl -proto protos/core/v0/core.proto \ ::: :::: -> 📘 -> -> **Note:** The gRPCurl response `bestBlockHash`, `chainWork`, and `proTxHash` data is Base64 encoded. - ::::{tab-set} :::{tab-item} Response (JavaScript) :sync: js-dapi-client @@ -739,6 +853,9 @@ grpcurl -proto protos/core/v0/core.proto \ :::{tab-item} Response (gRPCurl) :sync: grpcurl + +Note: The gRPCurl response `bestBlockHash`, `chainWork`, and `proTxHash` data is Base64 encoded. + ```json { "version": { diff --git a/docs/reference/dapi-endpoints-grpc-overview.md b/docs/reference/dapi-endpoints-grpc-overview.md index 7cf2bde4f..1f7d98545 100644 --- a/docs/reference/dapi-endpoints-grpc-overview.md +++ b/docs/reference/dapi-endpoints-grpc-overview.md @@ -4,13 +4,13 @@ # gRPC Overview -The gRPC endpoints provide access to information from Dash Platform (layer 2) as well as streaming of events related to blocks and transactions/transitions. +The gRPC endpoints provide access to information from Dash Platform as well as streaming of events related to blocks and transactions/transitions. ## Connecting to gRPC ### Auto-generated Clients -Clients for a number of languages are built automatically from the protocol definitions and are available in the `packages/dapi-grpc/clients` folder of the [platform](https://github.com/dashpay/platform/tree/master/packages/dapi-grpc/clients) repository. The protocol definitions are available in the [`protos` folder](https://github.com/dashpay/platform/tree/master/packages/dapi-grpc/protos). Pull requests are welcome to add support for additional languages that are not currently being built. +Clients for a number of languages are built automatically from the protocol definitions and are available in the `packages/dapi-grpc/clients` folder of the [platform](https://github.com/dashpay/platform/) repository. The protocol definitions are available in the [`packages/dapi-grpc/protos` folder]. Pull requests are welcome to add support for additional languages that are not currently being built. ### Command Line Examples @@ -27,71 +27,11 @@ cd platform/packages/dapi-grpc grpcurl -plaintext -proto protos/... ``` -## Data Encoding +### Browser access -The data submitted/received from the gRPC endpoints is encoded using both [CBOR](https://tools.ietf.org/html/rfc7049) and Base64. Data is first encoded with CBOR and the resulting output is then encoded in Base64 before being sent. +The [gRPC UI](https://github.com/fullstorydev/grpcui) tool provides a way to interact with gRPC servers using a browser. The example below shows how to start the tool configured to access Core gRPC endpoints on testnet: -Canonical encoding is used for state transitions, identities, data contracts, and documents. This puts the object's data fields in a sorted order to ensure the same hash is produced every time regardless of the actual order received by the encoder. Reproducible hashes are necessary to support validation of request/response data. - -Libraries such as [`cbor` (JavaScript)](https://www.npmjs.com/package/cbor) and [`cbor2` (Python)](https://pypi.org/project/cbor2/) can be used to encode/decode data for DAPI gRPC endpoints. - -The examples below use the response from a [`getIdentity` gPRC request](../reference/dapi-endpoints-platform-endpoints.md#getidentity) to demonstrate how to both encode data for sending and decode received data: - -::::{tab-set} -:::{tab-item} NodeJS - Decode Identity -```javascript -const cbor = require('cbor'); - -const grpc_identity_response = 'o2JpZHgsQ2JZVnlvS25HeGtIYUJydWNDQWhQRUJjcHV6OGoxNWNuWVlpdjFDRUhCTnhkdHlwZQFqcHVibGljS2V5c4GkYmlkAWRkYXRheCxBbXpSMkZNNGZZd0NtWnhHWjFOMnRhMkZmdUo5NU93K0xMQXJaREx1WUJqdGR0eXBlAWlpc0VuYWJsZWT1' - -const identity_cbor = Buffer.from(grpc_identity_response, 'base64').toJSON(); -const identity = cbor.decode(Buffer.from(identity_cbor)); - -console.log('Identity details'); -console.dir(identity); -``` -::: - -:::{tab-item} Python - Decode Identity -```python -# Python - Decode Identity -from base64 import b64decode, b64encode -import json -import cbor2 - -grpc_identity_response = 'o2JpZHgsQ2JZVnlvS25HeGtIYUJydWNDQWhQRUJjcHV6OGoxNWNuWVlpdjFDRUhCTnhkdHlwZQFqcHVibGljS2V5c4GkYmlkAWRkYXRheCxBbXpSMkZNNGZZd0NtWnhHWjFOMnRhMkZmdUo5NU93K0xMQXJaREx1WUJqdGR0eXBlAWlpc0VuYWJsZWT1' - -identity_cbor = b64decode(grpc_identity_response) -identity = cbor2.loads(identity_cbor) - -print('Identity details:\n{}\n'.format(json.dumps(identity, indent=2))) -``` -::: - -:::{tab-item} Python - Encode Identity -```python -# Python - Encode Identity -from base64 import b64decode, b64encode -import json -import cbor2 - -## Encode an identity -identity = { - "id": "CbYVyoKnGxkHaBrucCAhPEBcpuz8j15cnYYiv1CEHBNx", - "type": 1, - "publicKeys": [ - { - "id": 1, - "data": "AmzR2FM4fYwCmZxGZ1N2ta2FfuJ95Ow+LLArZDLuYBjt", - "type": 1, - "isEnabled": True - } - ] -} - -identity_cbor = cbor2.dumps(identity) -identity_grpc = b64encode(identity_cbor) -print('Identity gRPC data: {}'.format(identity_grpc)) +```shell +# Use Core gRPC +grpcui -insecure -open-browser -proto protos/core/v0/core.proto seed-1.testnet.networks.dash.org:1443 ``` -::: -:::: diff --git a/docs/reference/dapi-endpoints-json-rpc-endpoints.md b/docs/reference/dapi-endpoints-json-rpc-endpoints.md index ffd7de5dd..4521345a1 100644 --- a/docs/reference/dapi-endpoints-json-rpc-endpoints.md +++ b/docs/reference/dapi-endpoints-json-rpc-endpoints.md @@ -222,8 +222,18 @@ puts response.read_body } ``` +## Deprecated Endpoints + +The following endpoints were recently deprecated. See the [previous version of this +documentation](https://docs.dash.org/projects/platform/en/0.25.0/docs/reference/dapi-endpoints-json-rpc-endpoints.html) +for older references. + ### getMnListDiff +:::{attention} +Deprecated in Dash Platform v1.0.0. Replaced by [`subscribeToMasternodeList`](../reference/dapi-endpoints-core-grpc-endpoints.md#subscribetomasternodelist). +::: + **Returns**: a masternode list diff for the provided block hashes **Parameters**: @@ -352,13 +362,8 @@ puts response.read_body "merkleRootMNList": "e9bf66fe8884e046ef1c393813a91ac7dfb77dd0fb9abb077ed2259b430420f0" } } - ``` -## Deprecated Endpoints - -There are no recently deprecated endpoint, but the previous version of documentation can be [viewed here](https://docs.dash.org/projects/platform/en/0.24.0/docs/reference/dapi-endpoints-json-rpc-endpoints.html). - ## Code Reference Implementation details related to the information on this page can be found in: diff --git a/docs/reference/dapi-endpoints-platform-endpoints.md b/docs/reference/dapi-endpoints-platform-endpoints.md index ad5de0319..55b5196a9 100644 --- a/docs/reference/dapi-endpoints-platform-endpoints.md +++ b/docs/reference/dapi-endpoints-platform-endpoints.md @@ -4,7 +4,7 @@ # Platform gRPC Endpoints -Please refer to the [gRPC Overview](../reference/dapi-endpoints-grpc-overview.md) for details regarding running the examples shown below, encoding/decoding the request/response data, and clients available for several languages. +Please refer to the [gRPC Overview](../reference/dapi-endpoints-grpc-overview.md) for details regarding running the examples shown below. ## Data Proofs and Metadata @@ -29,14 +29,14 @@ Dash Platform 0.25.16 included a [breaking change that added versioning](https:/ ### broadcastStateTransition -> 📘 -> -> **Note:** The [`waitForStateTransitionResult` endpoint](#waitforstatetransitionresult) should be used in conjunction with this one for instances where proof of block confirmation is required. - Broadcasts a [state transition](../explanations/platform-protocol-state-transition.md) to the platform via DAPI to make a change to layer 2 data. The `broadcastStateTransition` call returns once the state transition has been accepted into the mempool. **Returns**: Nothing or error +:::{note} +The [`waitForStateTransitionResult` endpoint](#waitforstatetransitionresult) should be used after `broadcastStateTransition` if proof of block confirmation is required. +::: + **Parameters**: | Name | Type | Required | Description | @@ -55,11 +55,268 @@ Broadcasts a [state transition](../explanations/platform-protocol-state-transiti **Response**: No response except on error -### getIdentity +### getContestedResources + +Retrieves the contested resources for a specific contract, document type, and index. + +**Returns**: A list of contested resource values or a cryptographic proof. + +**Parameters**: + +| Name | Type | Required | Description | +| ---------------------- | -------- | -------- | --------------------------------------------------------------------------- | +| `contract_id` | Bytes | Yes | The ID of the data contract associated with the contested resources | +| `document_type_name` | String | Yes | The name of the document type associated with the contested resources | +| `index_name` | String | Yes | The name of the index used to query the contested resources | +| `start_index_values` | Array | No | Start values for index, for pagination | +| `end_index_values` | Array | No | End values for index, for pagination | +| `start_at_value_info` | Object | No | Start value information for pagination | +| `count` | Integer | No | Number of contested resources to return | +| `order_ascending` | Boolean | No | Sort order for results | +| `prove` | Boolean | No | Set to `true` to receive a proof that contains the requested contested resources | + +**Example Request and Response** + +::::{tab-set} +:::{tab-item} gRPCurl +:sync: grpcurl +```shell +# `contract_id` must be represented in base64 +grpcurl -proto protos/platform/v0/platform.proto \ + -d '{ + "v0": { + "contract_id": "5mjGWa9mruHnLBht3ntbfgodcSoJxA1XIfYiv1PFMVU=", + "document_type_name": "domain", + "index_name": "parentNameAndLabel" + } + }' \ + seed-1.testnet.networks.dash.org:1443 \ + org.dash.platform.dapi.v0.Platform/getContestedResources +``` +::: +:::: + +::::{tab-set} +:::{tab-item} Response (gRPCurl) +:sync: grpcurl +```json +{ + "v0": { + "contestedResourceValues": { + "contestedResourceValues": [ + "EgRkYXNo" + ] + }, + "metadata": { + "height": "2729", + "coreChainLockedHeight": 1086764, + "epoch": 756, + "timeMs": "1724076831562", + "protocolVersion": 1, + "chainId": "dash-testnet-50" + } + } +} +``` +::: +:::: + +### getContestedResourceIdentityVotes + +Retrieves the voting record of a specific identity. -> 🚧 Breaking changes -> -> Due to serialization changes in Dash Platform 0.25, using wasm-dpp is recommended when working with identities, data contracts, and documents. +**Returns**: A list of contested resource votes or a cryptographic proof. + +**Parameters**: + +| Name | Type | Required | Description | +| ------------------------------ | -------- | -------- | ------------| +| `identity_id` | Bytes | Yes | The ID of the identity whose votes are being requested | +| `limit` | Integer | No | Maximum number of results to return | +| `offset` | Integer | No | Offset for pagination | +| `order_ascending` | Boolean | No | Sort order for results | +| `start_at_vote_poll_id_info` | Object | No | Start poll ID information for pagination | +| `prove` | Boolean | No | Set to `true` to receive a proof that contains the requested identity votes | + +**Example Request and Response** + +::::{tab-set} +:::{tab-item} gRPCurl +```shell +# `identity_id` must be represented in base64 +grpcurl -proto protos/platform/v0/platform.proto \ + -d '{ + "v0": { + "identity_id": "zrrtwQwGj7NujFpg3a5OBjTg9AzrpL2XPEzmr+qN1Vw=" + } + }' \ + seed-1.testnet.networks.dash.org:1443 \ + org.dash.platform.dapi.v0.Platform/getContestedResourceIdentityVotes +``` +::: +:::: + +::::{tab-set} +:::{tab-item} Response (gRPCurl) +```json +{ + "v0": { + "votes": { + "contested_resource_identity_votes": [], + "finished_results": true + }, + "metadata": { + "height": "2874", + "core_chain_locked_height": 1086880, + "epoch": 761, + "time_ms": "1724093690163", + "protocol_version": 1, + "chain_id": "dash-testnet-50" + } + } +} +``` +::: +:::: + +### getContestedResourceVotersForIdentity + +Retrieves the voters for a specific identity associated with a contested resource. + +**Returns**: A list of voters or a cryptographic proof. + +**Parameters**: + +| Name | Type | Required | Description | +| ---------------------- | -------- | -------- | --------------------------------------------------------------------------- | +| `contract_id` | Bytes | Yes | The ID of the data contract associated with the contested resource | +| `document_type_name` | String | Yes | The name of the document type associated with the contested resource | +| `index_name` | String | Yes | The name of the index used to query the contested resource | +| `index_values` | Array | Yes | The values used to query the contested resource | +| `contestant_id` | Bytes | Yes | The ID of the identity for which to retrieve voters | +| `start_at_identifier_info` | Object | No | Start identifier information for pagination | +| `count` | Integer | No | Number of results to return | +| `order_ascending` | Boolean | No | Sort order for results | +| `prove` | Boolean | No | Set to `true` to receive a proof that contains the requested voters | + +**Example Request and Response** + +::::{tab-set} +:::{tab-item} gRPCurl +```shell +# `contract_id` and `contestant_id` must be represented in base64 +grpcurl -proto protos/platform/v0/platform.proto \ + -d '{ + "v0": { + "contract_id": "5mjGWa9mruHnLBht3ntbfgodcSoJxA1XIfYiv1PFMVU=", + "document_type_name": "domain", + "index_name": "parentNameAndLabel", + "index_values": [], + "contestant_id": "5mjGWa9mruHnLBht3ntbfgodcSoJxA1XIfYiv1PFMVU=" + } + }' \ + seed-1.testnet.networks.dash.org:1443 \ + org.dash.platform.dapi.v0.Platform/getContestedResourceVotersForIdentity +``` +::: +:::: + +::::{tab-set} +:::{tab-item} Response (gRPCurl) +```json +{ + "v0": { + "contestedResourceVoters": { + "finishedResults": true + }, + "metadata": { + "height": "2746", + "coreChainLockedHeight": 1086784, + "epoch": 757, + "timeMs": "1724079623407", + "protocolVersion": 1, + "chainId": "dash-testnet-50" + } + } +} +``` +::: +:::: + +### getContestedResourceVoteState + +Retrieves the state of a vote for a specific contested resource. + +**Returns**: The state of the contested resource vote, including the current contenders and the tally of votes. + +**Parameters**: + +| Name | Type | Required | Description | +| ------------------------------------------------ | -------- | -------- | ------------------------------------------------------------------------------------------------------- | +| `contract_id` | Bytes | Yes | The ID of the data contract associated with the contested resource | +| `document_type_name` | String | Yes | The name of the document type associated with the contested resource | +| `index_name` | String | Yes | The name of the index used to query the contested resource | +| `index_values` | Array | Yes | The values used to query the contested resource. | +| `result_type` | Enum | Yes | Specifies the result type to return: `DOCUMENTS`, `VOTE_TALLY`, or `DOCUMENTS_AND_VOTE_TALLY` | +| `allow_include_locked_and`
`_abstaining_vote_tally` | Boolean | No | Include votes that are locked or abstaining in the tally | +| `start_at_identifier_info` | Object | No | Start identifier information for pagination | +| `count` | Integer | No | Number of results to return | +| `prove` | Boolean | No | Set to `true` to receive a proof that contains the requested vote state | + +```{eval-rst} +.. + Commented out info + The following example isn't fully functional + + **Example Request and Response** + + ::::{tab-set} + :::{tab-item} gRPCurl + ```shell + grpcurl -proto protos/platform/v0/platform.proto \ + -d '{ + "v0": { + "contract_id": "5mjGWa9mruHnLBht3ntbfgodcSoJxA1XIfYiv1PFMVU=", + "document_type_name": "domain", + "index_name": "parentNameAndLabel", + "index_values": ["EgRkYXNo", "value2"], + "result_type": 1 + } + }' \ + seed-1.testnet.networks.dash.org:1443 \ + org.dash.platform.dapi.v0.Platform/getContestedResourceVoteState + ``` + ::: + :::: + +```{eval-rst} +.. + Commented out info + The following example isn't fully functional + + ::::{tab-set} + :::{tab-item} Response (gRPCurl) + ```json + { + "v0": { + "contested_resource_contenders": { + "contenders": [{"identifier": "id1", "vote_count": 10}, {"identifier": "id2", "vote_count": 5}] + }, + "metadata": { + "height": "6852", + "coreChainLockedHeight": 927072, + "epoch": 850, + "timeMs": "1701983652299", + "protocolVersion": 1, + "chainId": "dash-testnet-37" + } + } + } + ``` + ::: + :::: + +### getIdentity **Returns**: [Identity](../explanations/identity.md) information for the requested identity **Parameters**: @@ -67,11 +324,7 @@ Broadcasts a [state transition](../explanations/platform-protocol-state-transiti | Name | Type | Required | Description | | ------- | ------- | -------- | --------------------------------------------------------------------- | | `id` | Bytes | Yes | An identity `id` | -| `prove` | Boolean | No | Set to `true` to receive a proof that contains the requested identity | - -> 📘 -> -> **Note**: When requesting proofs, the data requested will be encoded as part of the proof in the response. +| `prove` | Boolean | No | Set to `true` to receive a proof that contains the requested identity. The data requested will be encoded as part of the proof in the response.| **Example Request and Response** @@ -90,7 +343,7 @@ loadDpp(); const dpp = new DashPlatformProtocol(); const client = new DAPIClient(); -const identityId = Identifier.from('4EfA9Jrvv3nnCFdSf7fad59851iiTRZ6Wcu6YVJ4iSeF'); +const identityId = Identifier.from('EuzJmuZdBSJs2eTrxHEp6QqJztbp6FKDNGMeb4W2Ds7h'); client.platform.getIdentity(identityId).then((response) => { const identity = dpp.identity.createFromBuffer(response.getIdentity()); console.log(identity.toJSON()); @@ -116,7 +369,7 @@ const platformPromiseClient = new PlatformPromiseClient( 'https://seed-1.testnet.networks.dash.org:1443', ); -const id = Identifier.from('4EfA9Jrvv3nnCFdSf7fad59851iiTRZ6Wcu6YVJ4iSeF'); +const id = Identifier.from('EuzJmuZdBSJs2eTrxHEp6QqJztbp6FKDNGMeb4W2Ds7h'); const idBuffer = Buffer.from(id); const getIdentityRequest = new GetIdentityRequest(); getIdentityRequest.setId(idBuffer); @@ -139,7 +392,7 @@ platformPromiseClient grpcurl -proto protos/platform/v0/platform.proto \ -d '{ "v0": { - "id": "MBLBm5jsADOt2zbNZLf1EGcPKjUaQwS19plBRChu/aw=" + "id": "zrrtwQwGj7NujFpg3a5OBjTg9AzrpL2XPEzmr+qN1Vw=" } }' \ seed-1.testnet.networks.dash.org:1443 \ @@ -154,7 +407,7 @@ grpcurl -proto protos/platform/v0/platform.proto \ ```json { "$version":"0", - "id":"4EfA9Jrvv3nnCFdSf7fad59851iiTRZ6Wcu6YVJ4iSeF", + "id":"EuzJmuZdBSJs2eTrxHEp6QqJztbp6FKDNGMeb4W2Ds7h", "publicKeys":[ { "$version":"0", @@ -226,7 +479,7 @@ grpcurl -proto protos/platform/v0/platform.proto \ grpcurl -proto protos/platform/v0/platform.proto \ -d '{ "v0": { - "id": "MBLBm5jsADOt2zbNZLf1EGcPKjUaQwS19plBRChu/aw=" + "id": "zrrtwQwGj7NujFpg3a5OBjTg9AzrpL2XPEzmr+qN1Vw=" } }' \ seed-1.testnet.networks.dash.org:1443 \ @@ -277,7 +530,7 @@ grpcurl -proto protos/platform/v0/platform.proto \ grpcurl -proto protos/platform/v0/platform.proto \ -d '{ "v0": { - "id": "MBLBm5jsADOt2zbNZLf1EGcPKjUaQwS19plBRChu/aw=" + "id": "zrrtwQwGj7NujFpg3a5OBjTg9AzrpL2XPEzmr+qN1Vw=" } }' \ seed-1.testnet.networks.dash.org:1443 \ @@ -390,7 +643,7 @@ loadDpp(); const dpp = new DashPlatformProtocol(null); const client = new DAPIClient(); -const identityId = Identifier.from('4EfA9Jrvv3nnCFdSf7fad59851iiTRZ6Wcu6YVJ4iSeF'); +const identityId = Identifier.from('EuzJmuZdBSJs2eTrxHEp6QqJztbp6FKDNGMeb4W2Ds7h'); const contractId = Identifier.from('GWRSAVFMjXx8HpQFaNJMqBV7MBgMK4br5UESsB4S31Ec'); client.platform.getIdentityContractNonce(identityId, contractId).then((response) => { console.log(`Current identity contract nonce: ${response.getIdentityContractNonce()}`); @@ -405,7 +658,7 @@ client.platform.getIdentityContractNonce(identityId, contractId).then((response) grpcurl -proto protos/platform/v0/platform.proto \ -d '{ "v0": { - "identity_id": "MBLBm5jsADOt2zbNZLf1EGcPKjUaQwS19plBRChu/aw=", + "identity_id": "zrrtwQwGj7NujFpg3a5OBjTg9AzrpL2XPEzmr+qN1Vw=", "contract_id": "5mjGWa9mruHnLBht3ntbfgodcSoJxA1XIfYiv1PFMVU=" } }' \ @@ -505,7 +758,7 @@ To search for identity keys, use the `search_keys` request type. The options for grpcurl -proto protos/platform/v0/platform.proto \ -d '{ "v0": { - "identity_id": "MBLBm5jsADOt2zbNZLf1EGcPKjUaQwS19plBRChu/aw=", + "identity_id": "zrrtwQwGj7NujFpg3a5OBjTg9AzrpL2XPEzmr+qN1Vw=", "request_type": { "allKeys": {} } @@ -522,7 +775,7 @@ grpcurl -proto protos/platform/v0/platform.proto \ grpcurl -proto protos/platform/v0/platform.proto \ -d '{ "v0": { - "identity_id": "MBLBm5jsADOt2zbNZLf1EGcPKjUaQwS19plBRChu/aw=", + "identity_id": "zrrtwQwGj7NujFpg3a5OBjTg9AzrpL2XPEzmr+qN1Vw=", "request_type": { "specificKeys": { "keyIds": [ @@ -544,7 +797,7 @@ grpcurl -proto protos/platform/v0/platform.proto \ grpcurl -proto protos/platform/v0/platform.proto \ -d '{ "v0": { - "identity_id": "MBLBm5jsADOt2zbNZLf1EGcPKjUaQwS19plBRChu/aw=", + "identity_id": "zrrtwQwGj7NujFpg3a5OBjTg9AzrpL2XPEzmr+qN1Vw=", "request_type": { "search_key": { "purpose_map": { @@ -619,7 +872,7 @@ loadDpp(); const dpp = new DashPlatformProtocol(null); const client = new DAPIClient(); -const identityId = Identifier.from('4EfA9Jrvv3nnCFdSf7fad59851iiTRZ6Wcu6YVJ4iSeF'); +const identityId = Identifier.from('EuzJmuZdBSJs2eTrxHEp6QqJztbp6FKDNGMeb4W2Ds7h'); client.platform.getIdentityNonce(identityId).then((response) => { console.log(`Current identity nonce: ${response.getIdentityNonce()}`); }); @@ -633,7 +886,7 @@ client.platform.getIdentityNonce(identityId).then((response) => { grpcurl -proto protos/platform/v0/platform.proto \ -d '{ "v0": { - "identity_id": "MBLBm5jsADOt2zbNZLf1EGcPKjUaQwS19plBRChu/aw=" + "identity_id": "zrrtwQwGj7NujFpg3a5OBjTg9AzrpL2XPEzmr+qN1Vw=" } }' \ seed-1.testnet.networks.dash.org:1443 \ @@ -705,7 +958,7 @@ grpcurl -proto protos/platform/v0/platform.proto \ -d '{ "v0": { "identities_ids": [ - "MBLBm5jsADOt2zbNZLf1EGcPKjUaQwS19plBRChu/aw=", + "zrrtwQwGj7NujFpg3a5OBjTg9AzrpL2XPEzmr+qN1Vw=", "NBgQk65dTNttDYDGLZNLrb1QEAWB91jqkqXtK1KU4Dc=" ], "purposes": [], @@ -741,21 +994,13 @@ grpcurl -proto protos/platform/v0/platform.proto \ ### getDataContract -> 🚧 Breaking changes -> -> Due to serialization changes in Dash Platform 0.25, using wasm-dpp is recommended when working with identities, data contracts, and documents. - **Returns**: [Data Contract](../explanations/platform-protocol-data-contract.md) information for the requested data contract **Parameters**: | Name | Type | Required | Description | | ------- | ------- | -------- | -------------------------------------------------------------------------- | | `id` | Bytes | Yes | A data contract `id` | -| `prove` | Boolean | No | Set to `true` to receive a proof that contains the requested data contract | - -> 📘 -> -> **Note**: When requesting proofs, the data requested will be encoded as part of the proof in the response. +| `prove` | Boolean | No | Set to `true` to receive a proof that contains the requested data contract. The data requested will be encoded as part of the proof in the response. | **Example Request and Response** @@ -845,7 +1090,7 @@ grpcurl -proto protos/platform/v0/platform.proto \ "requiresIdentityDecryptionBoundedKey":null }, "version":1, - "ownerId":"4EfA9Jrvv3nnCFdSf7fad59851iiTRZ6Wcu6YVJ4iSeF", + "ownerId":"EuzJmuZdBSJs2eTrxHEp6QqJztbp6FKDNGMeb4W2Ds7h", "schemaDefs":null, "documentSchemas":{ "domain":{ @@ -1107,11 +1352,7 @@ grpcurl -proto protos/platform/v0/platform.proto \ | `start_at_ms` | Integer | Yes | Request revisions starting at this timestamp | | `limit` | Integer | Yes | The maximum number of revisions to return | | `offset` | Integer | Yes | The offset of the first revision to return | -| `prove` | Boolean | No | Set to `true` to receive a proof that contains the requested data contract | - -> 📘 -> -> **Note**: When requesting proofs, the data requested will be encoded as part of the proof in the response. +| `prove` | Boolean | No | Set to `true` to receive a proof that contains the requested data contract. The data requested will be encoded as part of the proof in the response.| **Example Request and Response** @@ -1130,7 +1371,7 @@ loadDpp(); const dpp = new DashPlatformProtocol(null); const client = new DAPIClient(); -const contractId = Identifier.from('2ciAVGRuzogbR2NNtNfbn6YdW7BkLWntC7jrLNRMZN9n'); +const contractId = Identifier.from('23iZPjG4ADx8CYGorW4yM8FUo1gihQL2fZszWLTMFyQf'); client.platform.getDataContractHistory(contractId, 0, 2, 0).then((response) => { for (const key in response.getDataContractHistory()) { const revision = response.getDataContractHistory()[key]; @@ -1149,7 +1390,7 @@ client.platform.getDataContractHistory(contractId, 0, 2, 0).then((response) => { grpcurl -proto protos/platform/v0/platform.proto \ -d '{ "v0": { - "id":"GAGPHaxHbGDQv62LYIMuYbOaYjqD36X/pIXADxTfJvE=", + "id":"D43WwBJeadt7AR8wRmcagPiCmi/YvDBHYwheFKzMfyw=", "limit": 2, "offset": 0, "start_at_ms": 0, @@ -1264,18 +1505,14 @@ grpcurl -proto protos/platform/v0/platform.proto \ ### getDocuments -> 🚧 Breaking changes -> -> Due to serialization changes in Dash Platform 0.25, using wasm-dpp is recommended when working with identities, data contracts, and documents. - **Returns**: [Document](../explanations/platform-protocol-document.md) information for the requested document(s) **Parameters**: -> 📘 Parameter constraints -> -> **Note**: The `where`, `order_by`, `limit`, `start_at`, and `start_after` parameters must comply with the limits defined on the [Query Syntax](../reference/query-syntax.md) page. -> -> Additionally, note that `where` and `order_by` must be [CBOR](https://tools.ietf.org/html/rfc7049) encoded. +:::{note} +The `where`, `order_by`, `limit`, `start_at`, and `start_after` parameters must comply with the limits defined on the [Query Syntax](../reference/query-syntax.md) page. + +Additionally, note that `where` and `order_by` must be [CBOR](https://tools.ietf.org/html/rfc7049) encoded. +::: | Name | Type | Required | Description | | ----------------------- | ------- | -------- | ------------------------------------------------------------------------------------------------ | @@ -1289,11 +1526,7 @@ grpcurl -proto protos/platform/v0/platform.proto \ | `start_at` | Integer | No | Return records beginning with the index provided | | `start_after` | Integer | No | Return records beginning after the index provided | | ---------- | | | | -| `prove` | Boolean | No | Set to `true` to receive a proof that contains the requested document(s) | - -> 📘 -> -> **Note**: When requesting proofs, the data requested will be encoded as part of the proof in the response. +| `prove` | Boolean | No | Set to `true` to receive a proof that contains the requested document(s). The data requested will be encoded as part of the proof in the response. | **Example Request and Response** @@ -1446,7 +1679,7 @@ grpcurl -proto protos/platform/v0/platform.proto \ "requiresIdentityDecryptionBoundedKey":null }, "version":1, - "ownerId":"4EfA9Jrvv3nnCFdSf7fad59851iiTRZ6Wcu6YVJ4iSeF", + "ownerId":"EuzJmuZdBSJs2eTrxHEp6QqJztbp6FKDNGMeb4W2Ds7h", "schemaDefs":null, "documentSchemas":{ "domain":[ @@ -1557,98 +1790,206 @@ grpcurl -proto protos/platform/v0/platform.proto \ ::: :::: -### getProofs +### getPathElements + +Retrieves elements for a specified path in the platform. -**Returns**: Proof information for the requested identities, contracts, and/or document(s) +**Returns**: The elements or a cryptographic proof. **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 +| Name | Type | Required | Description | +| ------- | -------- | -------- | ----------- | +| `path` | Array | Yes | The path for which elements are being requested | +| `keys` | Array | No | The keys associated with the elements being requested | +| `prove` | Boolean | No | Set to `true` to receive a proof that contains the requested elements | **Example Request and Response** ::::{tab-set} :::{tab-item} gRPCurl -:sync: grpcurl ```shell -# Request proofs for an identity and a data contract -# `identityId` and `contractId` must be represented in base64 +# `path` array values be represented in base64 grpcurl -proto protos/platform/v0/platform.proto \ -d '{ "v0": { - "identities": [ - { - "request_type": "FULL_IDENTITY", - "identity_id": "MBLBm5jsADOt2zbNZLf1EGcPKjUaQwS19plBRChu/aw=" - } - ], - "contracts": [ - { - "contract_id": "5mjGWa9mruHnLBht3ntbfgodcSoJxA1XIfYiv1PFMVU=" - } - ], - "documents": [] + "path": ["path_element_1", "path_element_2"], + "keys": ["key1", "key2"] } }' \ seed-1.testnet.networks.dash.org:1443 \ - org.dash.platform.dapi.v0.Platform/getProofs + org.dash.platform.dapi.v0.Platform/getPathElements ``` ::: :::: ::::{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/kBIBYXq4egeakBAFgAC0EASCfZaUKZ1lrdoYjPs0O9YKoVr4p94txqspbRYfy8tthmP3KiDkEJD0hAACXwGQWS6E+DOmhhxAd6xNjdVGeulgD5i3dNpt5nRiwGxABMwg2kOcA+9xQ3NhoBqze6XaeidN/5COubSCHkp+bZ9wREQEBIN0CAduEoBne86ZfsX2HwXtJ9jM/ghzM4rJqnUNLkRV/wom8As3l9skVhNWf85H1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XRpb24gYXJlIHJlc3RyaWN0ZWQAAjfsugQjtjFH1tziawxcHm6Itrtfd4HxFXit+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 - }, + "elements": {}, "metadata": { - "height": "9350", - "coreChainLockedHeight": 929436, - "epoch": 943, - "timeMs": "1702317747792", + "height": "3256", + "coreChainLockedHeight": 1087397, + "epoch": 780, + "timeMs": "1724164508171", "protocolVersion": 1, - "chainId": "dash-testnet-37" + "chainId": "dash-testnet-50" } } } +``` +::: +:::: + +### getPrefundedSpecializedBalance + +Retrieves the pre-funded specialized balance for a specific identity. + +**Returns**: The balance or a cryptographic proof. +**Parameters**: + +| Name | Type | Required | Description | +| ------- | -------- | -------- | ----------- | +| `id` | Bytes | Yes | The ID of the identity whose balance is being requested | +| `prove` | Boolean | No | Set to `true` to receive a proof that contains the requested balance | + +**Example Request and Response** + +::::{tab-set} +:::{tab-item} gRPCurl +```shell +# `id` must be represented in base64 +grpcurl -proto protos/platform/v0/platform.proto \ + -d '{ + "v0": { + "id": "zrrtwQwGj7NujFpg3a5OBjTg9AzrpL2XPEzmr+qN1Vw=" + } + }' \ + seed-1.testnet.networks.dash.org:1443 \ + org.dash.platform.dapi.v0.Platform/getPrefundedSpecializedBalance +``` +::: +:::: + +::::{tab-set} +:::{tab-item} Response (gRPCurl) +```json +{ + "v0": { + "balance": "100000000", + "metadata": { + "height": "6860", + "coreChainLockedHeight": 927080, + "epoch": 852, + "timeMs": "1701983732299", + "protocolVersion": 1, + "chainId": "dash-testnet-37" + } + } +} ``` ::: :::: +### 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": "zrrtwQwGj7NujFpg3a5OBjTg9AzrpL2XPEzmr+qN1Vw=" + } + ], + "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/kBIBYXq4egeakBAFgAC0EASCfZaUKZ1lrdoYjPs0O9YKoVr4p94txqspbRYfy8tthmP3KiDkEJD0hAACXwGQWS6E+DOmhhxAd6xNjdVGeulgD5i3dNpt5nRiwGxABMwg2kOcA+9xQ3NhoBqze6XaeidN/5COubSCHkp+bZ9wREQEBIN0CAduEoBne86ZfsX2HwXtJ9jM/ghzM4rJqnUNLkRV/wom8As3l9skVhNWf85H1JsVvK8PkRe3fO83N0QjZ9StB5QNQEAFviDbTTGTvt2tyoqGNJydjW32VQs0vs5XVc8d/M5FJpQQgMBLBm5jsADOt2zbNZLf1EGcPKjUaQwS19plBRChu/awACQIBAQIBAwAAA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ZuRPU70BrwnGYqsfr3rqOmCvT+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" + } + } + } + + ``` + ::: + :::: + ::::: + ### getProtocolVersionUpgradeState **Returns**: The number of votes cast for each protocol version. @@ -1766,6 +2107,111 @@ grpcurl -proto protos/platform/v0/platform.proto \ ::: :::: +### getTotalCreditsInPlatform + +Retrieves the total credits in the platform. + +**Returns**: The total amount of credits or a cryptographic proof. + +**Parameters**: + +| Name | Type | Required | Description | +| ------- | -------- | -------- | ----------- | +| `prove` | Boolean | No | Set to `true` to receive a proof that contains the requested credit total | + +**Example Request and Response** + +::::{tab-set} +:::{tab-item} gRPCurl +```shell +grpcurl -proto protos/platform/v0/platform.proto \ + -d '{ + "v0": {} + }' \ + seed-1.testnet.networks.dash.org:1443 \ + org.dash.platform.dapi.v0.Platform/getTotalCreditsInPlatform +``` +::: +:::: + +::::{tab-set} +:::{tab-item} Response (gRPCurl) +```json +{ + "v0": { + "credits": "1594457743625920", + "metadata": { + "height": "3263", + "coreChainLockedHeight": 1087403, + "epoch": 781, + "timeMs": "1724165757972", + "protocolVersion": 1, + "chainId": "dash-testnet-50" + } + } +} +``` +::: +:::: + +### getVotePollsByEndDate + +Retrieves vote polls that will end within a specified date range. + +**Returns**: A list of vote polls or a cryptographic proof. + +**Parameters**: + +| Name | Type | Required | Description | +| ------------------ | -------- | -------- | ----------- | +| `start_time_info` | Object | No | Start time information for filtering vote polls | +| `end_time_info` | Object | No | End time information for filtering vote polls | +| `limit` | Integer | No | Maximum number of results to return | +| `offset` | Integer | No | Offset for pagination | +| `ascending` | Boolean | No | Sort order for results | +| `prove` | Boolean | No | Set to `true` to receive a proof that contains the requested vote polls | + +**Example Request and Response** + +::::{tab-set} +:::{tab-item} gRPCurl +```shell +grpcurl -proto protos/platform/v0/platform.proto \ + -d '{ + "v0": { + "start_time_info": {"start_time_ms": "1701980000000", "start_time_included": true}, + "end_time_info": {"end_time_ms": "1702000000000", "end_time_included": true}, + "limit": 10 + } + }' \ + seed-1.testnet.networks.dash.org:1443 \ + org.dash.platform.dapi.v0.Platform/getVotePollsByEndDate +``` +::: +:::: + +::::{tab-set} +:::{tab-item} Response (gRPCurl) +```json +{ + "v0": { + "votePollsByTimestamps": { + "finishedResults": true + }, + "metadata": { + "height": "2876", + "coreChainLockedHeight": 1086885, + "epoch": 761, + "timeMs": "1724094056585", + "protocolVersion": 1, + "chainId": "dash-testnet-50" + } + } +} +``` +::: +:::: + ### waitForStateTransitionResult **Returns**: The state transition hash and either a proof that the state transition was confirmed in a block or an error. @@ -1774,11 +2220,7 @@ grpcurl -proto protos/platform/v0/platform.proto \ | Name | Type | Required | Description | | ----------------------- | ------- | -------- | -------------------------------- | | `state_transition_hash` | Bytes | Yes | Hash of the state transition | -| `prove` | Boolean | Yes | Set to `true` to request a proof | - -> 📘 -> -> **Note**: When requesting proofs, the data requested will be encoded as part of the proof in the response. +| `prove` | Boolean | Yes | Set to `true` to request a proof. The data requested will be encoded as part of the proof in the response. | **Example Request** @@ -1845,7 +2287,9 @@ The following endpoints were recently deprecated. See the [previous version of d ### getIdentities -*Deprecated in Dash Platform v1.0.0-dev.12* +:::{attention} +Deprecated in Dash Platform v1.0.0 +::: **Returns**: [Identity](../explanations/identity.md) information for the requested identities @@ -1858,7 +2302,9 @@ The following endpoints were recently deprecated. See the [previous version of d ### getIdentitiesByPublicKeyHashes -*Deprecated in Dash Platform v1.0.0-dev.12* +:::{attention} +Deprecated in Dash Platform v1.0.0 +::: **Returns**: An array of [identities](../explanations/identity.md) associated with the provided public key hashes **Parameters**: diff --git a/docs/reference/dapi-endpoints.md b/docs/reference/dapi-endpoints.md index c334f5c41..1a8495e3d 100644 --- a/docs/reference/dapi-endpoints.md +++ b/docs/reference/dapi-endpoints.md @@ -15,7 +15,7 @@ streaming of events related to blocks and transactions/transitions. | :---: | -------- | ----------- | | 1 | [`getBestBlockHash`](../reference/dapi-endpoints-json-rpc-endpoints.md#getbestblockhash) | Returns block hash of the chaintip | | 1 | [`getBlockHash`](../reference/dapi-endpoints-json-rpc-endpoints.md#getblockhash) | Returns block hash of the requested block | -| 1 | [`getMnListDiff`](../reference/dapi-endpoints-json-rpc-endpoints.md#getmnlistdiff) | Returns masternode list diff for the provided block hashes | +| 1 | `getMnListDiff` | **Replaced by [`subscribeToMasternodeList`](../reference/dapi-endpoints-core-grpc-endpoints.md#subscribetomasternodelist) in Dash Platform v1.0.0** | ## gRPC Endpoints @@ -24,12 +24,14 @@ streaming of events related to blocks and transactions/transitions. | Layer | Endpoint | | | :---: | -------- | - | | 1 | [`broadcastTransaction`](../reference/dapi-endpoints-core-grpc-endpoints.md#broadcasttransaction) | Broadcasts the provided transaction | -| 1 | [`getBlock`](../reference/dapi-endpoints-core-grpc-endpoints.md#getblock) | Returns information for the requested block | -| 1 | [`getBlockchainStatus`](../reference/dapi-endpoints-core-grpc-endpoints.md#getblockchainstatus) | Returns blockchain status information
**Added in Dash Platform v1.0.0-dev.12** | -| 1 | [`getMasternodeStatus`](../reference/dapi-endpoints-core-grpc-endpoints.md#getmasternodestatus) | Returns masternode status information
**Added in Dash Platform v1.0.0-dev.12**| -| 1 | `getStatus` | **Removed in Dash Platform v1.0.0-dev.12**
Split into [`getBlockchainStatus`](../reference/dapi-endpoints-core-grpc-endpoints.md#getblockchainstatus) and [`getMasternodeStatus`](../reference/dapi-endpoints-core-grpc-endpoints.md#getmasternodestatus).
Returns blockchain status information | +| 1 | [`getBestBlockHeight`](../reference/dapi-endpoints-core-grpc-endpoints.md#getbestblockheight) | Return the best block height
**Added in Dash Platform v1.0.0**| +| 1 | [`getBlock`](../reference/dapi-endpoints-core-grpc-endpoints.md#getblock) | **Disabled in Dash Platform v1.0.0**
Returns information for the requested block | +| 1 | [`getBlockchainStatus`](../reference/dapi-endpoints-core-grpc-endpoints.md#getblockchainstatus) | Returns blockchain status information
**Added in Dash Platform v1.0.0** | +| 1 | [`getMasternodeStatus`](../reference/dapi-endpoints-core-grpc-endpoints.md#getmasternodestatus) | **Disabled in Dash Platform v1.0.0**
Returns masternode status information | +| 1 | `getStatus` | **Deprecated in Dash Platform v1.0.0**
Split into [`getBlockchainStatus`](../reference/dapi-endpoints-core-grpc-endpoints.md#getblockchainstatus) and [`getMasternodeStatus`](../reference/dapi-endpoints-core-grpc-endpoints.md#getmasternodestatus).
Returns blockchain status information | | 1 | [`getTransaction`](../reference/dapi-endpoints-core-grpc-endpoints.md#gettransaction) | Returns details for the requested transaction | -| 1 | [`subscribeTo` `BlockHeadersWithChainLocks`](../reference/dapi-endpoints-core-grpc-endpoints.md#subscribetoblockheaderswithchainlocks) | Returns the requested block headers along with the associated ChainLocks.
_Added in Dash Platform v0.22_ | +| 1 | [`subscribeTo` `BlockHeadersWithChainLocks`](../reference/dapi-endpoints-core-grpc-endpoints.md#subscribetoblockheaderswithchainlocks) | Returns the requested block headers along with the associated ChainLocks. | +| 1 | [`subscribeToMasternodeList`](../reference/dapi-endpoints-core-grpc-endpoints.md#subscribetomasternodelist) | Returns the full masternode list from the genesis block to the chain tip as the first message and provides update messages with every new block
**Added in Dash Platform v1.0.0** | | 1 | [`subscribeTo` `TransactionsWithProofs`](../reference/dapi-endpoints-core-grpc-endpoints.md#subscribetotransactionswithproofs) | Returns transactions matching the provided bloom filter along with the associated [`islock` message](https://docs.dash.org/projects/core/en/stable/docs/reference/p2p-network-instantsend-messages.html#islock) and [merkle block](https://docs.dash.org/projects/core/en/stable/docs/reference/p2p-network-data-messages.html#merkleblock) | ### Platform gRPC Service @@ -40,6 +42,10 @@ data returned is valid and complete. The endpoints are versioned so updates can | Layer | Endpoint | | | :---: | -------- | - | | 2 | [`broadcastStateTransition`](../reference/dapi-endpoints-platform-endpoints.md#broadcaststatetransition) | Broadcasts the provided State Transition | +| 2 | [`getContestedResources`](../reference/dapi-endpoints-platform-endpoints.md#getcontestedresources) | **Added in Dash Platform v1.0.0**
Retrieves the contested resources for a specific contract, document type, and index. | +| 2 | [`getContestedResourceIdentityVotes`](../reference/dapi-endpoints-platform-endpoints.md#getcontestedresourceidentityvotes) | **Added in Dash Platform v1.0.0**
Retrieves the voting record of a specific identity. | +| 2 | [`getContestedResourceVotersForIdentity`](../reference/dapi-endpoints-platform-endpoints.md#getcontestedresourcevotersforidentity) | **Added in Dash Platform v1.0.0**
Retrieves the voters for a specific identity associated with a contested resource. | +| 2 | [`getContestedResourceVoteState`](../reference/dapi-endpoints-platform-endpoints.md#getcontestedresourcevotestate) | **Added in Dash Platform v1.0.0**
Retrieves the state of a vote for a specific contested resource. | | 2 | [`getIdentity`](../reference/dapi-endpoints-platform-endpoints.md#getidentity) | Returns the requested identity | | 2 | [`getIdentityBalance`](../reference/dapi-endpoints-platform-endpoints.md#getidentitybalance) | Returns the requested identity's balance | | 2 | [`getIdentityBalanceAndRevision`](../reference/dapi-endpoints-platform-endpoints.md#getidentitybalanceandrevision) | Returns the requested identity's balance and revision | @@ -47,17 +53,21 @@ data returned is valid and complete. The endpoints are versioned so updates can | 2 | [`getIdentityContractNonce`](../reference/dapi-endpoints-platform-endpoints.md#getidentitycontractnonce) | Returns the identity contract nonce | | 2 | [`getIdentityKeys`](../reference/dapi-endpoints-platform-endpoints.md#getidentitykeys) | Returns the requested identity keys | 2 | [`getIdentityNonce`](../reference/dapi-endpoints-platform-endpoints.md#getidentitynonce) | Returns the current identity nonce | -| 2 | `getIdentities` | **Removed in Dash Platform v1.0.0-dev.12**
Returns the requested identities | -| 2 | [`getIdentitiesContractKeys`](../reference/dapi-endpoints-platform-endpoints.md#getidentitiescontractkeys) | **Added in Dash Platform v1.0.0-dev.12**
Returns keys associated to a specific contract for multiple Identities | -| 2 | `getIdentitiesByPublicKeyHashes` | **Removed in Dash Platform v1.0.0-dev.12**
Returns the identities associated with the provided public key hashes | +| 2 | `getIdentities` | **Removed in Dash Platform v1.0.0**
Returns the requested identities | +| 2 | [`getIdentitiesContractKeys`](../reference/dapi-endpoints-platform-endpoints.md#getidentitiescontractkeys) | **Added in Dash Platform v1.0.0**
Returns keys associated to a specific contract for multiple Identities | +| 2 | `getIdentitiesByPublicKeyHashes` | **Removed in Dash Platform v1.0.0**
Returns the identities associated with the provided public key hashes | | 2 | [`getDataContract`](../reference/dapi-endpoints-platform-endpoints.md#getdatacontract) | Returns the requested data contract | | 2 | [`getDataContracts`](../reference/dapi-endpoints-platform-endpoints.md#getdatacontracts) | Returns the requested data contracts | | 2 | [`getDataContractHistory`](../reference/dapi-endpoints-platform-endpoints.md#getdatacontracthistory) | Returns the requested data contract history | | 2 | [`getDocuments`](../reference/dapi-endpoints-platform-endpoints.md#getdocuments) | Returns the requested document(s) | | 2 | [`getEpochsInfo`](../reference/dapi-endpoints-platform-endpoints.md#getepochsinfo) | Returns information about the requested epoch(s) -| 2 | [`getProofs`](../reference/dapi-endpoints-platform-endpoints.md#getproofs) | Returns proof information for the requested identities, contracts, and/or document(s) +| 2 | [`getPathElements`](../reference/dapi-endpoints-platform-endpoints.md#getpathelements) | **Added in Dash Platform v1.0.0**
Returns elements for a specified path in the Platform | +| 2 | [`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 | +| 2 | `getProofs` | **Disabled for external use in Dash Platform v1.0.0**
Returns proof information for the requested identities, contracts, and/or document(s) | | 2 | [`getProtocolVersionUpgradeState`](../reference/dapi-endpoints-platform-endpoints.md#getprotocolversionupgradestate) | Returns the number of votes cast for each protocol version -| 2 | [`getProtocolVersionUpgradeVoteStatus`](../reference/dapi-endpoints-platform-endpoints.md#getprotocolversionupgradevotestatus) | Returns protocol version upgrade status +| 2 | [`getProtocolVersionUpgradeVoteStatus`](../reference/dapi-endpoints-platform-endpoints.md#getprotocolversionupgradevotestatus) | Returns protocol version upgrade status | +| 2 | [`getTotalCreditsInPlatform`](../reference/dapi-endpoints-platform-endpoints.md#gettotalcreditsinplatform) | **Added in Dash Platform v1.1.0**
Retrieves the total credits in the platform | +| 2 | [`getVotePollsByEndDate`](../reference/dapi-endpoints-platform-endpoints.md#getvotepollsbyenddate) | Retrieves vote polls that will end within a specified date range | | 2 | [`waitForStateTransitionResult`](../reference/dapi-endpoints-platform-endpoints.md#waitforstatetransitionresult) | Responds with the state transition hash and either a proof that the state transition was confirmed in a block or an error | ```{eval-rst} @@ -70,10 +80,10 @@ data returned is valid and complete. The endpoints are versioned so updates can [/block] ``` -> 📘 -> -> The previous version of documentation can be [viewed -> here](https://docs.dash.org/projects/platform/en/0.25.0/docs/reference/dapi-endpoints.html). +:::{note} +The previous version of documentation can be [viewed +here](https://docs.dash.org/projects/platform/en/0.25.0/docs/reference/dapi-endpoints.html). +::: ```{toctree} :maxdepth: 2