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

koishi-plugin-wallet

v0.1.6

Published

Wallet, red packet, ranking and bank plugin for Koishi

Readme

koishi-plugin-wallet

积分钱包、红包、排行与银行插件。

功能

  • 💰 积分钱包 — 查询、设置、增加、扣除积分
  • 🔄 积分转移 — 用户之间互相转账
  • 🏦 银行系统 — 存取款与每日复利计息
  • 🧧 红包系统 — 发放与领取随机积分红包
  • 🏆 排行榜 — 群内/全局排行,支持图片渲染

安装

npm install koishi-plugin-wallet

然后在 Koishi 控制台中启用插件。

依赖服务

| 服务 | 必需 | 说明 | | --- | --- | --- | | database | ✅ | 数据库服务 | | monetary | ❌ | Koishi 原生经济服务,用于统一积分管理 | | monetaryBank | ❌ | 银行服务 | | puppeteer | ❌ | 用于生成排行榜图片 |

配置项

| 配置项 | 类型 | 默认值 | 说明 | | --- | --- | --- | --- | | currencyName | string | 积分 | 货币显示名称 | | currency | string | default | 货币标识(与 monetary 服务对应) | | initialBalance | number | 0 | 新用户初始积分余额 | | initialBank | number | 0 | 新用户初始银行余额 | | interestRate | number | 0 | 银行日利率(如 0.01 表示 1%) | | redPacketExpireMinutes | number | 1440 | 红包过期时间(分钟) | | rankAsImage | boolean | true | 启用 puppeteer 时以图片发送排行榜 | | rankDisplayCount | number | 10 | 默认显示排行数量(1–50) |

指令

wallet

查询自己的积分余额。

wallet

wallet.balance

查询指定用户的积分余额。

wallet.balance @某人
wallet.balance qq=123456

wallet.set

设置用户的积分(需要权限等级 4)。

wallet.set @某人 1000

wallet.add

增加用户的积分(需要权限等级 4)。

wallet.add @某人 500

wallet.sub

扣除用户的积分(需要权限等级 4)。

wallet.sub @某人 200

wallet.transfer

将积分转移给其他用户。

wallet.transfer @某人 100

wallet.rank

查看本群积分排行榜。

wallet.rank
wallet.rank 20

wallet.rank.group

查看本群积分排行榜(同 wallet.rank)。

wallet.rank.group 10

wallet.rank.global

查看全局积分排行榜。

wallet.rank.global
wallet.rank.global 20

wallet.bank

银行存取款操作。

wallet.bank                    # 查看银行与积分余额
wallet.bank deposit 100        # 存入 100 积分
wallet.bank withdraw 50        # 取出 50 积分
wallet.bank 存入 100           # 也支持中文操作
wallet.bank 取出 50

当配置了 interestRate 时,银行余额会按日计算复利,在用户访问银行时自动结算。

wallet.redpacket

发放积分红包。

wallet.redpacket 100 5         # 发放总额 100 积分,分为 5 份

wallet.claim

领取积分红包。

wallet.claim abc12345          # 领取指定 ID 的红包

红包过期时间由 redPacketExpireMinutes 配置项控制,默认 24 小时。每人只能领取一次,金额随机分配。

数据表

插件会创建以下数据表:

  • wallet_redpacket — 红包记录
  • wallet_rank_profile — 排行榜用户资料缓存

同时会扩展 user 表,新增 walletbankbankUpdatedAt 字段。

许可证

MIT