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.
Requirements & limits
The public GitHub repository identifies the project as open source under GPL-3.0.
- The library complements
@graphprotocol/graph-tsrather than replacing the subgraph development workflow. - Using counters and accumulators requires appending the toolkit's
schema.graphqlcontent 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.
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
Install the package with
yarn add @protofire/subgraph-toolkit --exact.Import the needed exports from
@protofire/subgraph-toolkitin 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.
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

