@biconomy/abstractjs

中文文档
2.0.2发布于 2026/09/02MITTypeScriptES Module零依赖近 30 天下载 5.3万

SDK for Biconomy integration with support for account abstraction, smart accounts, ERC-4337.

原始使用文档
文档目录7 节
  1. 📚 Table of Contents
  2. 🛠️ Quickstart
  3. Installation
  4. Testing
  5. 📄 Documentation and Resources
  6. License
  7. Connect with Biconomy 🍊

Biconomy Build License MIT codecov install size

abstractjs 🚀

Open in GitHub Codespaces

The Biconomy SDK is your all-in-one toolkit for building decentralized applications (dApps) with ERC4337 Account Abstraction and Smart Accounts. It is designed for seamless user experiences and offers non-custodial solutions for user onboarding, sending transactions (userOps), gas sponsorship and much more.

📚 Table of Contents

🛠️ Quickstart

Installation

  1. Add the package:
bun add @biconomy/abstractjs viem @rhinestone/module-sdk
  1. Basic Usage:
import { 
  toMultichainNexusAccount, 
  mcUSDC, 
  createMeeClient, 
  getMEEVersion, 
  MEEVersion 
} from "@biconomy/abstractjs";
import { base, optimism } from "viem/chains";
import { privateKeyToAccount } from "viem/accounts";
import { http } from "viem";

const eoaAccount = privateKeyToAccount(`0x${process.env.PRIVATE_KEY}`)
const mcNexus = await toMultichainNexusAccount({
  signer: eoaAccount,
  chainConfigurations: [
    {
      chain: base,
      transport: http(),
      version: getMEEVersion(MEEVersion.V2_1_0)
    },
    {
      chain: optimism,
      transport: http(),
      version: getMEEVersion(MEEVersion.V2_1_0)
    }
  ]
})

const meeClient = await createMeeClient({ account: mcNexus })

const quote = await meeClient.getQuote({
  instructions: [{
    calls: [{ to: "0x...", value: 1n, gasLimit: 100000n }],
    chainId: base.id
  }],
  feeToken: {
    address: mcUSDC.addressOn(base.id),
    chainId: base.id
  }
})

// Execute the quote and get back a transaction hash
// This sends the transaction to the network
const { hash } = await meeClient.executeQuote({ quote })

Testing

Prerequisites:

  • Node.js (v22 or higher)
  • Bun package manager
  • Foundry
  • Yarn (must be 1.1.x, not 3.x). This is necessary because the nexus contracts repo relies on yarn.

Setup:

bun install --frozen-lockfile

Funding test accounts:

# Fund test nexus accounts with native tokens and USDC, using a funded PRIVATE_KEY master account
bun run fund:nexus

Running Tests:

# Run all tests
bun run test

# Run tests in watch mode for a specific subset of tests (by test description)
bun run test:watch -t=mee

For detailed information about the testing framework, network configurations, and debugging guidelines, please refer to our Testing Documentation.

📄 Documentation and Resources

For a comprehensive understanding of our project and to contribute effectively, please refer to the following resources:

License

This project is licensed under the MIT License. See the LICENSE file for details

Connect with Biconomy 🍊

Website Telegram Twitter LinkedIn Discord YouTube GitHub

版本与发布记录

@biconomy/abstractjs 共发布 69 个版本,首次发布于 2025/01/20;过去 12 个月发布了 14 个版本。

版本发布日期距今
2.0.2latest2026/09/022 个月前
2.0.12026/09/012 个月前
2.0.02026/08/073 个月前
1.2.52026/07/103 个月前
1.2.42026/05/225 个月前
1.2.32026/03/217 个月前

关于 @biconomy/abstractjs 的常见问题

@biconomy/abstractjs 是什么?

SDK for Biconomy integration with support for account abstraction, smart accounts, ERC-4337.

如何安装 @biconomy/abstractjs?

在项目目录运行 npm install @biconomy/abstractjs,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:@safe-global/types-kit(3.0.0)、@noble/curves(2.0.1)、@openzeppelin/merkle-tree(1.0.8)、@metamask/delegation-toolkit(^0.11.0)、@rhinestone/module-sdk(0.4.0)、typescript(^5.8.2)、viem(^2.26.2)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@biconomy/abstractjs 支持 TypeScript 吗?

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

@biconomy/abstractjs 支持 ESM 还是 CommonJS?

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

@biconomy/abstractjs 可以商用吗?

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

@biconomy/abstractjs 的下载量有多少?

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

@biconomy/abstractjs 还在维护吗?

最新版本 2.0.2 发布于 2026/09/02(2 个月前);至今共发布 69 个版本,其中过去 12 个月发布了 14 个;首次发布于 2025/01/20。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。