@dashevo/wallet-lib

中文文档
12.0.3发布于 2026/11/04MITTypeScriptCommonJS近 30 天下载 5012

Light wallet library for Dash

原始使用文档
文档目录12 节
  1. Table of Contents
  2. Background
  3. Install
  4. Node
  5. CDN Standalone
  6. Usage
  7. Transports:
  8. Adapters :
  9. Documentation
  10. Maintainers
  11. Contributing
  12. License

Wallet Library

NPM Version Build Status Release Date standard-readme compliant

A pure and extensible JavaScript Wallet Library for Dash

Warning: This library should only be used in production when connected to trusted nodes. Although it provides easy access to wallet functionality without requiring a full node, it does not verify synchronized blockchain data (e.g., the masternode list, InstantSend transactions, ChainLocks) or check transactions against block headers.

Table of Contents

Background

Dash is a powerful new peer-to-peer platform for the next generation of financial technology. The decentralized nature of the Dash network allows for highly resilient Dash infrastructure, and the developer community needs reliable, open-source tools to implement Dash apps and services.

Install

Node

In order to use this library, you will need to add it to your project as a dependency.

Having NodeJS installed, just type in your terminal :

npm install @dashevo/wallet-lib

CDN Standalone

For browser usage, you can also directly rely on unpkg. Below, we also assume you use localForage as your persistence adapter.

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

Usage

In your file, where you want to execute it :

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();
});

Wallet will by default connects to DAPI and use either localforage (browser based device) or a InMem adapter. Account will by default be on expected BIP44 path (...0/0).

Transports:

Insight-Client has been removed from MVP and is not working since Wallet-lib v3.0.

Adapters :

Documentation

You can see some examples here.

More extensive documentation is available at https://dashpay.github.io/platform/Wallet-library/ along with additional examples & snippets.

Maintainers

Wallet-Lib is maintained by the Dash Core Developers. We want to thank all members of the community that have submitted suggestions, issues and pull requests.

Contributing

Feel free to dive in! Open an issue or submit PRs.

License

MIT © Dash Core Group, Inc.

版本与发布记录

@dashevo/wallet-lib 共发布 474 个版本,首次发布于 2019/07/18;过去 12 个月发布了 72 个版本。

版本发布日期距今
12.0.3latest2026/11/047 天前
12.0.22026/11/029 天前
12.0.12026/10/2714 天前
12.0.02026/10/2715 天前
12.0.0-rc.82026/10/2319 天前
12.0.0-rc.72026/10/2220 天前

其他发布通道:dev → 7.19.0-dev.2,7.20-dev → 7.20.0-dev.4,7.21-dev → 7.21.0-dev.16,7.22-dev → 7.22.0-dev.2,0.22-dev → 7.22.0-dev.16,0.23-dev → 7.23.0-dev.10。

关于 @dashevo/wallet-lib 的常见问题

@dashevo/wallet-lib 是什么?

Light wallet library for 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 和提交记录判断。