@fireblocks/fireblocks-web3-provider

中文文档
1.5.1发布于 2026/11/12MITTypeScriptCommonJS构建来源已验证近 30 天下载 9.1万

EIP-1193 Compatible Ethereum provider for Fireblocks

原始使用文档
文档目录8 节
  1. Installation
  2. Setup
  3. RPC endpoints
  4. Usage with ethers.js
  5. Usage with web3.js
  6. API Documentation
  7. new FireblocksWeb3Provider(config)
  8. FireblocksProviderConfig

accessibility text

Fireblocks Web3 Provider

Fireblocks EIP-1193 Compatible Ethereum JavaScript Provider

Installation

npm install @fireblocks/fireblocks-web3-provider

Setup

import { FireblocksWeb3Provider, ChainId, ApiBaseUrl } from "@fireblocks/fireblocks-web3-provider";

const eip1193Provider = new FireblocksWeb3Provider({
    // apiBaseUrl: ApiBaseUrl.Sandbox // If using a sandbox workspace
    privateKey: process.env.FIREBLOCKS_API_PRIVATE_KEY_PATH,
    apiKey: process.env.FIREBLOCKS_API_KEY,
    vaultAccountIds: process.env.FIREBLOCKS_VAULT_ACCOUNT_IDS,
    chainId: ChainId.GOERLI,

    logTransactionStatusChanges: true, // Verbose logging
})

RPC endpoints

When only chainId is given, the provider uses a built-in public RPC endpoint for that chain.

Public endpoints are rate-limited and have no uptime guarantee. For production, pass your own rpcUrl from a node provider. A provided rpcUrl replaces the built-in endpoint.

Usage with ethers.js

npm install ethers
import * as ethers from "ethers"

const provider = new ethers.BrowserProvider(eip1193Provider); 

// Or like this if you're using ethers v5:
// const provider = new ethers.providers.Web3Provider(eip1193Provider); 

Usage with web3.js

npm install web3
import Web3 from "web3";

const web3 = new Web3(eip1193Provider);

API Documentation

new FireblocksWeb3Provider(config)

This class is an EIP-1193 Compatible Ethereum JavaScript Provider powered by the Fireblocks API

FireblocksProviderConfig

type FireblocksProviderConfig = {
  // ------------- Mandatory fields -------------
  /** 
   * Learn more about creating API users here: 
   * https://developers.fireblocks.com/docs/quickstart#api-user-creation
   */

  /** 
   * Fireblocks API key
   */
  apiKey: string,

  /** 
   * Fireblocks API private key for signing requests
   */
  privateKey: string,

  // Either chainId or rpcUrl must be provided
  /** 
   * If not provided, it is inferred from the rpcUrl 
   */
  chainId?: ChainId,
  /** 
   * If not provided, it is inferred from the chainId 
   */
  rpcUrl?: string,

  // ------------- Optional fields --------------

  /** 
   * By default, the first 20 vault accounts are dynamically loaded from the Fireblocks API
   * It is recommended to provide the vault account ids explicitly because it helps avoid unnecessary API calls
   */
  vaultAccountIds?: number | number[] | string | string[],
  /** 
   * By default, it uses the Fireblocks API production endpoint
   * When using a sandbox workspace, you should provide the ApiBaseUrl.Sandbox value
   */
  apiBaseUrl?: ApiBaseUrl | string,
  /**
   * By default, the fallback fee level is set to FeeLevel.MEDIUM
   */
  fallbackFeeLevel?: FeeLevel,
  /**
   * By default, the note is set to "Created by Fireblocks Web3 Provider"
   */
  note?: string,
  /**
   * By default, the polling interval is set to 1000ms (1 second)
   * It is the interval in which the Fireblocks API is queried to check the status of transactions
   */
  pollingInterval?: number,
  /**
   * By default, it is assumed that one time addresses are enabled in your workspace
   * If they're not, set this to false
   */
  oneTimeAddressesEnabled?: boolean,
  /**
   * By default, no externalTxId is associated with transactions
   * If you want to set one, you can either provide a function that returns a string, or provide a string directly
   */
  externalTxId?: (() => string) | string,
  /**
   * If you want to prepend an additional product string to the User-Agent header, you can provide it here
   */
  userAgent?: string,
  /**
   * If you are using a private/custom EVM chain, you can provide its Fireblocks assetId here
   */
  assetId?: string,
  /**
   * Default: false
   * By setting to true, every transaction status change will be logged to the console
   * Same as setting env var `DEBUG=fireblocks-web3-provider:status`
   */
  logTransactionStatusChanges?: boolean,
  /**
   * Default: false
   * By setting to true, every request and response processed by the provider will be logged to the console
   * Same as setting env var `DEBUG=fireblocks-web3-provider:req_res`
   */
  logRequestsAndResponses?: boolean,
  /**
   * Default: true
   * By setting to true, every failed transaction will print additional information
   * helpful for debugging, such as a link to simulate the transaction on Tenderly
   * Same as setting env var `DEBUG=fireblocks-web3-provider:error`
   */
  enhancedErrorHandling?: boolean,
  /**
   * Proxy path in the format of `http(s)://user:pass@server`
   */
  proxyPath?: string
}

版本与发布记录

@fireblocks/fireblocks-web3-provider 共发布 49 个版本,首次发布于 2022/08/06;过去 12 个月发布了 4 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
1.5.1latest2026/11/122 天前
1.5.02026/08/252 个月前
1.4.02026/06/025 个月前
1.3.192025/12/0311 个月前
1.3.182025/09/101.2 年前
1.3.172025/05/141.5 年前

关于 @fireblocks/fireblocks-web3-provider 的常见问题

@fireblocks/fireblocks-web3-provider 是什么?

EIP-1193 Compatible Ethereum provider for Fireblocks

如何安装 @fireblocks/fireblocks-web3-provider?

在项目目录运行 npm install @fireblocks/fireblocks-web3-provider,或使用 pnpm add / yarn add / bun add。

@fireblocks/fireblocks-web3-provider 支持 TypeScript 吗?

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

@fireblocks/fireblocks-web3-provider 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@fireblocks/fireblocks-web3-provider 可以商用吗?

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

@fireblocks/fireblocks-web3-provider 的下载量有多少?

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

@fireblocks/fireblocks-web3-provider 还在维护吗?

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