@coinbase/onchainkit

中文文档
1.1.3发布于 2026/09/22MITTypeScriptES Module构建来源已验证近 30 天下载 6万
此软件包已被标记为弃用

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

原始使用文档
文档目录12 节
  1. 🚀 Quickstart
  2. ✨ Documentation
  3. 🛠️ Contributing
  4. Overview
  5. Requirements
  6. Getting Started
  7. Running packages
  8. Shorthands
  9. Development
  10. 🌁 Team and Community
  11. 💫 Contributors
  12. 🌊 License

OnchainKit logo vibes

OnchainKit

React components and TypeScript utilities to help you build top-tier onchain apps.

Version last update Downloads per month Code coverage MIT License

Follow @OnchainKit Chat on Discord stars forks


🚀 Quickstart

Run npm create onchain to bootstrap an example onchain app with all the batteries included.

✨ Documentation

For documentation and guides, visit onchainkit.xyz.

🛠️ Contributing

Overview

This project is set up as a monorepo with pnpm workspaces.

Requirements

  • Node.js v18
  • pnpm v10

Getting Started

  1. Clone the repository
git clone https://github.com/coinbase/onchainkit.git
  1. Install dependencies
pnpm install

Running packages

To run a script in a single package, use the following command:

pnpm [-F | --filter] <package-name> <script-name>

To run a script in all packages, use the following command:

pnpm run <script-name>

Shorthands

We provide shorthands to filter by project in the root package.json.

The following shorthands are available:

  • pnpm f:ock: pnpm --filter @coinbase/onchainkit
  • pnpm f:play: pnpm --filter playground
  • pnpm f:create: pnpm --filter create-onchain
  • pnpm f:manifest: pnpm --filter miniapp-manifest-generator

Development

When working on components, you can build OnchainKit in watch mode and start the playground to view your components with the following command:

pnpm f:play dev:watch

Then, you can view the playground at http://localhost:3000.

🌁 Team and Community

💫 Contributors

🌊 License

This project is licensed under the MIT License - see the LICENSE.md file for details

版本与发布记录

@coinbase/onchainkit 共发布 440 个版本,首次发布于 2023/12/14;过去 12 个月发布了 3 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
1.1.3latest2026/09/221 个月前
1.1.2-canary.2canary2025/12/0811 个月前
1.1.2-canary.12025/11/2511 个月前
1.1.22025/10/281 年前
1.1.2-canary.02025/10/281 年前
1.1.1-canary.32025/10/251 年前

其他发布通道:play → 0.10.2-play.20240312T210704,alpha → 1.1.1-alpha.5,canary → 1.1.2-canary.2。

关于 @coinbase/onchainkit 的常见问题

如何安装 @coinbase/onchainkit?

在项目目录运行 npm install @coinbase/onchainkit,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:viem(^2.27)、react(^19)、wagmi(^2.16)、react-dom(^19)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@coinbase/onchainkit 支持 TypeScript 吗?

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

@coinbase/onchainkit 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@coinbase/onchainkit 可以商用吗?

@coinbase/onchainkit 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@coinbase/onchainkit 的下载量有多少?

根据 npm 官方下载统计,@coinbase/onchainkit 在 2026/10/11 – 2026/11/09 这 30 天内被下载 59,521 次,日均约 1,984 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@coinbase/onchainkit 还在维护吗?

最新版本 1.1.3 发布于 2026/09/22(1 个月前);至今共发布 440 个版本,其中过去 12 个月发布了 3 个;首次发布于 2023/12/14。作者已将其标记为弃用,新项目建议寻找替代方案。