DAPI Endpoints#

Overview#

DAPI currently provides 2 types of endpoints: JSON-RPC and gRPC. The JSON-RPC endpoints expose some layer 1 information while the gRPC endpoints support layer 2 as well as streaming of events related to blocks and transactions/transitions.

Platform Endpoints#

In addition to providing the requested data, the following endpoints can also provide proofs that the data returned is valid and complete. The endpoints are versioned so updates can be made to them without introducing issues for endpoint consumers.

Contested Resources#

Endpoint

Description

getContestedResources

Added in Dash Platform v1.0.0
Retrieves the contested resources for a specific contract, document type, and index.

getContestedResourceIdentityVotes

Updated in Dash Platform v5.0.0
Retrieves the voting record of a specific identity. Rejects a non-zero offset on proved requests.

getContestedResourceVotersForIdentity

Added in Dash Platform v1.0.0
Retrieves the voters for a specific identity associated with a contested resource.

getContestedResourceVoteState

Added in Dash Platform v1.0.0
Retrieves the state of a vote for a specific contested resource.

getVotePollsByEndDate

Retrieves vote polls that will end within a specified date range

Data Contracts and Documents#

Endpoint

Description

getDataContract

Returns the requested data contract

getDataContracts

Updated in Dash Platform v5.0.0
Returns the requested data contracts. Rejects an empty ID list when a proof is requested.

getDataContractHistory

Updated in Dash Platform v5.0.0
Returns the requested data contract history. Returns INVALID_ARGUMENT for a limit outside 1 to 10, and rejects an offset on proved requests.

getDataContractsByRange

Added in Dash Platform v5.0.0
Enumerates every data contract on Platform, one page at a time, in ascending contract ID order.

getDataContractsLatestVersions

Added in Dash Platform v5.0.0
Returns the current version number of each requested data contract. Clients can use this to check whether contracts they already hold are still current without downloading the contracts again.

getContractFeePots

Added in Dash Platform v5.0.0
Returns the two fee pots of a data contract.

getDocuments

Updated in Dash Platform v5.0.0
Returns the requested document(s), or an aggregate count/sum/average over the matched document set. Includes ranked, having-range, chained, and composite query modes, the IN_TIME_RANGE and IN_INTEGER_RANGE window operators, and the CONTAINS / CONTAINS_ANY typed-array operators.

getDocumentHistory

Updated in Dash Platform v5.0.0
Returns the revision history for a single document on a contract that keeps document history. Rejects a non-zero offset on proved requests.

Contract Moderation#

Added in version 5.0.0.

Contract moderation, introduced in protocol version 14, lets a data contract keep a banlist, a suspension list, and a warning list of identities, and lets its moderators delete documents. A contract’s moderators are its owner, identities it appoints, or a team elected by masternodes. A banned or suspended identity cannot submit document transitions for the contract. The endpoints in this section read an identity’s moderation status, the lists themselves, the records of removed documents, and the actions and action counts of an elected contract’s seated moderation team.

Endpoint

Description

getContractModerationStatus

Returns an identity’s status on one or more moderation lists of a moderated data contract: whether it is banned, until when it is suspended, and which warnings it carries.

getContractModerationEntries

Returns one page of a moderated contract’s banlist, suspension list, or warning list, in identity ID order.

getContractDocumentRemovals

Returns the removal records of documents that a contract’s moderators deleted from one document type, either for specific document IDs or as a page in document ID order. A record shows who removed the document, when, and why, and whether it has since been restored.

getContractTeamActions

Returns one page of the actions that an elected contract’s seated moderation team is voting on (active) or has carried out (closed), in action ID order.

getContractTeamActionSigners

Returns the team members that approved one of the actions an elected contract’s seated moderation team votes on.

getContractModerationActionCounts

Returns how many counted moderation actions (bans, suspensions, warnings, and document deletions) each member of an elected contract’s seated moderation team has signed since the moderators fee pot was last paid out.

Identities#

Endpoint

Description

getIdentity

Returns the requested identity

getIdentityBalance

Returns the requested identity’s balance

getIdentityBalanceAndRevision

Returns the requested identity’s balance and revision

getIdentityByNonUniquePublicKeyHash

Updated in Dash Platform v5.0.0
Returns one or more identities associated with a public key hash, including for non-unique masternode keys. A v1 request returns one proof covering the index selection and the identity.

