npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@frankd6eaf/hardhat-accounts

v1.1.8

Published

list signer accounts

Downloads

2

Readme

Hardhat Accounts Task

一个用于列出 Hardhat 网络账户信息的任务包。

功能特性

  • 🔍 账户列表:显示当前网络的所有账户地址
  • 🔐 私钥显示:可选择显示账户的私钥信息
  • 🌈 彩色输出:使用 kleur 提供美观的彩色输出
  • 📊 网络信息:显示当前网络名称和链 ID
  • 快速执行:轻量级任务,执行速度快

安装

npm install @frankd6eaf/hardhat-accounts

使用方法

在你的 Hardhat 项目中:

import '@frankd6eaf/hardhat-accounts';

// 任务会自动注册,可以直接使用
npx hardhat accounts [options]

参数

  • --pk (可选): 显示账户私钥,默认为 false

示例

基本使用(只显示地址)

# 显示所有账户地址
npx hardhat accounts

# 输出示例:
# Start task accounts
# hardhat
# 31337
# 0 0x1234567890123456789012345678901234567890
# 1 0x2345678901234567890123456789012345678901
# 2 0x3456789012345678901234567890123456789012

显示私钥

# 显示所有账户地址和私钥
npx hardhat accounts --pk

# 输出示例:
# Start task accounts
# hardhat
# 31337
# 0 0x1234567890123456789012345678901234567890 0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890
# 1 0x2345678901234567890123456789012345678901 0xbcdef1234567890abcdef1234567890abcdef1234567890abcdef12345678901
# 2 0x3456789012345678901234567890123456789012 0xcdef1234567890abcdef1234567890abcdef1234567890abcdef123456789012

在不同网络中使用

Hardhat 网络

# 在 Hardhat 网络上运行
npx hardhat accounts

本地网络

# 在本地网络上运行
npx hardhat accounts --network localhost

测试网络

# 在测试网络上运行
npx hardhat accounts --network goerli

开发

安装依赖

npm install

构建

npm run build

测试

# 运行测试
npm test

# 运行覆盖率测试
npm run test:coverage

代码检查

# 运行 ESLint
npm run lint

# 格式化代码
npm run format

# 检查格式化
npm run format:check

清理

npm run clean

技术细节

依赖项

  • hardhat: ^2.0.0
  • @nomicfoundation/hardhat-ethers: ^3.1.0
  • kleur: 用于彩色输出

输出格式

  • 绿色: 任务开始消息
  • 青色: 账户地址
  • 黄色背景: 私钥(当使用 --pk 标志时)

错误处理

  • 自动处理网络连接错误
  • 优雅处理账户获取失败
  • 提供清晰的错误信息

测试覆盖率

项目维护高测试覆盖率:

  • ✅ 分支覆盖率: 100%
  • ✅ 函数覆盖率: 100%
  • ✅ 行覆盖率: 100%
  • ✅ 语句覆盖率: 100%

贡献

欢迎提交 Issue 和 Pull Request!

许可证

MIT