Skip to content

Releases: ponder-sh/ponder

@ponder/[email protected]

20 Jan 19:37
5ac49bc
Compare
Choose a tag to compare

Patch Changes

  • #69 1d6b777 Thanks @0xOlias! - BREAKING Changed the way Ponder expects handlers to be registered.

    1. Source files must be located in src/ instead of handlers/
    2. Handlers are registered using an EventEmitter-like pattern (see below)
    3. Any *.ts file inside src/ can register event handlers this way. Small projects might only need one file in src (e.g. src/app.ts or src/{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

  • #71 e90c241 Thanks @0xOlias! - Added two options to Source (in ponder.ts): source.endBlock and source.isIndexed.

    source.endBlock is an optional field (default: undefined). If specified, Ponder will only fetch & process events up to the provided block number. Alongside source.startBlock, it can be used to only index a specific block range for a contract.

    source.isIndexed is an optional field (default: true). If false, 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 on context.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.

    1. The ponder config file was changed (back) to ponder.config.ts.
    2. The sources field in ponder.config.ts was changes to contracts.

[email protected]

16 Jan 19:39
d93ff60
Compare
Choose a tag to compare

Patch Changes

[email protected]

16 Jan 19:23
18afeef
Compare
Choose a tag to compare

Patch Changes

@ponder/[email protected]

16 Jan 04:44
7de543a
Compare
Choose a tag to compare

Patch Changes

@ponder/[email protected]

16 Jan 04:44
7de543a
Compare
Choose a tag to compare

Patch Changes

  • #63 46c72f0 Thanks @0xOlias! - Fixed bug where handler functions would fail if an event was fetched but not present in the ABI. This means partial ABIs are now supported.

[email protected]

13 Jan 03:06
fe4b8bd
Compare
Choose a tag to compare

Patch Changes

  • #57 3f358dd Thanks @0xOlias! - Generate ponder.ts according to new format from @ponder/core

[email protected]

13 Jan 01:39
22f0f7d
Compare
Choose a tag to compare

Patch Changes

@ponder/[email protected]

13 Jan 03:06
fe4b8bd
Compare
Choose a tag to compare

Patch Changes

@ponder/[email protected]

13 Jan 03:06
fe4b8bd
Compare
Choose a tag to compare

Patch Changes

  • #57 3f358dd Thanks @0xOlias! - BREAKING! Updated ponder config to support typescript and to be called ponder.ts by default. ponder.ts must export a variable named config that is of the type import { PonderConfig } from "@ponder/core". The database field in ponder config is now optional. By default, it uses SQLite with a filename of ./.ponder/cache.db. If the environment variable DATABASE_URL is detected, it uses Postgres with that value as the connectionString.

    New sample ponder.ts file:

    // ponder.ts
    
    import type { PonderConfig } from "@ponder/core";
    import { graphqlPlugin } from "@ponder/graphql";
    
    export const config: PonderConfig = {
      networks: [
        {
          name: "mainnet",
          chainId: 1,
          rpcUrl: process.env.PONDER_RPC_URL_1,
        },
      ],
      sources: [
        {
          name: "ArtGobblers",
          network: "mainnet",
          abi: "./abis/ArtGobblers.json",
          address: "0x60bb1e2aa1c9acafb4d34f71585d7e959f387769",
          startBlock: 15863321,
        },
      ],
      plugins: [graphqlPlugin()],
    };

    The exported value can also be a function, and it can return a Promise:

    // ponder.ts
    
    import type { PonderConfig } from "@ponder/core";
    
    export const config: PonderConfig = async () => {
      return {
        networks: [
          /* ... */
        ],
        sources: [
          /* ... */
        ],
      };
    };

@ponder/[email protected]

10 Jan 01:09
c840690
Compare
Choose a tag to compare

Patch Changes