envio 3.15.0-subgraph → 3.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (186) hide show
  1. package/README.md +40 -34
  2. package/evm.schema.json +3 -3
  3. package/fuel.schema.json +2 -2
  4. package/index.d.ts +3 -3
  5. package/licenses/README.md +1 -1
  6. package/package.json +9 -10
  7. package/src/Batch.res.mjs +5 -5
  8. package/src/BatchProcessing.res +1 -0
  9. package/src/BatchProcessing.res.mjs +1 -0
  10. package/src/Bin.res +0 -7
  11. package/src/Bin.res.mjs +0 -8
  12. package/src/ChainFetching.res +17 -456
  13. package/src/ChainFetching.res.mjs +33 -404
  14. package/src/ChainState.res +48 -83
  15. package/src/ChainState.res.mjs +83 -115
  16. package/src/ChainState.resi +0 -26
  17. package/src/Clock.res +57 -0
  18. package/src/Clock.res.mjs +72 -0
  19. package/src/Config.res +7 -16
  20. package/src/Config.res.mjs +4 -11
  21. package/src/ContractRegisterContext.res +6 -3
  22. package/src/ContractRegisterContext.res.mjs +2 -4
  23. package/src/Core.res +5 -136
  24. package/src/Core.res.mjs +1 -90
  25. package/src/CrossChainState.res +2 -8
  26. package/src/CrossChainState.res.mjs +3 -3
  27. package/src/Ecosystem.res +4 -7
  28. package/src/Ecosystem.res.mjs +8 -8
  29. package/src/EffectState.res +10 -2
  30. package/src/EffectState.res.mjs +8 -4
  31. package/src/EffectState.resi +3 -1
  32. package/src/EntityId.res +2 -7
  33. package/src/EntityId.res.mjs +1 -8
  34. package/src/EntityTables.res +4 -1
  35. package/src/EntityTables.res.mjs +1 -1
  36. package/src/Env.res +0 -16
  37. package/src/Env.res.mjs +0 -11
  38. package/src/EventProcessing.res +1 -38
  39. package/src/EventProcessing.res.mjs +1 -28
  40. package/src/FetchState.res +160 -319
  41. package/src/FetchState.res.mjs +182 -292
  42. package/src/FinalizeBackfill.res +2 -4
  43. package/src/FinalizeBackfill.res.mjs +3 -4
  44. package/src/HandlerLoader.res +15 -39
  45. package/src/HandlerLoader.res.mjs +8 -27
  46. package/src/HandlerRegister.res +0 -4
  47. package/src/HandlerRegister.res.mjs +2 -5
  48. package/src/HandlerRegister.resi +0 -2
  49. package/src/InMemoryTable.res +17 -16
  50. package/src/InMemoryTable.res.mjs +14 -15
  51. package/src/IndexerState.res +28 -4
  52. package/src/IndexerState.res.mjs +19 -6
  53. package/src/IndexerState.resi +4 -0
  54. package/src/Internal.res +0 -110
  55. package/src/Internal.res.mjs +1 -115
  56. package/src/LoadLayer.res +21 -47
  57. package/src/LoadLayer.res.mjs +47 -72
  58. package/src/LoadLayer.resi +0 -26
  59. package/src/Main.res +1 -14
  60. package/src/Main.res.mjs +3 -4
  61. package/src/Persistence.res +3 -23
  62. package/src/Persistence.res.mjs +3 -3
  63. package/src/Rollback.res +0 -1
  64. package/src/Rollback.res.mjs +1 -1
  65. package/src/RunScope.res +0 -3
  66. package/src/SafeCheckpointTracking.res +4 -4
  67. package/src/SafeCheckpointTracking.res.mjs +1 -1
  68. package/src/SimulateItems.res +26 -42
  69. package/src/SimulateItems.res.mjs +16 -40
  70. package/src/StagedRows.res +106 -0
  71. package/src/StagedRows.res.mjs +102 -0
  72. package/src/Staging.res +32 -14
  73. package/src/Staging.res.mjs +17 -20
  74. package/src/Storage.res +277 -998
  75. package/src/Storage.res.mjs +216 -731
  76. package/src/Supervisor.res +75 -56
  77. package/src/Supervisor.res.mjs +55 -26
  78. package/src/TestIndexer.res +22 -27
  79. package/src/TestIndexer.res.mjs +20 -17
  80. package/src/Throttler.res +15 -8
  81. package/src/Throttler.res.mjs +9 -6
  82. package/src/Throttler.resi +1 -1
  83. package/src/UserContext.res +46 -410
  84. package/src/UserContext.res.mjs +30 -318
  85. package/src/Utils.res +0 -23
  86. package/src/Utils.res.mjs +1 -17
  87. package/src/Writing.res +0 -1
  88. package/src/Writing.res.mjs +1 -1
  89. package/src/bindings/ClickHouse.res +0 -322
  90. package/src/bindings/ClickHouse.res.mjs +0 -338
  91. package/src/bindings/StorageClient.res +107 -175
  92. package/src/bindings/StorageClient.res.mjs +19 -8
  93. package/src/bindings/Vitest.res +0 -26
  94. package/src/bindings/Vitest.res.mjs +0 -3
  95. package/src/db/Table.res +24 -150
  96. package/src/db/Table.res.mjs +38 -272
  97. package/src/sources/AddressSet.res +0 -2
  98. package/src/sources/AddressStore.res +0 -3
  99. package/src/sources/ChainSources.res +2 -0
  100. package/src/sources/ChainSources.res.mjs +2 -2
  101. package/src/sources/EvmChain.res +4 -7
  102. package/src/sources/EvmChain.res.mjs +5 -4
  103. package/src/sources/EvmHyperSyncSource.res +2 -2
  104. package/src/sources/EvmHyperSyncSource.res.mjs +1 -1
  105. package/src/sources/EvmRpcClient.res +13 -3
  106. package/src/sources/EvmRpcClient.res.mjs +4 -3
  107. package/src/sources/EvmRpcWs.res +4 -3
  108. package/src/sources/EvmRpcWs.res.mjs +2 -2
  109. package/src/sources/HeightFeed.res +31 -10
  110. package/src/sources/HeightFeed.res.mjs +10 -6
  111. package/src/sources/HeightStream.res +32 -17
  112. package/src/sources/HeightStream.res.mjs +10 -10
  113. package/src/sources/HyperSync.res +1 -2
  114. package/src/sources/HyperSync.res.mjs +1 -2
  115. package/src/sources/HyperSyncSSE.res +4 -6
  116. package/src/sources/HyperSyncSSE.res.mjs +2 -2
  117. package/src/sources/RpcSource.res +10 -1
  118. package/src/sources/RpcSource.res.mjs +4 -3
  119. package/src/sources/Source.res +3 -0
  120. package/src/sources/SourceManager.res +85 -104
  121. package/src/sources/SourceManager.res.mjs +18 -37
  122. package/src/sources/SourceManager.resi +3 -5
  123. package/src/sources/StartBlockResolver.res +1 -0
  124. package/src/sources/StartBlockResolver.res.mjs +4 -3
  125. package/src/sources/SvmHyperSyncSource.res +2 -2
  126. package/src/sources/SvmHyperSyncSource.res.mjs +1 -1
  127. package/svm.schema.json +3 -3
  128. package/src/EffectCacheLookup.res +0 -98
  129. package/src/EffectCacheLookup.res.mjs +0 -116
  130. package/src/PgWriting.res +0 -36
  131. package/src/PgWriting.res.mjs +0 -34
  132. package/src/PreloadLookahead.res +0 -184
  133. package/src/PreloadLookahead.res.mjs +0 -197
  134. package/src/SubgraphLog.res +0 -19
  135. package/src/SubgraphLog.res.mjs +0 -26
  136. package/src/SyncWrites.res +0 -101
  137. package/src/SyncWrites.res.mjs +0 -98
  138. package/src/db/IndexDefinition.res +0 -47
  139. package/src/db/IndexDefinition.res.mjs +0 -60
  140. package/src/sources/CallSource.res +0 -274
  141. package/src/sources/CallSource.res.mjs +0 -196
  142. package/src/subgraph/abi-types.ts +0 -84
  143. package/src/subgraph/aggregations.ts +0 -745
  144. package/src/subgraph/as-package.ts +0 -143
  145. package/src/subgraph/assemblyscript-regex.ts +0 -67
  146. package/src/subgraph/assemblyscript.ts +0 -731
  147. package/src/subgraph/blocks.ts +0 -398
  148. package/src/subgraph/calls-source.ts +0 -702
  149. package/src/subgraph/calls.ts +0 -258
  150. package/src/subgraph/conformance.ts +0 -106
  151. package/src/subgraph/errors.ts +0 -85
  152. package/src/subgraph/graft.ts +0 -73
  153. package/src/subgraph/graph-cli-worker.mjs +0 -35
  154. package/src/subgraph/graph-cli.ts +0 -900
  155. package/src/subgraph/graph-node-decimal.ts +0 -199
  156. package/src/subgraph/graph-ts-enums.ts +0 -28
  157. package/src/subgraph/graph-ts-types/VERSION +0 -2
  158. package/src/subgraph/graph-ts-types/chain/arweave.d.ts +0 -70
  159. package/src/subgraph/graph-ts-types/chain/cosmos.d.ts +0 -327
  160. package/src/subgraph/graph-ts-types/chain/ethereum.d.ts +0 -233
  161. package/src/subgraph/graph-ts-types/chain/near.d.ts +0 -253
  162. package/src/subgraph/graph-ts-types/chain/starknet.d.ts +0 -32
  163. package/src/subgraph/graph-ts-types/common/collections.d.ts +0 -136
  164. package/src/subgraph/graph-ts-types/common/conversion.d.ts +0 -11
  165. package/src/subgraph/graph-ts-types/common/datasource.d.ts +0 -30
  166. package/src/subgraph/graph-ts-types/common/eager-offset.d.ts +0 -0
  167. package/src/subgraph/graph-ts-types/common/json.d.ts +0 -17
  168. package/src/subgraph/graph-ts-types/common/numbers.d.ts +0 -120
  169. package/src/subgraph/graph-ts-types/common/value.d.ts +0 -120
  170. package/src/subgraph/graph-ts-types/common/yaml.d.ts +0 -90
  171. package/src/subgraph/graph-ts-types/global/global.d.ts +0 -194
  172. package/src/subgraph/graph-ts-types/helper-functions.d.ts +0 -22
  173. package/src/subgraph/graph-ts-types/index.d.ts +0 -102
  174. package/src/subgraph/graph-ts.ts +0 -4280
  175. package/src/subgraph/hosts.ts +0 -554
  176. package/src/subgraph/log.ts +0 -28
  177. package/src/subgraph/receipts.ts +0 -184
  178. package/src/subgraph/register-slots.ts +0 -93
  179. package/src/subgraph/rollup.ts +0 -109
  180. package/src/subgraph/rpc.ts +0 -337
  181. package/src/subgraph/runtime.ts +0 -2060
  182. package/src/subgraph/scope.ts +0 -177
  183. package/src/subgraph/stats.ts +0 -42
  184. package/src/subgraph/template-instances.ts +0 -66
  185. package/src/subgraph/toolchain.ts +0 -327
  186. package/src/subgraph/transient.ts +0 -176
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  <div align="center">
2
- <h1>HyperIndex: Ultra-Fast Multichain Indexer</h1>
3
- <p><strong>The fastest independently benchmarked multichain blockchain indexer.</strong></p>
2
+ <h1>HyperIndex</h1>
3
+ <p><strong>Build custom blockchain APIs and analytics. Real-time, with enterprise SLAs.</strong></p>
4
4
  <p>
