@babylonlabs-io/btc-staking-ts

中文文档
2.8.6发布于 2025/11/26SEE LICENSE IN LICENSETypeScriptESM + CJS近 30 天下载 27.5万

Library exposing methods for the creation and consumption of Bitcoin transactions pertaining to Babylon's Bitcoin Staking protocol.

原始使用文档
文档目录7 节
  1. @babylonlabs-io/btc-staking-ts
  2. 👨🏻‍💻 Installation
  3. 📝 Commit Format & Automated Releases
  4. ✅ How It Works
  5. 🧱 Commit Message Examples
  6. 🚀 Releasing
  7. 📢 Usage Guide

Babylon Logo

@babylonlabs-io/btc-staking-ts

Babylon Bitcoin Staking Protocol

TypeScript library

npm version


👨🏻‍💻 Installation

npm i @babylonlabs-io/btc-staking-ts

📝 Commit Format & Automated Releases

This project uses Conventional Commits and semantic-release to automate versioning, changelog generation, and npm publishing. However, release branch will be cut wiht the syntax of release/vY.X whenever there is a major version bump.

✅ How It Works

  1. All commits must follow the Conventional Commits format.
  2. When changes are merged into the main branch:
    • semantic-release analyzes commit messages
    • Determines the appropriate semantic version bump (major, minor, patch)
    • Updates the CHANGELOG.md
    • Tags the release in Git
    • Publishes the new version to npm (if configured)

🧱 Commit Message Examples

feat: add support for slashing script
fix: handle invalid staking tx gracefully
docs: update README with commit conventions
refactor!: remove deprecated method and cleanup types

Note: For breaking changes, add a ! after the type ( e.g. feat!: or refactor!:) and include a description of the breaking change in the commit body.

🚀 Releasing

Just commit your changes using the proper format and merge to main. The CI pipeline will handle versioning and releasing automatically — no manual tagging or version bumps needed.

📢 Usage Guide

Details on the usage of the library can be found on the usage guide.

版本与发布记录

@babylonlabs-io/btc-staking-ts 共发布 76 个版本,首次发布于 2024/08/21;过去 12 个月发布了 10 个版本。

版本发布日期距今
2.8.6latest2025/11/2611 个月前
2.8.52025/11/2511 个月前
2.8.42025/11/1911 个月前
2.8.32025/11/1811 个月前
2.8.22025/11/1411 个月前
2.8.12025/11/1411 个月前

其他发布通道:canary → 0.4.0-canary.17。

关于 @babylonlabs-io/btc-staking-ts 的常见问题

@babylonlabs-io/btc-staking-ts 是什么?

Library exposing methods for the creation and consumption of Bitcoin transactions pertaining to Babylon's Bitcoin Staking protocol.

如何安装 @babylonlabs-io/btc-staking-ts?

在项目目录运行 npm install @babylonlabs-io/btc-staking-ts,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:bitcoinjs-lib(6.1.7)、@babylonlabs-io/babylon-proto-ts(1.22.1)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@babylonlabs-io/btc-staking-ts 支持 TypeScript 吗?

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

@babylonlabs-io/btc-staking-ts 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@babylonlabs-io/btc-staking-ts 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=22.0.0 <25.0.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@babylonlabs-io/btc-staking-ts 可以商用吗?

@babylonlabs-io/btc-staking-ts 使用 SEE LICENSE IN LICENSE 许可。许可条款写在包内的独立文件中,请阅读该文件确认可否商用。以上为概括,不构成法律意见,请以许可原文为准。

@babylonlabs-io/btc-staking-ts 的下载量有多少?

根据 npm 官方下载统计,@babylonlabs-io/btc-staking-ts 在 2026/10/08 – 2026/11/06 这 30 天内被下载 274,776 次,日均约 9,159 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@babylonlabs-io/btc-staking-ts 还在维护吗?

最新版本 2.8.6 发布于 2025/11/26(11 个月前);至今共发布 76 个版本,其中过去 12 个月发布了 10 个;首次发布于 2024/08/21。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。