Releases: ponder-sh/ponder
@ponder/[email protected]
@ponder/[email protected]
[email protected]
Patch Changes
-
#69
1d6b777
Thanks @0xOlias! - BREAKING Changed the way Ponder expects handlers to be registered.- Source files must be located in
src/
instead ofhandlers/
- Handlers are registered using an
EventEmitter
-like pattern (see below) - Any
*.ts
file insidesrc/
can register event handlers this way. Small projects might only need one file insrc
(e.g.src/app.ts
orsrc/{SourceName}.ts
)
import { ponder } from "../generated"; ponder.on("SourceName:EventName", async ({ event, context }) => { // same handler function body as before! }); ponder.on("SourceName:EventName2", async ({ event, context }) => { // ... }); ponder.on("AnotherSourceName:EventName", async ({ event, context }) => { // ... });
Updated
create-ponder
to use this pattern for newly generated projects - Source files must be located in
-
#72
df3ec60
Thanks @0xOlias! - BREAKING Changes ponder config naming.- The ponder config file was changed (back) to
ponder.config.ts
. - The
sources
field inponder.config.ts
was changes tocontracts
.
- The ponder config file was changed (back) to
@ponder/[email protected]
Patch Changes
- Updated dependencies [
1d6b777
,e90c241
,df3ec60
]:- @ponder/[email protected]
@ponder/[email protected]
Patch Changes
-
#69
1d6b777
Thanks @0xOlias! - BREAKING Changed the way Ponder expects handlers to be registered.- Source files must be located in
src/
instead ofhandlers/
- Handlers are registered using an
EventEmitter
-like pattern (see below) - Any
*.ts
file insidesrc/
can register event handlers this way. Small projects might only need one file insrc
(e.g.src/app.ts
orsrc/{SourceName}.ts
)
import { ponder } from "../generated"; ponder.on("SourceName:EventName", async ({ event, context }) => { // same handler function body as before! }); ponder.on("SourceName:EventName2", async ({ event, context }) => { // ... }); ponder.on("AnotherSourceName:EventName", async ({ event, context }) => { // ... });
Updated
create-ponder
to use this pattern for newly generated projects - Source files must be located in
-
#71
e90c241
Thanks @0xOlias! - Added two options to Source (in ponder.ts):source.endBlock
andsource.isIndexed
.source.endBlock
is an optional field (default: undefined). If specified, Ponder will only fetch & process events up to the provided block number. Alongsidesource.startBlock
, it can be used to only index a specific block range for a contract.source.isIndexed
is an optional field (default:true
). Iffalse
, Ponder will not fetch any events for this contract, and the user will not be able to define event handlers for events coming from this contract. This contract will still be available oncontext.contracts
for other event handlers in your project. Use this field if you're only using a contract to call it, and don't care about processing events emitted by it. -
#72
df3ec60
Thanks @0xOlias! - BREAKING Changes ponder config naming.- The ponder config file was changed (back) to
ponder.config.ts
. - The
sources
field inponder.config.ts
was changes tocontracts
.
- The ponder config file was changed (back) to
[email protected]
[email protected]
@ponder/[email protected]
Patch Changes
- Updated dependencies [
46c72f0
]:- @ponder/[email protected]