5
5
  <a href="https://github.com/enviodev/hyperindex/releases"><img src="https://img.shields.io/github/release/enviodev/hyperindex.svg" alt="GitHub release" /></a>
6
6
  <a href="https://github.com/enviodev/hyperindex/issues"><img src="https://img.shields.io/github/issues/enviodev/hyperindex.svg" alt="GitHub issues" /></a>
@@ -10,18 +10,20 @@
10
10
  </p>
11
11
  <p>
12
12
  <a href="https://docs.envio.dev">Documentation</a> ·
13
- <a href="https://envio.dev">Hosted Service</a> ·
13
+ <a href="https://envio.dev">Envio Cloud</a> ·
14
+ <a href="https://github.com/enviodev/open-indexer-benchmark">Benchmark</a> ·
15
+ <a href="https://docs.envio.dev/docs/HyperIndex/quickstart-with-ai">Build with AI</a> ·
14
16
  <a href="https://discord.gg/DhfFhzuJQh">Discord</a> ·
15
- <a href="https://docs.envio.dev/blog/best-blockchain-indexers-2026">Benchmarks</a>
17
+ <a href="https://envio.dev/pricing">Contact sales</a>
16
18
  </p>
17
19
  </div>
18
20
 
19
21
  ---
20
22
  ## What is HyperIndex?
