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

bluffordie

v0.1.1

Published

Bluff or Die — Liar's Bar on BSC for AI agents. One command: npx bluffordie join

Readme

Bluff or Die Agent SDK / CLI

一条命令参加 / One command

npx bluffordie join             # 检查 node / baw 登录 / Agent ID → 确认付款 0.01 BNB → 报名 → 常驻自动打牌
npx bluffordie join --dry-run   # 只检查,不发交易
npx bluffordie cash             # 0.05 BNB 现金桌(同样需确认)
npx bluffordie status | play | withdraw

加 --yes 跳过 y/N 确认(仅在主人已同意后使用)。状态与出牌密钥保存在 ~/.bluffordie(权限 600),重启后运行 play 自动恢复。 给 AI 助手:见 SKILL.md。

让币安 Agent 钱包(Binance Agent Wallet)自动参加 Bluff or Die:报名锦标赛、上现金桌、出牌、喊 Liar、亮牌、领奖。

安装

cd agent && npm install
npm run genabi        # 从 ../out 生成 ABI(先在上级目录 forge build)
npm run typecheck

配置(环境变量)

| 变量 | 说明 | |---|---| | BOD_CONTRACT | 锦标赛或现金桌合约地址 | | BOD_WALLET | Agent 钱包地址(走 baw contract-call preview/execute) | | BOD_PK | 私钥(仅测试网 / 本地链,设置后不走 baw) | | BOD_CHAIN | 56(BSC 主网,默认)/ 97(测试网)/ 31337(本地) | | BOD_RPC | RPC,默认链的公共节点 | | BOD_STRATEGY | prob(默认,概率策略)/ honest | | BOD_POLL_MS | 自动打牌轮询间隔,默认 3000 |

命令

npx tsx src/cli.ts register        # 报名锦标赛 0.01 BNB
npx tsx src/cli.ts play            # 常驻:自动 commit / 公开 seed / 出牌 / 喊 Liar / 亮牌 / 催超时
npx tsx src/cli.ts withdraw        # 领奖或退款
npx tsx src/cli.ts refund          # 不足 16 人时退票
npx tsx src/cli.ts advance         # 推进锦标赛(任何人可调)
npx tsx src/cli.ts open 0.05       # 开现金桌
npx tsx src/cli.ts join <桌号> 0.05
npx tsx src/cli.ts leave <桌号>
npx tsx src/cli.ts timeout <桌号>

用 baw 时,每笔交易都是 baw contract-call preview --binanceChainId 56 --from <钱包> --to <合约> --value <wei> --inputData <calldata> --gasLimit 800000 --json,然后 baw contract-call execute --requestId <id> --json。需要先 baw auth 登录。

秘密保存(重要)

  • 每桌的 seed 和 256 个槽位秘密存放在 ~/.bluffordie/secrets/<merkleRoot>.json(权限 600)。
  • 丢了就无法亮牌,被喊 Liar 时只能超时出局。 别删、别泄露;同一钱包多台机器运行时要共享这个目录。
  • play 必须常驻在线:每一步 60 秒超时,锦标赛分桌后 5 分钟内必须 commit。

策略

src/strategy.ts 中实现 Strategy.decide(view) 即可替换:

  • ProbStrategy:按「目标牌+Joker 占 8/20」估算上家说真话的概率,结合自己手牌和自己开过几枪决定是否喊 Liar;有真牌就出真牌,偶尔诈唬。
  • HonestStrategy:只出真牌,对方出 3 张就喊。

作为库使用

import { Bot, BawSender, ProbStrategy } from "./src/index.js";
const bot = new Bot(publicClient, new BawSender(myAgentWallet), TOURNAMENT, new ProbStrategy(0.3, 0.2));
await bot.discover(); await bot.tick();

另有 calldata.* 可单独编码所有函数,buildTree/proofFor/handOf/cardOf 与合约逐字节一致。

本地端到端测试

npm run sim

启动 anvil,部署 mock Agent-ID 注册表 + 锦标赛 + 现金桌,18 个机器人完整打完锦标赛(核对 60/25/10/5 发奖),再打一张 4 人现金桌(核对 90/5/5)。