# @dashevo/dapi-grpc

> DAPI GRPC definition file and generated clients

Latest version **5.0.3** (published 2026-11-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install @dashevo/dapi-grpc
pnpm add @dashevo/dapi-grpc
yarn add @dashevo/dapi-grpc
bun add @dashevo/dapi-grpc
```

## Health

**Score 55/100 (C)** — status: active.

Positive: no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads; no types; no esm support; large bundle.

## Facts

| | |
|---|---|
| Version | 5.0.3 |
| Published | 2026-11-03 |
| First published | 2019-04-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 29 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Maintainers | shumkov, alex-werner, nmarley, cofresi, evodeploy, jawid-h |

## Links

- npm: https://www.npmjs.com/package/@dashevo/dapi-grpc
- Repository: https://github.com/dashevo/dapi-grpc
- Homepage: https://github.com/dashevo/dapi-grpc#readme
- Issues: https://github.com/dashevo/dapi-grpc/issues
- npm.io page: https://npm.io/package/@dashevo/dapi-grpc

## Dependencies (6)

- [long](https://npm.io/package/long.md) ^5.2.0
- [@grpc/grpc-js](https://npm.io/package/@grpc/grpc-js.md) ^1.14.5
- [google-protobuf](https://npm.io/package/google-protobuf.md) ^3.12.2
- [@dashevo/protobufjs](https://npm.io/package/@dashevo/protobufjs.md) 6.10.5
- [@dashevo/grpc-common](https://npm.io/package/@dashevo/grpc-common.md) 5.0.3
- [@improbable-eng/grpc-web](https://npm.io/package/@improbable-eng/grpc-web.md) ^0.15.0

## Recent versions

- 5.0.3 (latest) — 2026-11-03
- 5.1.0-dev.1 (5.1-dev) — 2026-11-13
- 5.0.0-rc.8 (5.0-rc) — 2026-10-23
- 5.0.0-beta.6 (5.0-beta) — 2026-10-13
- 4.2.0-beta.7 (4.2-beta) — 2026-09-29
- 4.2.0-dev.11 (4.2-dev) — 2026-09-15
- 4.1.0-rc.3 (4.1-rc) — 2026-07-27
- 4.1.0-beta.2 (4.1-beta) — 2026-07-23
- 4.0.0-rc.2 (4.0-rc) — 2026-06-12
- 4.0.0-beta.4 (4.0-beta) — 2026-06-09
- 3.1.0-dev.8 (3.1-dev) — 2026-05-28
- 3.0.1-hotfix.4 (3.0-hotfix) — 2026-02-05
- 3.0.0-rc.3 (3.0-rc) — 2026-01-20
- 3.0.0-dev.11 (3.0-dev) — 2026-01-08
- 2.2.0-dev.2 (2.2-dev) — 2025-11-28
- … 472 more at https://npm.io/package/@dashevo/dapi-grpc/versions

## README

# DAPI GRPC

[![Build Status](https://github.com/dashpay/platform/actions/workflows/release.yml/badge.svg)](https://github.com/dashpay/platform/actions/workflows/release.yml)
[![NPM version](https://img.shields.io/npm/v/@dashevo/dapi-grpc.svg)](https://npmjs.org/package/@dashevo/dapi-grpc)
[![Release Date](https://img.shields.io/github/release-date/dashpay/platform)](https://github.com/dashpay/platform/releases/latest)
[![license](https://img.shields.io/github/license/dashevo/dapi-grpc.svg)](LICENSE)

Decentralized API GRPC definition files and generated clients

## Table of Contents

- [Install](#install)
- [Usage](#usage)
- [Contributing](#contributing)
- [License](#license)

## Install

Ensure you have the latest [NodeJS](https://nodejs.org/en/download/) installed.

#### From repository

Clone the repo:

```shell
git clone https://github.com/dashevo/dapi-grpc
```

Install npm packages:

```shell
npm install
```

#### From NPM

```sh
npm install @dashevo/dapi-grpc
```

## Usage

Node users are able to access exported elements by requiring them under v0 property.

### Core Client

Provide a client to perform core request.

```js
const {
  v0: {
    CorePromiseClient,
  },
} = require('@dashevo/dapi-grpc');

const client = new CorePromiseClient(url);
```

Provided method allow to then perform the request, by passing a specific request parameter (see below example).
All methods share the same API :
- First parameter expect a specific request instance of a Request class (such as GetBlockRequest, GetTransactionRequest).
- Second parameter is optional for metadata object.
- Third parameter is optional for options.

Here is a usage example for requesting a Block by its hash and handling its response :

```js
const {
  v0: {
    CorePromiseClient,
    GetBlockRequest,
    GetBlockResponse,
  },
} = require('@dashevo/dapi-grpc');

const client = new CorePromiseClient(url);

async function getBlockByHash(hash, options = {}) {
  const getBlockRequest = new GetBlockRequest();
  getBlockRequest.setHash(hash);

  const response = await client.getBlock(
    getBlockRequest,
    {},
    options,
  );
  const blockBinaryArray = response.getBlock();

  return Buffer.from(blockBinaryArray);
}
```

Available methods :

- getStatus
- getBlock
- broadcastTransaction
- getTransaction
- getEstimatedTransactionFee
- subscribeToBlockHeadersWithChainLocks
- subscribeToTransactionsWithProofs

For streams, such as subscribeToTransactionsWithProofs and subscribeToBlockHeadersWithChainLocks, a [grpc-web stream](https://github.com/grpc/grpc-web) will be returned.
More info on their usage can be read over their repository.

### Platform Client

Provide a client to perform platform request.
Method's API and usage is similar to CorePromiseClient.

```js
const {
  v0: {
    PlatformPromiseClient,
  },
} = require('@dashevo/dapi-grpc');

const client = new PlatformPromiseClient(url);
```

Available methods :

- broadcastStateTransition
- getIdentity
- getDataContract
- getDocuments
- getIdentitiesByPublicKeyHashes
- waitForStateTransitionResult
- getConsensusParams
- setProtocolVersion

## Maintainer

[@shumkov](https://github.com/shumkov)

## Contributing

Feel free to dive in! [Open an issue](https://github.com/dashpay/platform/issues/new/choose) or submit PRs.

## License

[MIT](LICENSE) &copy; Dash Core Group, Inc.

## Building generated clients

From the Platform monorepo, run `yarn install`, then provision the native
client generators once:

```sh
python3 packages/dapi-grpc/scripts/setup-codegen.py --install
yarn workspace @dashevo/dapi-grpc build
```

Installation needs Python 3.12 or newer, CMake and a C++ compiler. It builds
checksum-verified sources into your user cache without sudo or Docker. Linux
runner images provide the same tools at `/opt/client-codegen`. Set
`DAPI_GRPC_TOOLCHAIN` to use an explicitly provisioned installation; a missing or
mismatched installation fails rather than silently selecting a different protoc.

`codegen.json` pins the recipe and native generator versions. The client compiler
is deliberately separate from the Rust build's protoc 32.0: the existing client
output uses protobuf 3.18.1, gRPC 1.46.3, gRPC Java 1.42.1 and the Yarn-locked
`ts-protoc-gen` 0.15.0. Update the recipe, Platform lock and runner requirements
together, with generated-output compatibility checks. Ordinary builds never
install system packages or start containers.

Generation stages all languages before replacing `clients/`, so a failed plugin
preserves the previous output. Java, Objective-C and Python are generated for
repository consumers; the NPM archive continues to exclude them and ships the
Node and web clients. Run the generation regressions after installing the tools:

```sh
yarn workspace @dashevo/dapi-grpc exec python3 -m unittest discover -s tests/codegen -v
```

---
_Source: https://npm.io/package/@dashevo/dapi-grpc · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