21
23
 
22
- HyperIndex is Envio's full-featured blockchain indexing framework. It transforms onchain events into structured, queryable databases with GraphQL APIs, built for developers who care about performance and a clean local experience.
24
+ HyperIndex is Envio's blockchain indexing framework. Choose the contracts and events to track, write TypeScript handlers that shape the data, and HyperIndex keeps it up to date across EVM chains, Solana and Fuel, handles chain reorgs, and serves the result as a GraphQL API or direct Postgres/ClickHouse SQL.
23
25
 
24
- Powered by [HyperSync](https://docs.envio.dev/docs/HyperSync/overview), Envio's proprietary data engine, HyperIndex delivers up to 2000x faster data access than traditional RPC endpoints. That's the difference between syncing in minutes instead of days.
26
+ It reads chain data through [HyperSync](https://docs.envio.dev/docs/HyperSync/overview), Envio's blockchain data API, which is up to 2,000x faster than JSON-RPC. Run it yourself with Docker, or deploy to [Envio Cloud](https://docs.envio.dev/docs/HyperIndex/hosted-service). Cloud starts with a free development plan and scales with your project up to Dedicated infrastructure with a 99.99% uptime SLA.
25
27
 
26
28
  ![Envio Sync](sync.gif)
27
29
 
@@ -31,12 +33,9 @@ Powered by [HyperSync](https://docs.envio.dev/docs/HyperSync/overview), Envio's
31
33
 
32
34
  Most blockchain indexers are bottlenecked by RPC. HyperIndex isn't. HyperSync, the data engine underneath, is a purpose-built, Rust-based query layer that retrieves multiple blocks per round trip, cuts out the overhead, and makes historical backfills genuinely fast.
33
35
 
34
- Independent benchmarks run by Sentio confirm it:
36
+ The [open indexer benchmark](https://github.com/enviodev/open-indexer-benchmark) tracks current speed results across scenarios, and HyperIndex passes every reliability check. Every number there comes from code in the repository, so you can run it yourself.
35
37
 
36
- - **Uniswap V2 Factory** (May 2025): HyperIndex completed in 1 minute. 15x faster than the nearest competitor (Subsquid), 143x faster than The Graph, 158x faster than Ponder
37
- - **LBTC Token with RPC calls** (April 2025): HyperIndex completed in 3 minutes vs 3 hours 9 minutes for The Graph
38
-
39
- [View full benchmark results →](https://docs.envio.dev/docs/HyperIndex/benchmarks)
38
+ [How the benchmarks work →](https://docs.envio.dev/docs/HyperIndex/benchmarks)
40
39
 
41
40
  ---
42
41
 
@@ -44,15 +43,14 @@ Independent benchmarks run by Sentio confirm it:
44
43
 
45
44
  HyperIndex and HyperSync are the data layer for DeFi dashboards, protocol analytics, block explorers, stablecoin monitors, liquidation trackers, oracle comparisons, NFT explorers, and any application that needs fast, structured onchain data.
46
45
 
47
- A few things already running in production:
46
+ A few apps built with them, from the showcase:
48
47
 
49
- - [v4.xyz](https://v4.xyz): the hub for Uniswap V4 data and analytics, indexing across 10 chains in real-time
50
- - [Stable Volume](https://www.stablevolume.com/): real-time stablecoin transaction monitoring across 10+ chains
48
+ - [v4.xyz](https://v4.xyz): the hub for Uniswap V4 data and analytics, indexed in real time across chains
49
+ - [Stable Volume](https://www.stablevolume.com/): real-time stablecoin transaction monitoring across chains
51
50
  - [Stable Radar](https://stable-radar.com): real-time USDC transaction dashboard across multiple chains
52
51
  - [Liqo](https://liqo.xyz): multichain liquidation tracking for DeFi lending protocols
53
- - [Safe Stats](https://safe-stats.vercel.app/): real-time analytics for Safe multisig activity across all chains
54
52
  - [Oracle Wars](https://oraclewars.xyz/): real-time oracle price comparison across multiple oracles
55
- - [Chain Density](https://chaindensity.xyz/): transaction and event density analysis for any address across 70+ chains
53
+ - [Chain Density](https://chaindensity.xyz/): transaction and event density analysis for any address across chains
56
54
  - [LogTUI](https://www.npmjs.com/package/logtui): terminal UI for monitoring blockchain events in real-time
57
55
 
58
56
  [See the full showcase →](https://docs.envio.dev/showcase)
@@ -62,34 +60,33 @@ A few things already running in production:
62
60
  ## Key Features
63
61
 
64
62
  **Performance**
65
- - Historical backfills at 25,000+ events per second
66
- - Up to 2000x faster than traditional RPC via HyperSync (enabled by default, no config required)
67
- - Sync times reduced from days to minutes
63
+ - Historical backfills at 100,000+ events per second ([benchmarking](https://docs.envio.dev/docs/HyperIndex/benchmarking))
64
+ - Up to 2,000x faster than JSON-RPC via HyperSync (on by default, no config required)
68
65
  - Fallback RPC support for reliability without touching your indexer code
69
66
 
70
67
  **Multichain indexing**
71
68
  - Index EVM, SVM, and Fuel blockchains from a single indexer
72
- - 79+ EVM chains with first-class HyperSync support, plus any EVM chain via RPC
69
+ - Every chain on the [HyperSync network list](https://docs.envio.dev/docs/HyperSync/hypersync-supported-networks), plus any EVM chain via RPC
73
70
  - Real-time indexing with reorg handling built in
74
71
 
75
72
  **Developer experience**
76
73
  - Auto-generate an indexer directly from a smart contract address or ABI, no manual setup required
77
- - Write handlers in TypeScript, JavaScript, or ReScript
74
+ - Write handlers in TypeScript or ReScript, and plain JavaScript handler files load too
78
75
  - Full local development environment with Docker
79
76
  - GraphQL API generated automatically from your schema
80
77
  - Wildcard topic indexing: index by event signatures across any contract, not just specified addresses
81
- - Factory contract support for 1M+ dynamically registered contracts
78
+ - Factory contract support for dynamically registered contracts
82
79
  - Onchain and off-chain data integration
83
80
  - External API actions triggered by blockchain events
84
81
  - Detailed logging and error reporting
85
82
 
86
83
  **Deployment**
87
- - Managed [hosted service](https://docs.envio.dev/docs/HyperIndex/hosted-service) with static endpoints, built-in alerts, and production-ready infrastructure
84
+ - [Envio Cloud](https://docs.envio.dev/docs/HyperIndex/hosted-service), managed hosting with static endpoints and built-in alerts, from a free development plan up to Dedicated deployments with an SLA of up to 99.99% uptime
88
85
  - Self-hosted via Docker
89
86
  - No vendor lock-in. Switch between HyperSync and RPC at any time
90
87
 
91
88
  **Agentic development**
92
- - HyperIndex is the default indexing framework for AI-assisted and agentic workflows via Envio's hosted service CLI (`envio-cloud`) and Claude skills
89
+ - Build and deploy with an AI agent using the Envio Cloud CLI (`envio-cloud`) and the [HyperIndex skills](https://github.com/enviodev/hyperindex/tree/main/packages/cli/templates/static/shared/.claude/skills) that `envio init` adds to every project
93
90
  - An agent can scaffold, configure, and deploy a production-ready indexer without touching a config file. [400,000 events indexed in ~20 seconds](https://docs.envio.dev/blog/agentic-blockchain-indexing-envio-hyperindex)
94
91
  - Powerful built-in testing framework purpose-built for AI-driven development. Agents can write, run, and iterate on handler tests in a tight feedback loop, catching regressions before deploy
95
92
 
@@ -97,7 +94,7 @@ A few things already running in production:
97
94
 
98
95
  ## Getting started
99
96
 
100
- **Requirements**: Node.js, Docker (only needed for local development)
97
+ **Requirements**: Node.js 22.15 or newer, and Docker for local development. pnpm is recommended.
101
98
 
102
99
  ```bash
103
100
  pnpx envio init
@@ -119,7 +116,7 @@ From there, three files define your indexer:
119
116
 
120
117
  HyperSync is the data engine that makes HyperIndex fast. It's active by default for all supported networks, no configuration needed.
121
118
 
122
- Instead of making individual RPC calls per block, HyperSync retrieves multiple data points per round trip with advanced filtering. The result: sync speeds up to 2000x faster than standard RPC, dramatically lower infrastructure costs, and no rate limit headaches on supported networks.
119
+ Instead of making individual RPC calls per block, HyperSync retrieves multiple data points per round trip with advanced filtering. The result is sync speeds up to 2,000x faster than JSON-RPC, lower infrastructure costs, and no rate limits to work around on supported networks.
123
120
 
124
121
  HyperSync can also be used directly for custom data pipelines in Python, Rust, Node.js, and Go, independent of HyperIndex.
125
122
 
@@ -129,19 +126,17 @@ HyperSync can also be used directly for custom data pipelines in Python, Rust, N
129
126
 
130
127
  ## Supported networks
131
128
 
132
- HyperIndex supports any EVM-compatible L1, L2, or L3, plus Fuel and Solana (beta). 79+ chains have first-class HyperSync support for maximum speed. For any EVM chain not on the HyperSync list, RPC-based indexing works out of the box. Solana indexing runs on HyperSync for Solana, with instruction-level handlers and IDL-aware decoding.
129
+ HyperIndex supports any EVM-compatible L1, L2, or L3, plus Fuel and Solana. Chains on the [HyperSync network list](https://docs.envio.dev/docs/HyperSync/hypersync-supported-networks) get first-class HyperSync support. For any EVM chain not on the HyperSync list, RPC-based indexing works out of the box. Solana indexing runs on HyperSync for Solana, with instruction-level handlers and IDL-aware decoding.
133
130
 
134
131
  [Full network list →](https://docs.envio.dev/docs/HyperIndex/supported-networks)
135
132
 
136
133
  ---
137
134
 
138
- ## Migrating from The Graph, Ponder, or Subsquid
139
-
140
- HyperIndex has a dedicated migration guide that covers config conversion, schema mapping, and query differences in 3 steps. Envio also offers white-glove migration support. Reach out on Discord and the team will help you get set up.
135
+ ## Migrating an existing indexer
141
136
 
142
- Teams migrating from The Graph can access 2 months of free hosting and full migration support.
137
+ The migration guides cover config conversion, schema mapping and query differences, and you can [migrate with an AI agent](https://docs.envio.dev/docs/HyperIndex/migrate-with-ai). If you run subgraphs, Envio can also migrate and host them for you with Subgraph Hosting, while your applications keep querying a subgraph-compatible endpoint. For hands-on help, see [services](https://envio.dev/pricing/services) or ask on Discord.
143
138
 
144
- [Migration guide →](https://docs.envio.dev/docs/HyperIndex/migration-guide)
139
+ [Migration guides →](https://docs.envio.dev/docs/HyperIndex/migration-guide)
145
140
 
146
141
  ---
147
142
 
@@ -155,16 +150,27 @@ Key sections:
155
150
  - [Multichain Indexing](https://docs.envio.dev/docs/HyperIndex/multichain-indexing)
156
151
  - [Wildcard Indexing](https://docs.envio.dev/docs/HyperIndex/wildcard-indexing)
157
152
  - [Reorg Support](https://docs.envio.dev/docs/HyperIndex/reorgs-support)
158
- - [Hosted Service](https://docs.envio.dev/docs/HyperIndex/hosted-service)
153
+ - [Envio Cloud](https://docs.envio.dev/docs/HyperIndex/hosted-service)
159
154
  - [HyperSync as Data Source](https://docs.envio.dev/docs/HyperIndex/hypersync)
160
155
  - [Migration Guide](https://docs.envio.dev/docs/HyperIndex/migration-guide)
161
156
 
162
157
  ---
163
158
 
159
+ ## Build with an AI agent
160
+
161
+ HyperIndex works with Claude Code, Cursor, Codex and other coding agents.
162
+
163
+ - **Docs for agents.** Point your agent at [llms.txt](https://docs.envio.dev/llms.txt), or the full text at [llms-full.txt](https://docs.envio.dev/llms-full.txt).
164
+ - **Docs MCP server.** Add `https://docs.envio.dev/mcp` to your agent for `docs_search` and `docs_fetch`. See the [MCP server guide](https://docs.envio.dev/docs/HyperIndex/mcp-server).
165
+ - **Skills.** `pnpx envio init` adds the [HyperIndex skills](https://github.com/enviodev/hyperindex/tree/main/packages/cli/templates/static/shared/.claude/skills) to every new project. After upgrading `envio`, run `pnpm envio skills update` to refresh them.
166
+ - **Quickstart.** Follow [Quickstart with AI](https://docs.envio.dev/docs/HyperIndex/quickstart-with-ai) to go from a contract address to a deployed GraphQL API.
167
+
168
+ ---
169
+
164
170
  ## Community and support
165
171
 
166
172
  - Follow us on [X](https://twitter.com/envio_indexer)
167
- - Join the [Discord](https://discord.gg/DhfFhzuJQh), fastest way to get help
173
+ - Join the [Discord](https://discord.gg/DhfFhzuJQh) or [Telegram](https://t.me/+BeS5ihVUFONjNGFk), the fastest ways to get help
168
174
  - Open an issue on [GitHub](https://github.com/enviodev/hyperindex/issues/new/choose)
169
175
  - Browse [common issues](https://docs.envio.dev/docs/common-issues) for quick troubleshooting
170
176
 
package/evm.schema.json CHANGED
@@ -289,7 +289,7 @@
289
289
  "type": "string"
290
290
  },
291
291
  "name": {
292
- "description": "Name of the event in the HyperIndex generated code. When ommitted, the event field will be used. Should be unique per contract",
292
+ "description": "Name of the event in the generated types. When ommitted, the event field will be used. Should be unique per contract",
293
293
  "type": [
294
294
  "string",
295
295
  "null"
@@ -421,7 +421,7 @@
421
421
  ]
422
422
  },
423
423
  "rpc": {
424
- "description": "RPC configuration for your indexer. If not specified otherwise, for chains supported by HyperSync, RPC serves as a fallback for added reliability. For others, it acts as the primary data-source. HyperSync offers significant performance improvements, up to a 1000x faster than traditional RPC.",
424
+ "description": "RPC configuration for your indexer. If not specified otherwise, for chains supported by HyperSync, RPC serves as a fallback for added reliability. For others, it acts as the primary data-source. HyperSync offers significant performance improvements, up to 2000x faster than traditional RPC.",
425
425
  "anyOf": [
426
426
  {
427
427
  "$ref": "#/$defs/RpcSelection"
@@ -461,7 +461,7 @@
461
461
  "minimum": 0
462
462
  },
463
463
  "block_throttle": {
464
- "description": "The minimum number of new blocks the chain head must advance by before the indexer fetches again once it has caught up. Useful on chains with very fast blocks, where fetching every block is wasteful. Unset, 0 and 1 all fetch on every new block.",
464
+ "description": "Once caught up, wait for this many new blocks before fetching them. Delays new events by up to as many blocks.",
465
465
  "type": [
466
466
  "integer",
467
467
  "null"
package/fuel.schema.json CHANGED
@@ -241,7 +241,7 @@
241
241
  "type": "object",
242
242
  "properties": {
243
243
  "name": {
244
- "description": "Name of the event in the HyperIndex generated code",
244
+ "description": "Name of the event in the generated types",
245
245
  "type": "string"
246
246
  },
247
247
  "type": {
@@ -337,7 +337,7 @@
337
337
  "minimum": 0
338
338
  },
339
339
  "block_throttle": {
340
- "description": "The minimum number of new blocks the chain head must advance by before the indexer fetches again once it has caught up. Useful on chains with very fast blocks, where fetching every block is wasteful. Unset, 0 and 1 all fetch on every new block.",
340
+ "description": "Once caught up, wait for this many new blocks before fetching them. Delays new events by up to as many blocks.",
341
341
  "type": [
342
342
  "integer",
343
343
  "null"
package/index.d.ts CHANGED
@@ -398,7 +398,7 @@ type EvmChainConfig<Id extends number = number> = {
398
398
  readonly maxReorgDepth?: number;
399
399
  /** Number of blocks behind the chain head to lag (default: 0). */
400
400
  readonly blockLag?: number;
401
- /** Minimum number of new blocks before fetching again at the head (default: 0, every block). */
401
+ /** Once caught up, wait for this many new blocks before fetching them. Delays new events (default: 0). */
402
402
  readonly blockThrottle?: number;
403
403
  };
404
404
 
@@ -456,7 +456,7 @@ type FuelChainConfig<Id extends number = number> = {
456
456
  readonly maxReorgDepth?: number;
457
457
  /** Number of blocks behind the chain head to lag (default: 0). */
458
458
  readonly blockLag?: number;
459
- /** Minimum number of new blocks before fetching again at the head (default: 0, every block). */
459
+ /** Once caught up, wait for this many new blocks before fetching them. Delays new events (default: 0). */
460
460
  readonly blockThrottle?: number;
461
461
  };
462
462
 
@@ -494,7 +494,7 @@ type SvmChainConfig<Id extends number = number> = {
494
494
  readonly maxReorgDepth?: number;
495
495
  /** Number of blocks behind the chain head to lag (default: 0). */
496
496
  readonly blockLag?: number;
497
- /** Minimum number of new blocks before fetching again at the head (default: 0, every block). */
497
+ /** Once caught up, wait for this many new slots before fetching them. Delays new instructions (default: 0). */
498
498
  readonly blockThrottle?: number;
499
499
  };
500
500
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## Overview
4
4
 
5
- Envio's licensing reflects open source ethos but is not OSI recognized. Developers can use Envio's services without vendor lock-in, either by self-hosting or specifying an RPC URL. The generated code is open and public and so is this repository that generates the generated code.
5
+ Envio's licensing reflects open source ethos but is not OSI recognized. Developers can use Envio's services without vendor lock-in, either by self-hosting or specifying an RPC URL. The code in this repository is public.
6
6
 
7
7
  Our licenses allows self-hosting but restricts third-party hosting with Envio's hosted service. Envio may consider open-sourcing in the future but prioritizes stakeholder interests and market traction. Please reach out to us on discord if you would like to explore hosting indexers as a third-party.
8
8
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "envio",
3
- "version": "3.15.0-subgraph",
3
+ "version": "3.16.0",
4
4
  "type": "module",
5
5
  "description": "A latency and sync speed optimized, developer friendly blockchain data indexer.",
6
6
  "bin": "./bin.mjs",
@@ -43,17 +43,16 @@
43
43
  "dependencies": {
44
44
  "bignumber.js": "9.3.1",
45
45
  "eventsource": "4.1.0",
46
- "express": "4.19.2",
47
- "@rescript/runtime": "12.2.0",
46
+ "express": "4.22.3",
47
+ "@rescript/runtime": "12.3.1",
48
48
  "rescript-schema": "9.5.1",
49
- "dotenv": "16.4.5",
50
- "yaml": "2.8.1"
49
+ "dotenv": "16.4.5"
51
50
  },
52
51
  "optionalDependencies": {
53
- "envio-linux-x64": "3.15.0-subgraph",
54
- "envio-linux-x64-musl": "3.15.0-subgraph",
55
- "envio-linux-arm64": "3.15.0-subgraph",
56
- "envio-darwin-x64": "3.15.0-subgraph",
57
- "envio-darwin-arm64": "3.15.0-subgraph"
52
+ "envio-linux-x64": "3.16.0",
53
+ "envio-linux-x64-musl": "3.16.0",
54
+ "envio-linux-arm64": "3.16.0",
55
+ "envio-darwin-x64": "3.16.0",
56
+ "envio-darwin-arm64": "3.16.0"
58
57
  }
59
58
  }
package/src/Batch.res.mjs CHANGED
@@ -109,9 +109,9 @@ function make(sequence, frontier, chainsBeforeBatch, batchSizeTarget, history) {
109
109
  chainEventsProcessed = chainEventsProcessed + 1;
110
110
  }
111
111
  if (blockNumber !== prevBlockNumber) {
112
- let chainId = fetchState.chainId;
113
- let fromBlockExclusive = prevBlockNumber;
114
112
  let scannedHashes = chainBeforeBatch.scannedHashes;
113
+ let fromBlockExclusive = prevBlockNumber;
114
+ let chainId = fetchState.chainId;
115
115
  if (chainBeforeBatch.shouldRollbackOnReorg) {
116
116
  let blockNumbers = scannedHashes.blockNumbers;
117
117
  let length = blockNumbers.length;
@@ -154,10 +154,10 @@ function make(sequence, frontier, chainsBeforeBatch, batchSizeTarget, history) {
154
154
  };
155
155
  }
156
156
  let progressBlockNumberAfterBatch = FetchState.getProgressBlockNumberAt(fetchState, chainBatchSize);
157
- let chainId$1 = fetchState.chainId;
158
- let toBlockExclusive = progressBlockNumberAfterBatch + 1;
159
- let fromBlockExclusive$1 = prevBlockNumber;
160
157
  let scannedHashes$1 = chainBeforeBatch.scannedHashes;
158
+ let fromBlockExclusive$1 = prevBlockNumber;
159
+ let toBlockExclusive = progressBlockNumberAfterBatch + 1;
160
+ let chainId$1 = fetchState.chainId;
161
161
  if (chainBeforeBatch.shouldRollbackOnReorg) {
162
162
  let blockNumbers$1 = scannedHashes$1.blockNumbers;
163
163
  let length$1 = blockNumbers$1.length;
@@ -51,6 +51,7 @@ let rec startProcessing = async (
51
51
  }
52
52
  }
53
53
  state->IndexerState.endProcessing
54
+ state->IndexerState.reportArrivalAtHead
54
55
 
55
56
  // A reorg detected mid-batch parks the rollback until the loop is idle.
56
57
  // Hand off now that no batch is in flight.
@@ -108,6 +108,7 @@ async function startProcessing(state, runtime, scheduleFetch, scheduleRollback)
108
108
  }
109
109
  };
110
110
  IndexerState.endProcessing(state);
111
+ IndexerState.reportArrivalAtHead(state);
111
112
  if (IndexerState.isResolvingReorg(state)) {
112
113
  return scheduleRollback();
113
114
  } else if (!IndexerState.isStopped(state) && !Object.values(IndexerState.chainStates(state)).every(ChainState.isFetchingAtHead)) {
package/src/Bin.res CHANGED
@@ -25,16 +25,11 @@ type startCmd = {
25
25
  }
26
26
  type migrateCmd = {reset: bool, config: JSON.t}
27
27
  type dropSchemaCmd = {config: JSON.t}
28
- type exitCmd = {code: int}
29
28
 
30
29
  type command =
31
30
  | Start(startCmd)
32
31
  | Migrate(migrateCmd)
33
32
  | DropSchema(dropSchemaCmd)
34
- | Exit(exitCmd)
35
-
36
- // `NodeJs.exitCode` only spells 0 and 1; `envio subgraph diff` also exits 2.
37
- @send external exitWithStatus: (NodeJs.t, int) => unit = "exit"
38
33
 
39
34
  let decodeCommand = (json: JSON.t): command => {
40
35
  let obj = switch json->JSON.Decode.object {
@@ -49,7 +44,6 @@ let decodeCommand = (json: JSON.t): command => {
49
44
  | "start" => Start(json->(Utils.magic: JSON.t => startCmd))
50
45
  | "migrate" => Migrate(json->(Utils.magic: JSON.t => migrateCmd))
51
46
  | "drop-schema" => DropSchema(json->(Utils.magic: JSON.t => dropSchemaCmd))
52
- | "exit" => Exit(json->(Utils.magic: JSON.t => exitCmd))
53
47
  | other => JsError.throwWithMessage(`Unknown command kind: ${other}`)
54
48
  }
55
49
  }
@@ -87,7 +81,6 @@ let run = async args => {
87
81
  | DropSchema({config}) =>
88
82
  Config.prime(config)
89
83
  await Main.dropSchema(~logger)
90
- | Exit({code}) => NodeJs.process->exitWithStatus(code)
91
84
  }
92
85
  }
93
86
  }
package/src/Bin.res.mjs CHANGED
@@ -39,11 +39,6 @@ function decodeCommand(json) {
39
39
  TAG: "DropSchema",
40
40
  _0: json
41
41
  };
42
- case "exit" :
43
- return {
44
- TAG: "Exit",
45
- _0: json
46
- };
47
42
  case "migrate" :
48
43
  return {
49
44
  TAG: "Migrate",
@@ -93,9 +88,6 @@ async function run(args) {
93
88
  case "DropSchema" :
94
89
  Config.prime(match._0.config);
95
90
  return await Main.dropSchema(logger);
96
- case "Exit" :
97
- Process.exit(match._0.code);
98
- return;
99
91
  }
100
92
  } catch (raw_exn) {
101
93
  let exn = Primitive_exceptions.internalToException(raw_exn);