# @dashevo/dapi-client 中文文档

规范地址：https://npmcn.com/package/%40dashevo/dapi-client/

版本：5\.0\.3
npm 元数据更新时间：2026-11-03T19:36:15.705Z
中文译文更新时间：2026-11-11T12:33:45.802Z
软件包许可：MIT

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40dashevo/dapi-client
原文对照：https://npmcn.com/package/%40dashevo/dapi-client/?lang=original

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：272 kB，144 个文件
- 模块格式：CommonJS
- TypeScript 类型：未声明
- Node.js 要求：\>=18\.18
- 运行依赖：9 个
- 首次发布：2019-03-25T13:57:42.701Z
- 最新版本发布：2026-11-03T19:36:15.514Z
- 近 30 天下载量：4829（2026-10-12 至 2026-11-10，npm 官方下载统计）
- 已发布版本数：518（近 12 个月 72 个）

## 中文简介

用于访问 Dash DAPI 端点的客户端库

## 安装

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

也可以使用：`pnpm add @dashevo/dapi-client`、`yarn add @dashevo/dapi-client`、`bun add @dashevo/dapi-client`

## README

# DAPI 客户端

[![NPM Version](https://img.shields.io/npm/v/@dashevo/dapi-client)](https://www.npmjs.com/package/@dashevo/dapi-client) [![Build Status](https://github.com/dashpay/platform/actions/workflows/release.yml/badge.svg)](https://github.com/dashpay/platform/actions/workflows/release.yml) [![Release Date](https://img.shields.io/github/release-date/dashpay/platform)](https://github.com/dashpay/platform/releases/latest) [![standard-readme compliant](https://img.shields.io/badge/readme%20style-standard-brightgreen)](https://github.com/RichardLitt/standard-readme)

用于访问 Dash DAPI 端点的客户端库

此库启用基于 HTTP 的与 Dash 块链和 Dash 的交互 通过分散化的API平台[数字化](https://github.com/dashevo/dapi)(中文(简体) ) 在Dash主节点上主持.

-   `DAPI-Client` 使用默认的种子节点或用户提供的种子节点提供自动服务器(masternode)发现
-   `DAPI-Client` 地图到 DAPI [难民保护委员会](https://github.com/dashpay/platform/tree/master/packages/dapi/lib/rpcServer/commands) 财务报告和审定财务报表 [(原始内容存档于2018-10-21) (英语). gRPC](https://github.com/dashpay/platform/tree/master/packages/dapi/lib/grpcServer/handlers) 结束点

## 目录

-   [安装](https://npmcn.com/package/%40dashevo/dapi-client/#readme-install)
-   [使用量](https://npmcn.com/package/%40dashevo/dapi-client/#readme-usage)
-   [文档](https://npmcn.com/package/%40dashevo/dapi-client/#readme-documentation)
-   [捐款](https://npmcn.com/package/%40dashevo/dapi-client/#readme-contributing)
-   [许可证](https://npmcn.com/package/%40dashevo/dapi-client/#readme-license)

## 安装

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

## 使用量

### 基础

```javascript
const DAPIClient = require('@dashevo/dapi-client');
const client = new DAPIClient();

client.core.getStatus().then((coreStatus) => {
  console.dir(coreStatus);
});
```

### 自定义种子节点

自定义种子节点对于连接客户端到devnet是必需的,因为客户端库在其他情况下并不知道它们.

```javascript
const DAPIClient = require('@dashevo/dapi-client');

var client = new DAPIClient({
  seeds: [{
     host: 'seed-1.evonet.networks.dash.org',
     port: 443,
  }],
});

client.core.getBestBlockHash().then((r) => {
  console.log(r);
});
```

**说明**:上面显示的种子节点(`seed-1.evonet.networks.dash.org`)是用于Dash Evonet测试网络.

### 自定义地址

自定义地址可能直接指定在确切知道正在访问的节点(如调试,本地开发等)的情况下.

```javascript
const DAPIClient = require('@dashevo/dapi-client');

var client = new DAPIClient({
  dapiAddresses: [
    '127.0.0.1:443',
    '127.0.0.2:443',
  ],
});

client.core.getBestBlockHash().then((r) => {
  console.log(r);
});
```

### 命令特定选项

DAPI客户端选项可以被直接传递给任何命令来覆盖任何预先定义的客户端选项并修改客户端的行为以用于该特定调用.

```javascript
const DAPIClient = require('@dashevo/dapi-client');

// Set options to direct the request to a specific address and disable retries
const options = {
  dapiAddresses: ['127.0.0.1'],
  retries: 0,
};

client.core.getBestBlockHash(options).then((r) => {
  console.log(r);
});
```

## 文档

可在以下网址查阅更广泛的文件: [https://dashpay.github.io/平板电脑/DAPI-Client/](https://dashpay.github.io/platform/DAPI-Client/)。 。 。 .

## 捐款

随便下潜吧! [打开一个问题](https://github.com/dashpay/platform/issues/new/choose) 或者提交公关.

## 许可证

[麻省理工学院](https://npmcn.com/package/%40dashevo/dapi-client/LICENSE) 达什核心小组股份有限公司.

## 常见问题

### @dashevo/dapi-client 是什么？

用于访问 Dash DAPI 端点的客户端库

### 如何安装 @dashevo/dapi-client？

在项目目录运行 npm install @dashevo/dapi-client，或使用 pnpm add / yarn add / bun add。

### @dashevo/dapi-client 支持 TypeScript 吗？

该包的 package\.json 没有声明类型入口。需要类型提示时，可以在 npm 上查找社区维护的 @types/dashevo\_\_dapi-client 是否存在。

### @dashevo/dapi-client 支持 ESM 还是 CommonJS？

以 CommonJS 形式发布，可以直接 require\(\)；在 ES Module 项目中也可以用 import 引入（Node\.js 会把 module\.exports 作为默认导出）。

### @dashevo/dapi-client 需要什么版本的 Node\.js？

package\.json 的 engines 字段要求 Node\.js \>=18\.18。版本不符时 npm 默认只给出警告，开启 engine-strict 后会拒绝安装。

### @dashevo/dapi-client 可以商用吗？

@dashevo/dapi-client 使用 MIT 许可。宽松许可：允许商业使用、修改和再分发，通常只需在分发时保留原版权与许可声明。以上为概括，不构成法律意见，请以许可原文为准。

### @dashevo/dapi-client 的下载量有多少？

根据 npm 官方下载统计，@dashevo/dapi-client 在 2026/10/12 – 2026/11/10 这 30 天内被下载 4,829 次，日均约 161 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入，适合横向比较热度，不能直接等同于使用人数。

### @dashevo/dapi-client 还在维护吗？

最新版本 5\.0\.3 发布于 2026/11/04（7 天前）；至今共发布 518 个版本，其中过去 12 个月发布了 72 个；首次发布于 2019/03/25。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

