@envio-dev/hypersync-client

中文文档
1.5.0发布于 2026/10/30MITTypeScriptCommonJS零依赖构建来源已验证近 30 天下载 4.3万

HyperSync Client by Envio

原始使用文档
文档目录10 节
  1. What is HyperSync?
  2. Features
  3. Installation
  4. API Token
  5. Quick Start
  6. Connecting to Different Networks
  7. What you can build
  8. Documentation
  9. FAQ
  10. Support

hypersync-client-node

npm npm downloads Discord

Node.js client for Envio's HyperSync. TypeScript-first, built on top of the Rust implementation via NAPI bindings for high-performance blockchain data access.

What is HyperSync?

HyperSync is Envio's high-performance blockchain data retrieval layer. It is a purpose-built alternative to JSON-RPC endpoints, offering up to 2000x faster data access across 70+ EVM-compatible networks and Fuel.

HyperSync lets you query logs, transactions, blocks, and traces with flexible filtering and field selection, returning only the data you need.

If you need a full indexing framework on top of HyperSync with GraphQL APIs and schema management, see HyperIndex.

Features

  • TypeScript-first: Full TypeScript types and IntelliSense support
  • High performance: Built on a Rust core via NAPI bindings
  • Binary transport: Optimized serialization to minimize bandwidth and maximize throughput
  • Flexible queries: Filter logs, transactions, blocks, and traces
  • Field selection: Choose exactly which fields to return
  • Preset queries: Built-in helpers for common query patterns
  • Parquet export: Stream data directly to Parquet files
  • Streaming: Process large datasets without loading everything into memory
  • 70+ networks: Access any HyperSync-supported network

Installation

# npm
npm install @envio-dev/hypersync-client

# pnpm
pnpm add @envio-dev/hypersync-client

# yarn
yarn add @envio-dev/hypersync-client

API Token

An API token is required to use HyperSync. Get your token here, then set it as an environment variable:

export ENVIO_API_TOKEN="your-token-here"

Quick Start

Fetch Transfer event logs from a USDT contract on Ethereum:

import { HypersyncClient, presetQueryLogsOfEvent } from "@envio-dev/hypersync-client";

async function main() {
  const client = new HypersyncClient({
    url: "https://eth.hypersync.xyz",
    apiToken: process.env.ENVIO_API_TOKEN!,
  });

  const usdtContract = "0xdAC17F958D2ee523a2206206994597C13D831ec7";

  // ERC-20 Transfer event topic0
  const transferTopic = "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef";

  const query = presetQueryLogsOfEvent(usdtContract, transferTopic, 17_000_000, 17_000_050);

  const res = await client.get(query);
  console.log(`Found ${res.data.logs.length} Transfer events`);
}

main();

See the examples directory for more patterns including block data, wallet transactions, Parquet export, and real-time streaming.

Connecting to Different Networks

Change the url to connect to any supported network:

// Arbitrum
const client = new HypersyncClient({
  url: "https://arbitrum.hypersync.xyz",
  apiToken: process.env.ENVIO_API_TOKEN!,
});

// Base
const client = new HypersyncClient({
  url: "https://base.hypersync.xyz",
  apiToken: process.env.ENVIO_API_TOKEN!,
});

See the full list of supported networks and URLs.

What you can build

The Node.js client is a natural fit for JavaScript and TypeScript applications that need fast, direct access to blockchain data:

  • Real-time event monitoring: Stream block heights and query events as they land, like this Polymarket trade tracker built with the Node.js client
  • Blockchain data analytics: Scan entire chain histories in seconds, not hours
  • ETL pipelines: Extract on-chain data and export to Parquet for downstream processing
  • Block explorers: Power responsive interfaces with comprehensive real-time data access
  • DeFi dashboards: Query protocol events, pool data, and token transfers at scale
  • Cross-chain applications: Query unified data across 70+ EVM chains from a single client

Documentation

FAQ

How does this compare to ethers.js or viem for data fetching? HyperSync retrieves data up to 2000x faster than traditional JSON-RPC. It is designed for bulk historical data access, not transaction signing or contract writes. Use HyperSync alongside ethers.js or viem for read-heavy applications.

Do I need an API token? Yes. Get one here.

Which networks are supported? 70+ EVM-compatible networks and Fuel. See the full list.

Can I export data to Parquet? Yes. See examples/parquet-out for an example of streaming data to a Parquet file.

Does this work with Deno or Bun? The package targets Node.js via NAPI bindings. Bun is broadly compatible with Node.js native modules. Deno compatibility may vary.

How is this different from the Rust client? This client is built on top of the Rust client via NAPI bindings. It provides a TypeScript-first interface for JavaScript/Node.js developers. If you need the lowest-level access with the least overhead, use the Rust client directly.

What is the difference between HyperSync and HyperIndex? HyperSync is the raw data access layer. Use it when you need direct access to blockchain data in your own pipeline. HyperIndex is the full indexing framework built on top of HyperSync, with schema management, event handlers, and a GraphQL API.

Support

版本与发布记录

@envio-dev/hypersync-client 共发布 53 个版本,首次发布于 2023/11/29;过去 12 个月发布了 12 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
1.5.0latest2026/10/3014 天前
1.4.12026/09/082 个月前
1.4.02026/06/085 个月前
1.3.02026/03/277 个月前
1.2.02026/03/277 个月前
1.1.02026/02/258 个月前

关于 @envio-dev/hypersync-client 的常见问题

@envio-dev/hypersync-client 是什么?

HyperSync Client by Envio

如何安装 @envio-dev/hypersync-client?

在项目目录运行 npm install @envio-dev/hypersync-client,或使用 pnpm add / yarn add / bun add。

@envio-dev/hypersync-client 支持 TypeScript 吗?

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

@envio-dev/hypersync-client 支持 ESM 还是 CommonJS?

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

@envio-dev/hypersync-client 需要什么版本的 Node.js?

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

@envio-dev/hypersync-client 可以商用吗?

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

@envio-dev/hypersync-client 的下载量有多少?

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

@envio-dev/hypersync-client 还在维护吗?

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