OpenViSTAI · Agents · Blockchain · Crypto
Menu
Developer Tools

Subgraph Toolkit

Subgraph Toolkit is a TypeScript library that extends `@graphprotocol/graph-ts` with reusable helpers for The Graph Protocol subgraphs, including type conversions, constants, numeric operations, hex-string utilities, counters and accumulators.

Independent OpenViST project profile, based on linked sources.

Subgraph Toolkit — OpenViST project profile in Developer Tools.
OpenViST project illustration. See the linked sources for product details.
Understand the project

Practical overview

When it fits

Use it while developing a The Graph subgraph when mapping code needs the documented TypeScript helpers or when the metrics module's counters and accumulators fit the project.

Who it is for

  • Developers writing TypeScript mappings for The Graph Protocol subgraphs.
  • Teams seeking reusable helpers for conversions, numeric operations or subgraph metrics.

Documented uses

  • Convert between bytes, addresses, integers and decimals in mapping code.
  • Use shared constants for addresses, hashes and numeric units.
  • Compare or increment and decrement BigInt and BigDecimal values.
  • Add counters and accumulators to a subgraph metrics workflow.
Before you choose

Requirements & limits

The public GitHub repository identifies the project as open source under GPL-3.0.

  • The library complements @graphprotocol/graph-ts rather than replacing the subgraph development workflow.
  • Using counters and accumulators requires appending the toolkit's schema.graphql content to the subgraph schema.
  • The README recommends pinning an exact package version because early-version APIs may change without notice.
  • The README marks aggregated-data helpers as work in progress and token-manipulation utilities as incomplete.

Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.

Source-based practical guide

Add the toolkit to a subgraph project

Install the package and import its helpers into a TypeScript subgraph mapping.

Before you start

  • A project that builds subgraphs for The Graph Protocol
  • Yarn

Steps

  1. Install the package with yarn add @protofire/subgraph-toolkit --exact.

  2. Import the needed exports from @protofire/subgraph-toolkit in a TypeScript mapping.

Expected outcome

The mapping can reference the toolkit's imported utilities and constants.

Guide limitations

  • The guide covers installation and imports, not building or deploying a subgraph.
  • The README recommends installing a specific version because early-version APIs may change without notice.
Evidence and transparency

Sources & review

Source record details
Source availability
Active
Sources checked
13 October 2026
Original website title
protofire/subgraph-toolkit · Official homepage title · retained in its source language