# @dashevo/wallet-lib 中文文档

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

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

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

原始 npm 页面：https://www.npmjs.com/package/%40dashevo/wallet-lib
原文对照：https://npmcn.com/package/%40dashevo/wallet-lib/?lang=original
项目主页：https://github.com/dashevo/wallet-lib#readme
源码仓库：https://github.com/dashevo/wallet-lib

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

- 包体积（解压后）：926 kB，501 个文件
- 模块格式：CommonJS
- TypeScript 类型：包内自带
- 运行依赖：10 个
- 首次发布：2019-07-18T12:38:10.633Z
- 最新版本发布：2026-11-03T19:36:05.713Z
- 近 30 天下载量：5012（2026-10-12 至 2026-11-10，npm 官方下载统计）
- 已发布版本数：474（近 12 个月 72 个）

## 中文简介

Dash 的轻钱包库

## 安装

```sh
npm install @dashevo/wallet-lib
```

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

## README

# 钱包库

[![NPM Version](https://img.shields.io/npm/v/@dashevo/wallet-lib)](https://www.npmjs.com/package/@dashevo/wallet-lib) [![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 纯和可扩展的 JavaScript 钱包库

**警告: 只有在连接到信任的节点时,此库才应用于生产. 虽然 它提供了对钱包功能的方便访问,而不需要完整的节点,它不验证 同步块链数据(例如主节点列表,即时发送交易,链链链)或 对照块头检查交易.**

## 目录

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

## 背景情况

[达西](https://www.dash.org/) 是一个强大的新一代金融技术的对等平台。 Dash网络的分权性质使得Dash基础设施具有高度的弹性,开发者社区需要可靠的开源工具来执行Dash应用和服务.

## 安装

### 节点

要使用此库, 您需要将它作为依赖性添加到您的项目中 .

拥有 [节点JS](https://nodejs.org/) 安装,仅在终端中输入 :

```sh
npm install @dashevo/wallet-lib
```

### CDN 独立

对于浏览器的使用,也可以直接依赖unpkg. 下面,我们也假设你用 [本地文件夹](https://github.com/localForage/localForage) 作为你的坚持适应器.

```
<script src="https://unpkg.com/@dashevo/wallet-lib"></script>
<script src="https://unpkg.com/localforage"></script>
const wallet = new Wallet({adapter: localforage});
```

## 使用量

在您的文件中, 您想要执行的地方 :

```js
const { Wallet, EVENTS } = require('@dashevo/wallet-lib');

const wallet = new Wallet();

// We can dump our initialization parameters
const mnemonic = wallet.exportWallet();

// Hook on headers and TX sync progress events
wallet.on(EVENTS.HEADERS_SYNC_PROGRESS, (progressInfo) => {
  const {
    confirmedProgress,
    totalProgress,
    confirmedSyncedCount,
    totalSyncedCount,
    totalCount
  } = progressInfo;
})

wallet.on(EVENTS.TRANSACTIONS_SYNC_PROGRESS, (progressInfo) => {
  const {
    progress,
    syncedBlocksCount,
    totalBlocksCount,
    transactionsCount
  } = progressInfo;
})

wallet.getAccount().then((account) => {
  // At this point, account has fetch all UTXOs if they exists
  const balance = account.getTotalBalance();
  console.log(`Balance: ${balance}`);

  // We easily can get a new address to fund
  const { address } = account.getUnusedAddress();
});
```

钱包默认会连接到DAPI,或者使用以浏览器为基础的本地forage(基于浏览器的设备)或者InMem适配器. 默认情况下, 账户将在预期的 BIP44 路径 (.0/ 0) 上进行 .

### 运输:

Insight-Client已经从MVP中移除,并且自Wallet-lib v3.0.

-   [DAPI 客户端](https://github.com/dashpay/platform/tree/master/packages/js-dapi-client)

### 适配器 :

-   [本地图像](https://github.com/localForage/localForage)
-   [反应同步集成](https://facebook.github.io/react-native/docs/asyncstorage)

## 文档

你可以看见一些 [示例](https://npmcn.com/package/%40dashevo/wallet-lib/docs/usage/examples.md)。 。 。 .

可在以下网址查阅更广泛的文件: [https://dashpay.github.io/平面图/Wallet-library/](https://dashpay.github.io/platform/Wallet-library/) 加上额外 [示例片段( s)](https://dashpay.github.io/platform/Wallet-library/usage/examples/)。 。 。 .

## 维护者

钱包 - Lib 由 [Dash 核心开发者](https://www.github.com/dashpay)。 。 。 . 我们要感谢所有提出建议、提出问题并提出要求的社区成员.

## 捐款

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

## 许可证

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

## 常见问题

### @dashevo/wallet-lib 是什么？

Dash 的轻钱包库

### 如何安装 @dashevo/wallet-lib？

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

### @dashevo/wallet-lib 支持 TypeScript 吗？

支持。包内自带 TypeScript 类型声明（package\.json 声明了 types 入口），安装后即可获得类型提示，无需再安装 @types 包。

### @dashevo/wallet-lib 支持 ESM 还是 CommonJS？

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

### @dashevo/wallet-lib 可以商用吗？

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

### @dashevo/wallet-lib 的下载量有多少？

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

### @dashevo/wallet-lib 还在维护吗？

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