getIdentityByPublicKeyHash

Returns the identity associated with the provided public key hash

getIdentityContractNonce

Returns the identity contract nonce

getIdentityKeys

Updated in Dash Platform v5.0.0
Returns the requested identity keys. Request validation is stricter.

getIdentityKeysRemainingBudgets

Added in Dash Platform v5.0.0
Returns what is left of the credit budgets of an identity’s keys.

getIdentityNonce

Returns the current identity nonce

getIdentitiesBalances

Updated in Dash Platform v5.0.0
Retrieves the balances for a list of identities. Rejects an empty ID list when a proof is requested.

getIdentitiesContractKeys

Updated in Dash Platform v5.0.0
Returns keys associated to a specific contract for multiple Identities. Rejects an empty ID list when a proof is requested.

Security Groups#

Added in version 2.0.0.

Security groups provide a way to distribute token configuration and update authorization across multiple identities. Each group defines a set of member identities, the voting power of each member, and the required power threshold to authorize an action. The endpoints in this section are used to retrieve information about groups and the actions they are performing.

Endpoint

Description

getGroupInfo

Retrieves information about a specific group within a contract, including its members and required power.

getGroupInfos

Retrieves information about multiple groups within a contract, including their members and required power.

getGroupActions

Updated in Dash Platform v5.0.0
Retrieves a list of actions performed by a specific group within a contract. Adds the mint_to_pool and burn_from_pool token events.

getGroupActionSigners

Retrieves the signers for a specified group action within a contract, along with their assigned power.

Contract Groups#

Added in version 5.0.0.

From protocol version 14, contract groups organize data contracts, document types, and tokens into an identity-owned collection, which authentication keys can be scoped to. Each group has an owner, optional admins, and an optional name and description. Contract groups are not the same as security groups: security groups are defined inside a data contract and their member identities jointly authorize token actions, while the members of a contract group are contracts, document types, and tokens.

Endpoint

Description

getContractGroupInfo

Retrieves the stored information of a contract group: its owner, admins, name, and description.

getContractGroupMembers

Retrieves one page of a contract group’s members of a single kind: member contracts, member document types, or member tokens.

getContractGroupsForContract

Retrieves the contract groups a data contract belongs to, whether as a whole contract, through its document types, or through its tokens.

State Transitions#

Endpoint

Description

broadcastStateTransition

Updated in Dash Platform v5.0.0
Broadcasts the provided State Transition. Shielded broadcasts from an address that keeps submitting invalid proofs are rate limited.

waitForStateTransitionResult

Updated in Dash Platform v5.0.0
Responds with the state transition hash and either a proof that the state transition was confirmed in a block, the owner’s credit balance (if requested without a proof), or an error

System Info#

Endpoint

Description

getCurrentQuorumsInfo

Added in Dash Platform v1.4.0
Retrieves current quorum details, including validator sets and metadata for each quorum.

getEvonodesProposedEpochBlocksByIds

Added in Dash Platform v1.3.0
Retrieves the number of blocks proposed by the specified evonodes in a certain epoch, based on their IDs

getEvonodesProposedEpochBlocksByRange

Added in Dash Platform v1.3.0
Retrieves the number of blocks proposed by evonodes for a specified epoch

getEpochsInfo

Updated in Dash Platform v5.0.0
Returns information about the requested epoch(s). count must be at least 1 when a proof is requested.

getFinalizedEpochInfos

Added in Dash Platform v2.0.0
Retrieves finalized epoch information within a specified index range

getPathElements

Added in Dash Platform v1.0.0
Returns elements for a specified path in the Platform

getPrefundedSpecializedBalance

Added in Dash Platform v1.0.0
Returns the pre-funded specialized balance for a specific identity

getProtocolVersionUpgradeState

Returns the number of votes cast for each protocol version

getProtocolVersionUpgradeVoteStatus

Updated in Dash Platform v5.0.0
Returns protocol version upgrade status. count must be at least 1.

getStatus

Updated in Dash Platform v5.0.0
Retrieves status information related to Dash Platform. stateSync is omitted when no snapshot restore is reported.

getTotalCreditsInPlatform

Added in Dash Platform v1.1.0
Retrieves the total credits in the platform

Tokens#

Added in version 2.0.0.

Endpoint

Description

getIdentityTokenBalances

Retrieves the token balances of a specified identity.

getIdentitiesTokenBalances

Retrieves the token balances for a list of specified identities.

getIdentityTokenInfos

Retrieves information about specified tokens for a given identity.

getIdentitiesTokenInfos

Retrieves token information for a list of specified identities.

getTokenContractInfo

Retrieves contract information associated with a specific token ID.

getTokenDirectPurchasePrices

Retrieves direct purchase prices defined for the specified token IDs.

getTokenPerpetualDistributionLastClaim

Retrieves the last-claim timestamp for a token’s perpetual distribution for a specific identity.

getTokenPreProgrammedDistributions

Retrieves pre-programmed distributions of a specified token.

getTokenStatuses

Retrieves the statuses of specified tokens.

getTokenTotalSupply

Retrieves the total supply of a specified token, including aggregated user accounts and system-held amounts.

Address System#

Added in version 3.0.0.

Endpoint

Description

getAddressInfo

Returns balance and nonce information for a specified address.

getAddressesInfos

Returns balance and nonce information for multiple addresses.

getAddressesTrunkState

Returns a proof of the trunk state of the address tree.

getAddressesBranchState

Returns a Merkle proof for a branch of the address tree.

getRecentAddressBalanceChanges

Returns recent address balance changes starting from a specified block height.

getRecentCompactedAddressBalanceChanges

Returns compacted address balance changes from a specified block height.

Shielded Transactions#

Attention

Shielded Transaction endpoints are defined in the protocol but are not yet available on public nodes.

Added in version 4.0.0.

Endpoint

Description

getShieldedEncryptedNotes

Updated in Dash Platform v5.0.0
Returns encrypted notes from the shielded pool for a specified range. Accepts an optional token_id to query a token’s shielded pool.

getShieldedAnchors

Updated in Dash Platform v5.0.0
Returns all commitment tree anchors for the shielded pool. Accepts an optional token_id to query a token’s shielded pool.

getMostRecentShieldedAnchor

Updated in Dash Platform v5.0.0
Returns the most recent commitment tree anchor. Accepts an optional token_id to query a token’s shielded pool.

getShieldedPoolState

Updated in Dash Platform v5.0.0
Returns the total balance held in the shielded pool. Accepts an optional token_id to query a token’s shielded pool.

getShieldedNotesCount

Updated in Dash Platform v5.0.0
Returns the count of leaves in the shielded notes commitment tree, used to seed shielded sync progress. Accepts an optional token_id to query a token’s shielded pool.

getShieldedNullifiers

Updated in Dash Platform v5.0.0
Returns the spent status of specified nullifiers. Accepts an optional token_id to query a token’s shielded pool.

Core Endpoints#

The following endpoints provide information about the Core chain.

JSON-RPC Endpoints#

These endpoints historically expose Core information; getStatus is the exception and returns Platform status.

Endpoint

Description

getBestBlockHash

Returns block hash of the chaintip

getBlockHash

Returns block hash of the requested block

getStatus

Returns Platform status information

sendRawTransaction

Updated in Dash Platform v5.0.0
Submits a raw transaction to the network. Supports Dash Core v24 transactions.

gRPC Endpoints#

Endpoint

Description

broadcastTransaction

Updated in Dash Platform v5.0.0
Broadcasts the provided transaction. Supports Dash Core v24 transactions.

getBestBlockHeight

Added in Dash Platform v1.0.0
Return the best block height

getBlock

Returns information for the requested block

getBlockchainStatus

Added in Dash Platform v1.0.0
Returns blockchain status information

getMasternodeStatus

Returns masternode status information

getTransaction

Returns details for the requested transaction

subscribeTo BlockHeadersWithChainLocks

Updated in Dash Platform v5.0.0
Returns the requested block headers along with the associated ChainLocks. Supports Dash Core v24 blocks and transactions.

subscribeToMasternodeList

Added in Dash Platform v1.0.0
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

subscribeTo TransactionsWithProofs

Updated in Dash Platform v5.0.0
Returns transactions matching the provided bloom filter along with the associated islock message and merkle block. Supports Dash Core v24 blocks and transactions.

Note

See the previous version of this documentation for older endpoints.