create-ponder 0.7.17 → 0.8.1
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.
- package/README.md +7 -7
- package/dist/index.js +9 -4
- package/package.json +1 -1
- package/templates/empty/package.json +2 -1
- package/templates/empty/ponder-env.d.ts +11 -24
- package/templates/empty/ponder.config.ts +1 -1
- package/templates/empty/ponder.schema.ts +1 -1
- package/templates/empty/src/api/index.ts +2 -2
- package/templates/empty/src/index.ts +1 -1
- package/templates/etherscan/package.json +2 -1
- package/templates/etherscan/ponder-env.d.ts +11 -24
- package/templates/etherscan/ponder.schema.ts +1 -1
- package/templates/feature-accounts/_dot_env.local +5 -0
- package/templates/feature-accounts/_dot_eslintrc.json +3 -0
- package/templates/feature-accounts/_dot_gitignore +18 -0
- package/templates/feature-accounts/package.json +28 -0
- package/templates/feature-accounts/ponder-env.d.ts +15 -0
- package/templates/feature-accounts/ponder.config.ts +22 -0
- package/templates/feature-accounts/ponder.schema.ts +7 -0
- package/templates/feature-accounts/src/index.ts +22 -0
- package/templates/feature-accounts/tsconfig.json +26 -0
- package/templates/feature-api-functions/package.json +2 -3
- package/templates/feature-api-functions/ponder-env.d.ts +11 -23
- package/templates/feature-api-functions/ponder.config.ts +1 -1
- package/templates/feature-api-functions/ponder.schema.ts +1 -1
- package/templates/feature-api-functions/src/api/index.ts +3 -3
- package/templates/feature-api-functions/src/index.ts +2 -2
- package/templates/feature-blocks/package.json +2 -1
- package/templates/feature-blocks/ponder-env.d.ts +11 -23
- package/templates/feature-blocks/ponder.config.ts +1 -1
- package/templates/feature-blocks/ponder.schema.ts +1 -1
- package/templates/feature-blocks/src/index.ts +2 -2
- package/templates/feature-call-traces/package.json +2 -1
- package/templates/feature-call-traces/ponder-env.d.ts +11 -23
- package/templates/feature-call-traces/ponder.config.ts +2 -2
- package/templates/feature-call-traces/ponder.schema.ts +1 -1
- package/templates/feature-call-traces/src/index.ts +2 -2
- package/templates/feature-factory/package.json +2 -1
- package/templates/feature-factory/ponder-env.d.ts +11 -23
- package/templates/feature-factory/ponder.config.ts +6 -5
- package/templates/feature-factory/ponder.schema.ts +1 -1
- package/templates/feature-factory/src/LlamaCore.ts +1 -1
- package/templates/feature-filter/package.json +2 -1
- package/templates/feature-filter/ponder-env.d.ts +11 -23
- package/templates/feature-filter/ponder.config.ts +1 -1
- package/templates/feature-filter/ponder.schema.ts +1 -1
- package/templates/feature-filter/src/index.ts +2 -2
- package/templates/feature-multichain/package.json +2 -1
- package/templates/feature-multichain/ponder-env.d.ts +11 -23
- package/templates/feature-multichain/ponder.config.ts +1 -1
- package/templates/feature-multichain/ponder.schema.ts +1 -1
- package/templates/feature-multichain/src/index.ts +2 -2
- package/templates/feature-proxy/package.json +2 -1
- package/templates/feature-proxy/ponder-env.d.ts +11 -23
- package/templates/feature-proxy/ponder.config.ts +1 -1
- package/templates/feature-proxy/ponder.schema.ts +1 -1
- package/templates/feature-proxy/src/index.ts +2 -2
- package/templates/feature-read-contract/package.json +2 -1
- package/templates/feature-read-contract/ponder-env.d.ts +11 -23
- package/templates/feature-read-contract/ponder.config.ts +1 -1
- package/templates/feature-read-contract/ponder.schema.ts +1 -1
- package/templates/feature-read-contract/src/FileStore.ts +2 -2
- package/templates/project-friendtech/package.json +2 -1
- package/templates/project-friendtech/ponder-env.d.ts +11 -23
- package/templates/project-friendtech/ponder.config.ts +1 -1
- package/templates/project-friendtech/ponder.schema.ts +1 -1
- package/templates/project-friendtech/src/FriendtechSharesV1.ts +2 -2
- package/templates/project-uniswap-v3-flash/package.json +2 -1
- package/templates/project-uniswap-v3-flash/ponder-env.d.ts +11 -23
- package/templates/project-uniswap-v3-flash/ponder.config.ts +3 -3
- package/templates/project-uniswap-v3-flash/ponder.schema.ts +1 -1
- package/templates/project-uniswap-v3-flash/src/index.ts +2 -2
- package/templates/reference-erc1155/package.json +2 -1
- package/templates/reference-erc1155/ponder-env.d.ts +11 -23
- package/templates/reference-erc1155/ponder.config.ts +1 -1
- package/templates/reference-erc1155/ponder.schema.ts +1 -1
- package/templates/reference-erc1155/src/index.ts +2 -2
- package/templates/reference-erc20/package.json +2 -1
- package/templates/reference-erc20/ponder-env.d.ts +11 -23
- package/templates/reference-erc20/ponder.config.ts +1 -1
- package/templates/reference-erc20/ponder.schema.ts +1 -1
- package/templates/reference-erc20/src/index.ts +2 -2
- package/templates/reference-erc4626/package.json +2 -1
- package/templates/reference-erc4626/ponder-env.d.ts +11 -23
- package/templates/reference-erc4626/ponder.config.ts +1 -1
- package/templates/reference-erc4626/ponder.schema.ts +1 -1
- package/templates/reference-erc4626/src/index.ts +2 -2
- package/templates/reference-erc721/package.json +2 -1
- package/templates/reference-erc721/ponder-env.d.ts +11 -23
- package/templates/reference-erc721/ponder.config.ts +1 -1
- package/templates/reference-erc721/ponder.schema.ts +1 -1
- package/templates/reference-erc721/src/index.ts +2 -2
- package/templates/subgraph/package.json +2 -1
- package/templates/subgraph/ponder-env.d.ts +11 -29
- package/templates/subgraph/ponder.schema.ts +1 -1
package/README.md
CHANGED
|
@@ -62,7 +62,7 @@ Ponder fetches event logs for the contracts added to `ponder.config.ts`, and pas
|
|
|
62
62
|
```ts
|
|
63
63
|
// ponder.config.ts
|
|
64
64
|
|
|
65
|
-
import { createConfig } from "
|
|
65
|
+
import { createConfig } from "ponder";
|
|
66
66
|
import { http } from "viem";
|
|
67
67
|
|
|
68
68
|
import { BaseRegistrarAbi } from "./abis/BaseRegistrar";
|
|
@@ -92,7 +92,7 @@ The `ponder.schema.ts` file contains the database schema, and defines the shape
|
|
|
92
92
|
```ts
|
|
93
93
|
// ponder.schema.ts
|
|
94
94
|
|
|
95
|
-
import { onchainTable } from "
|
|
95
|
+
import { onchainTable } from "ponder";
|
|
96
96
|
|
|
97
97
|
export const ensName = onchainTable("ens_name", (t) => ({
|
|
98
98
|
name: p.text().primaryKey(),
|
|
@@ -108,8 +108,8 @@ Files in the `src/` directory contain **indexing functions**, which are TypeScri
|
|
|
108
108
|
```ts
|
|
109
109
|
// src/BaseRegistrar.ts
|
|
110
110
|
|
|
111
|
-
import { ponder } from "
|
|
112
|
-
import
|
|
111
|
+
import { ponder } from "ponder:registry";
|
|
112
|
+
import schema from "ponder:schema";
|
|
113
113
|
|
|
114
114
|
ponder.on("BaseRegistrar:NameRegistered", async ({ event, context }) => {
|
|
115
115
|
const { name, owner } = event.params;
|
|
@@ -167,7 +167,7 @@ If you're interested in contributing to Ponder, please read the [contribution gu
|
|
|
167
167
|
|
|
168
168
|
## Packages
|
|
169
169
|
|
|
170
|
-
-
|
|
170
|
+
- `ponder`
|
|
171
171
|
- `@ponder/utils`
|
|
172
172
|
- `create-ponder`
|
|
173
173
|
- `eslint-config-ponder`
|
|
@@ -180,7 +180,7 @@ Ponder is MIT-licensed open-source software.
|
|
|
180
180
|
[ci-url]: https://github.com/ponder-sh/ponder/actions/workflows/main.yml
|
|
181
181
|
[tg-badge]: https://img.shields.io/endpoint?color=neon&logo=telegram&label=Chat&url=https%3A%2F%2Fmogyo.ro%2Fquart-apis%2Ftgmembercount%3Fchat_id%3Dponder_sh
|
|
182
182
|
[tg-url]: https://t.me/ponder_sh
|
|
183
|
-
[license-badge]: https://img.shields.io/npm/l
|
|
183
|
+
[license-badge]: https://img.shields.io/npm/l/ponder?label=License
|
|
184
184
|
[license-url]: https://github.com/ponder-sh/ponder/blob/main/LICENSE
|
|
185
|
-
[version-badge]: https://img.shields.io/npm/v
|
|
185
|
+
[version-badge]: https://img.shields.io/npm/v/ponder
|
|
186
186
|
[version-url]: https://github.com/ponder-sh/ponder/releases
|
package/dist/index.js
CHANGED
|
@@ -16,7 +16,7 @@ import { default as prompts } from "prompts";
|
|
|
16
16
|
// package.json
|
|
17
17
|
var package_default = {
|
|
18
18
|
name: "create-ponder",
|
|
19
|
-
version: "0.
|
|
19
|
+
version: "0.8.1",
|
|
20
20
|
type: "module",
|
|
21
21
|
description: "A CLI tool to create Ponder apps",
|
|
22
22
|
license: "MIT",
|
|
@@ -636,6 +636,11 @@ var templates = [
|
|
|
636
636
|
title: "Feature - Factory contract",
|
|
637
637
|
description: "A Ponder app using a factory contract"
|
|
638
638
|
},
|
|
639
|
+
{
|
|
640
|
+
id: "feature-accounts",
|
|
641
|
+
title: "Feature - Accounts",
|
|
642
|
+
description: "A Ponder app using accounts"
|
|
643
|
+
},
|
|
639
644
|
{
|
|
640
645
|
id: "feature-filter",
|
|
641
646
|
title: "Feature - Custom event filter",
|
|
@@ -864,7 +869,7 @@ async function run({
|
|
|
864
869
|
});
|
|
865
870
|
if (config) {
|
|
866
871
|
const configContent = `
|
|
867
|
-
import { createConfig${Object.values(config.contracts).some((c) => Array.isArray(c.abi)) ? ", mergeAbis" : ""} } from "
|
|
872
|
+
import { createConfig${Object.values(config.contracts).some((c) => Array.isArray(c.abi)) ? ", mergeAbis" : ""} } from "ponder";
|
|
868
873
|
import { http } from "viem";
|
|
869
874
|
|
|
870
875
|
${Object.values(config.contracts).flatMap((c) => c.abi).filter(
|
|
@@ -903,7 +908,7 @@ async function run({
|
|
|
903
908
|
);
|
|
904
909
|
const eventNamesToWrite = abiEvents.map((event) => event.name).slice(0, 4);
|
|
905
910
|
const indexingFunctionFileContents = `
|
|
906
|
-
import { ponder } from '
|
|
911
|
+
import { ponder } from 'ponder:registry'
|
|
907
912
|
|
|
908
913
|
${eventNamesToWrite.map(
|
|
909
914
|
(eventName) => `
|
|
@@ -922,7 +927,7 @@ async function run({
|
|
|
922
927
|
}
|
|
923
928
|
const packageJson = await fs.readJSON(path4.join(projectPath, "package.json"));
|
|
924
929
|
packageJson.name = projectName;
|
|
925
|
-
packageJson.dependencies
|
|
930
|
+
packageJson.dependencies.ponder = `^${package_default.version}`;
|
|
926
931
|
packageJson.devDependencies["eslint-config-ponder"] = `^${package_default.version}`;
|
|
927
932
|
await fs.writeFile(
|
|
928
933
|
path4.join(projectPath, "package.json"),
|
package/package.json
CHANGED
|
@@ -6,12 +6,13 @@
|
|
|
6
6
|
"scripts": {
|
|
7
7
|
"dev": "ponder dev",
|
|
8
8
|
"start": "ponder start",
|
|
9
|
+
"db": "ponder db",
|
|
9
10
|
"codegen": "ponder codegen",
|
|
10
11
|
"lint": "eslint .",
|
|
11
12
|
"typecheck": "tsc"
|
|
12
13
|
},
|
|
13
14
|
"dependencies": {
|
|
14
|
-
"
|
|
15
|
+
"ponder": "^0.0.95",
|
|
15
16
|
"hono": "^4.5.0",
|
|
16
17
|
"viem": "^2.21.3"
|
|
17
18
|
},
|
|
@@ -1,28 +1,15 @@
|
|
|
1
|
+
/// <reference types="ponder/virtual" />
|
|
2
|
+
|
|
3
|
+
declare module "ponder:internal" {
|
|
4
|
+
const config: typeof import("./ponder.config.ts");
|
|
5
|
+
const schema: typeof import("./ponder.schema.ts");
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
declare module "ponder:schema" {
|
|
9
|
+
export * from "./ponder.schema.ts";
|
|
10
|
+
}
|
|
11
|
+
|
|
1
12
|
// This file enables type checking and editor autocomplete for this Ponder project.
|
|
2
13
|
// After upgrading, you may find that changes have been made to this file.
|
|
3
14
|
// If this happens, please commit the changes. Do not manually edit this file.
|
|
4
15
|
// See https://ponder.sh/docs/getting-started/installation#typescript for more information.
|
|
5
|
-
|
|
6
|
-
declare module "@/generated" {
|
|
7
|
-
import type { Virtual } from "@ponder/core";
|
|
8
|
-
|
|
9
|
-
type config = typeof import("./ponder.config.ts").default;
|
|
10
|
-
type schema = typeof import("./ponder.schema.ts").default;
|
|
11
|
-
|
|
12
|
-
export const ponder: Virtual.Registry<config, schema>;
|
|
13
|
-
|
|
14
|
-
export type EventNames = Virtual.EventNames<config>;
|
|
15
|
-
export type Event<name extends EventNames = EventNames> = Virtual.Event<
|
|
16
|
-
config,
|
|
17
|
-
name
|
|
18
|
-
>;
|
|
19
|
-
export type Context<name extends EventNames = EventNames> = Virtual.Context<
|
|
20
|
-
config,
|
|
21
|
-
schema,
|
|
22
|
-
name
|
|
23
|
-
>;
|
|
24
|
-
export type ApiContext = Virtual.Drizzle<schema>;
|
|
25
|
-
export type IndexingFunctionArgs<name extends EventNames = EventNames> =
|
|
26
|
-
Virtual.IndexingFunctionArgs<config, schema, name>;
|
|
27
|
-
export type Schema = Virtual.Schema<schema>;
|
|
28
|
-
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import { ponder } from "
|
|
1
|
+
import { ponder } from "ponder:registry";
|
|
@@ -6,12 +6,13 @@
|
|
|
6
6
|
"scripts": {
|
|
7
7
|
"dev": "ponder dev",
|
|
8
8
|
"start": "ponder start",
|
|
9
|
+
"db": "ponder db",
|
|
9
10
|
"codegen": "ponder codegen",
|
|
10
11
|
"lint": "eslint .",
|
|
11
12
|
"typecheck": "tsc"
|
|
12
13
|
},
|
|
13
14
|
"dependencies": {
|
|
14
|
-
"
|
|
15
|
+
"ponder": "^0.0.95",
|
|
15
16
|
"hono": "^4.5.0",
|
|
16
17
|
"viem": "^2.21.3"
|
|
17
18
|
},
|
|
@@ -1,28 +1,15 @@
|
|
|
1
|
+
/// <reference types="ponder/virtual" />
|
|
2
|
+
|
|
3
|
+
declare module "ponder:internal" {
|
|
4
|
+
const config: typeof import("./ponder.config.ts");
|
|
5
|
+
const schema: typeof import("./ponder.schema.ts");
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
declare module "ponder:schema" {
|
|
9
|
+
export * from "./ponder.schema.ts";
|
|
10
|
+
}
|
|
11
|
+
|
|
1
12
|
// This file enables type checking and editor autocomplete for this Ponder project.
|
|
2
13
|
// After upgrading, you may find that changes have been made to this file.
|
|
3
14
|
// If this happens, please commit the changes. Do not manually edit this file.
|
|
4
15
|
// See https://ponder.sh/docs/getting-started/installation#typescript for more information.
|
|
5
|
-
|
|
6
|
-
declare module "@/generated" {
|
|
7
|
-
import type { Virtual } from "@ponder/core";
|
|
8
|
-
|
|
9
|
-
type config = typeof import("./ponder.config.ts").default;
|
|
10
|
-
type schema = typeof import("./ponder.schema.ts").default;
|
|
11
|
-
|
|
12
|
-
export const ponder: Virtual.Registry<config, schema>;
|
|
13
|
-
|
|
14
|
-
export type EventNames = Virtual.EventNames<config>;
|
|
15
|
-
export type Event<name extends EventNames = EventNames> = Virtual.Event<
|
|
16
|
-
config,
|
|
17
|
-
name
|
|
18
|
-
>;
|
|
19
|
-
export type Context<name extends EventNames = EventNames> = Virtual.Context<
|
|
20
|
-
config,
|
|
21
|
-
schema,
|
|
22
|
-
name
|
|
23
|
-
>;
|
|
24
|
-
export type ApiContext = Virtual.Drizzle<schema>;
|
|
25
|
-
export type IndexingFunctionArgs<name extends EventNames = EventNames> =
|
|
26
|
-
Virtual.IndexingFunctionArgs<config, schema, name>;
|
|
27
|
-
export type Schema = Virtual.Schema<schema>;
|
|
28
|
-
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "ponder-examples-feature-accounts",
|
|
3
|
+
"private": true,
|
|
4
|
+
"type": "module",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"dev": "ponder dev",
|
|
7
|
+
"start": "ponder start",
|
|
8
|
+
"db": "ponder db",
|
|
9
|
+
"codegen": "ponder codegen",
|
|
10
|
+
"serve": "ponder serve",
|
|
11
|
+
"lint": "eslint .",
|
|
12
|
+
"typecheck": "tsc"
|
|
13
|
+
},
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"ponder": "workspace:*",
|
|
16
|
+
"hono": "^4.5.0",
|
|
17
|
+
"viem": "^2.21.3"
|
|
18
|
+
},
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"@types/node": "^20.10.0",
|
|
21
|
+
"eslint": "^8.54.0",
|
|
22
|
+
"eslint-config-ponder": "workspace:*",
|
|
23
|
+
"typescript": "^5.3.2"
|
|
24
|
+
},
|
|
25
|
+
"engines": {
|
|
26
|
+
"node": ">=18.14"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="ponder/virtual" />
|
|
2
|
+
|
|
3
|
+
declare module "ponder:internal" {
|
|
4
|
+
const config: typeof import("./ponder.config.ts");
|
|
5
|
+
const schema: typeof import("./ponder.schema.ts");
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
declare module "ponder:schema" {
|
|
9
|
+
export * from "./ponder.schema.ts";
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
// This file enables type checking and editor autocomplete for this Ponder project.
|
|
13
|
+
// After upgrading, you may find that changes have been made to this file.
|
|
14
|
+
// If this happens, please commit the changes. Do not manually edit this file.
|
|
15
|
+
// See https://ponder.sh/docs/getting-started/installation#typescript for more information.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { createConfig } from "ponder";
|
|
2
|
+
import { http, createPublicClient } from "viem";
|
|
3
|
+
|
|
4
|
+
const latestBlockMainnet = await createPublicClient({
|
|
5
|
+
transport: http(process.env.PONDER_RPC_URL_1),
|
|
6
|
+
}).getBlock();
|
|
7
|
+
|
|
8
|
+
export default createConfig({
|
|
9
|
+
networks: {
|
|
10
|
+
mainnet: {
|
|
11
|
+
chainId: 1,
|
|
12
|
+
transport: http(process.env.PONDER_RPC_URL_1),
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
accounts: {
|
|
16
|
+
BeaverBuilder: {
|
|
17
|
+
network: "mainnet",
|
|
18
|
+
startBlock: Number(latestBlockMainnet.number) - 100,
|
|
19
|
+
address: "0x95222290DD7278Aa3Ddd389Cc1E1d165CC4BAfe5",
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ponder } from "ponder:registry";
|
|
2
|
+
import schema from "ponder:schema";
|
|
3
|
+
|
|
4
|
+
ponder.on("BeaverBuilder:transaction:from", async ({ event, context }) => {
|
|
5
|
+
if (event.transaction.to === null) return;
|
|
6
|
+
|
|
7
|
+
await context.db
|
|
8
|
+
.insert(schema.transactionEvents)
|
|
9
|
+
.values({
|
|
10
|
+
to: event.transaction.to,
|
|
11
|
+
value: event.transaction.value,
|
|
12
|
+
data: event.transaction.input,
|
|
13
|
+
})
|
|
14
|
+
.onConflictDoUpdate((row) => ({
|
|
15
|
+
value: row.value + event.transaction.value,
|
|
16
|
+
data: event.transaction.input,
|
|
17
|
+
}));
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
ponder.on("BeaverBuilder:transfer:to", async ({ event }) => {
|
|
21
|
+
console.log("sent", event.transfer);
|
|
22
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
// Type checking
|
|
4
|
+
"strict": true,
|
|
5
|
+
"noUncheckedIndexedAccess": true,
|
|
6
|
+
|
|
7
|
+
// Interop constraints
|
|
8
|
+
"verbatimModuleSyntax": false,
|
|
9
|
+
"esModuleInterop": true,
|
|
10
|
+
"isolatedModules": true,
|
|
11
|
+
"allowSyntheticDefaultImports": true,
|
|
12
|
+
"resolveJsonModule": true,
|
|
13
|
+
|
|
14
|
+
// Language and environment
|
|
15
|
+
"moduleResolution": "bundler",
|
|
16
|
+
"module": "ESNext",
|
|
17
|
+
"noEmit": true,
|
|
18
|
+
"lib": ["ES2022"],
|
|
19
|
+
"target": "ES2022",
|
|
20
|
+
|
|
21
|
+
// Skip type checking for node modules
|
|
22
|
+
"skipLibCheck": true
|
|
23
|
+
},
|
|
24
|
+
"include": ["./**/*.ts"],
|
|
25
|
+
"exclude": ["node_modules"]
|
|
26
|
+
}
|
|
@@ -5,16 +5,15 @@
|
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "ponder dev",
|
|
7
7
|
"start": "ponder start",
|
|
8
|
+
"db": "ponder db",
|
|
8
9
|
"codegen": "ponder codegen",
|
|
9
10
|
"serve": "ponder serve",
|
|
10
|
-
"generate": "drizzle-kit generate --dialect postgresql --schema ./ponder.schema.ts --out migrations",
|
|
11
11
|
"lint": "eslint .",
|
|
12
12
|
"typecheck": "tsc"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@ponder/core": "workspace:*",
|
|
16
|
-
"drizzle-kit": "0.25.0",
|
|
17
15
|
"hono": "^4.5.0",
|
|
16
|
+
"ponder": "workspace:*",
|
|
18
17
|
"viem": "^2.21.3"
|
|
19
18
|
},
|
|
20
19
|
"devDependencies": {
|
|
@@ -1,27 +1,15 @@
|
|
|
1
|
+
/// <reference types="ponder/virtual" />
|
|
2
|
+
|
|
3
|
+
declare module "ponder:internal" {
|
|
4
|
+
const config: typeof import("./ponder.config.ts");
|
|
5
|
+
const schema: typeof import("./ponder.schema.ts");
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
declare module "ponder:schema" {
|
|
9
|
+
export * from "./ponder.schema.ts";
|
|
10
|
+
}
|
|
11
|
+
|
|
1
12
|
// This file enables type checking and editor autocomplete for this Ponder project.
|
|
2
13
|
// After upgrading, you may find that changes have been made to this file.
|
|
3
14
|
// If this happens, please commit the changes. Do not manually edit this file.
|
|
4
15
|
// See https://ponder.sh/docs/getting-started/installation#typescript for more information.
|
|
5
|
-
|
|
6
|
-
declare module "@/generated" {
|
|
7
|
-
import type { Virtual } from "@ponder/core";
|
|
8
|
-
|
|
9
|
-
type config = typeof import("./ponder.config.ts").default;
|
|
10
|
-
type schema = typeof import("./ponder.schema.ts");
|
|
11
|
-
|
|
12
|
-
export const ponder: Virtual.Registry<config, schema>;
|
|
13
|
-
|
|
14
|
-
export type EventNames = Virtual.EventNames<config>;
|
|
15
|
-
export type Event<name extends EventNames = EventNames> = Virtual.Event<
|
|
16
|
-
config,
|
|
17
|
-
name
|
|
18
|
-
>;
|
|
19
|
-
export type Context<name extends EventNames = EventNames> = Virtual.Context<
|
|
20
|
-
config,
|
|
21
|
-
schema,
|
|
22
|
-
name
|
|
23
|
-
>;
|
|
24
|
-
export type ApiContext = Virtual.ApiContext<schema>;
|
|
25
|
-
export type IndexingFunctionArgs<name extends EventNames = EventNames> =
|
|
26
|
-
Virtual.IndexingFunctionArgs<config, schema, name>;
|
|
27
|
-
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ponder } from "
|
|
2
|
-
import {
|
|
1
|
+
import { ponder } from "ponder:registry";
|
|
2
|
+
import { account, transferEvent } from "ponder:schema";
|
|
3
|
+
import { count, desc, eq, graphql, or, replaceBigInts } from "ponder";
|
|
3
4
|
import { formatEther, getAddress } from "viem";
|
|
4
|
-
import { account, transferEvent } from "../../ponder.schema";
|
|
5
5
|
|
|
6
6
|
ponder.use("/graphql", graphql());
|
|
7
7
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { ponder } from "
|
|
1
|
+
import { ponder } from "ponder:registry";
|
|
2
2
|
import {
|
|
3
3
|
account,
|
|
4
4
|
allowance,
|
|
5
5
|
approvalEvent,
|
|
6
6
|
transferEvent,
|
|
7
|
-
} from "
|
|
7
|
+
} from "ponder:schema";
|
|
8
8
|
|
|
9
9
|
ponder.on("ERC20:Transfer", async ({ event, context }) => {
|
|
10
10
|
await context.db
|
|
@@ -5,13 +5,14 @@
|
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "ponder dev",
|
|
7
7
|
"start": "ponder start",
|
|
8
|
+
"db": "ponder db",
|
|
8
9
|
"codegen": "ponder codegen",
|
|
9
10
|
"serve": "ponder serve",
|
|
10
11
|
"lint": "eslint .",
|
|
11
12
|
"typecheck": "tsc"
|
|
12
13
|
},
|
|
13
14
|
"dependencies": {
|
|
14
|
-
"
|
|
15
|
+
"ponder": "workspace:*",
|
|
15
16
|
"hono": "^4.5.0",
|
|
16
17
|
"viem": "^2.21.3"
|
|
17
18
|
},
|
|
@@ -1,27 +1,15 @@
|
|
|
1
|
+
/// <reference types="ponder/virtual" />
|
|
2
|
+
|
|
3
|
+
declare module "ponder:internal" {
|
|
4
|
+
const config: typeof import("./ponder.config.ts");
|
|
5
|
+
const schema: typeof import("./ponder.schema.ts");
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
declare module "ponder:schema" {
|
|
9
|
+
export * from "./ponder.schema.ts";
|
|
10
|
+
}
|
|
11
|
+
|
|
1
12
|
// This file enables type checking and editor autocomplete for this Ponder project.
|
|
2
13
|
// After upgrading, you may find that changes have been made to this file.
|
|
3
14
|
// If this happens, please commit the changes. Do not manually edit this file.
|
|
4
15
|
// See https://ponder.sh/docs/getting-started/installation#typescript for more information.
|
|
5
|
-
|
|
6
|
-
declare module "@/generated" {
|
|
7
|
-
import type { Virtual } from "@ponder/core";
|
|
8
|
-
|
|
9
|
-
type config = typeof import("./ponder.config.ts").default;
|
|
10
|
-
type schema = typeof import("./ponder.schema.ts");
|
|
11
|
-
|
|
12
|
-
export const ponder: Virtual.Registry<config, schema>;
|
|
13
|
-
|
|
14
|
-
export type EventNames = Virtual.EventNames<config>;
|
|
15
|
-
export type Event<name extends EventNames = EventNames> = Virtual.Event<
|
|
16
|
-
config,
|
|
17
|
-
name
|
|
18
|
-
>;
|
|
19
|
-
export type Context<name extends EventNames = EventNames> = Virtual.Context<
|
|
20
|
-
config,
|
|
21
|
-
schema,
|
|
22
|
-
name
|
|
23
|
-
>;
|
|
24
|
-
export type ApiContext = Virtual.ApiContext<schema>;
|
|
25
|
-
export type IndexingFunctionArgs<name extends EventNames = EventNames> =
|
|
26
|
-
Virtual.IndexingFunctionArgs<config, schema, name>;
|
|
27
|
-
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ponder } from "
|
|
1
|
+
import { ponder } from "ponder:registry";
|
|
2
|
+
import schema from "ponder:schema";
|
|
2
3
|
import { parseAbi } from "viem";
|
|
3
|
-
import * as schema from "../ponder.schema";
|
|
4
4
|
|
|
5
5
|
ponder.on("ChainlinkPriceOracle:block", async ({ event, context }) => {
|
|
6
6
|
const price = await context.client.readContract({
|
|
@@ -5,13 +5,14 @@
|
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "ponder dev",
|
|
7
7
|
"start": "ponder start",
|
|
8
|
+
"db": "ponder db",
|
|
8
9
|
"codegen": "ponder codegen",
|
|
9
10
|
"serve": "ponder serve",
|
|
10
11
|
"lint": "eslint .",
|
|
11
12
|
"typecheck": "tsc"
|
|
12
13
|
},
|
|
13
14
|
"dependencies": {
|
|
14
|
-
"
|
|
15
|
+
"ponder": "workspace:*",
|
|
15
16
|
"hono": "^4.5.0",
|
|
16
17
|
"viem": "^2.21.3"
|
|
17
18
|
},
|
|
@@ -1,27 +1,15 @@
|
|
|
1
|
+
/// <reference types="ponder/virtual" />
|
|
2
|
+
|
|
3
|
+
declare module "ponder:internal" {
|
|
4
|
+
const config: typeof import("./ponder.config.ts");
|
|
5
|
+
const schema: typeof import("./ponder.schema.ts");
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
declare module "ponder:schema" {
|
|
9
|
+
export * from "./ponder.schema.ts";
|
|
10
|
+
}
|
|
11
|
+
|
|
1
12
|
// This file enables type checking and editor autocomplete for this Ponder project.
|
|
2
13
|
// After upgrading, you may find that changes have been made to this file.
|
|
3
14
|
// If this happens, please commit the changes. Do not manually edit this file.
|
|
4
15
|
// See https://ponder.sh/docs/getting-started/installation#typescript for more information.
|
|
5
|
-
|
|
6
|
-
declare module "@/generated" {
|
|
7
|
-
import type { Virtual } from "@ponder/core";
|
|
8
|
-
|
|
9
|
-
type config = typeof import("./ponder.config.ts").default;
|
|
10
|
-
type schema = typeof import("./ponder.schema.ts");
|
|
11
|
-
|
|
12
|
-
export const ponder: Virtual.Registry<config, schema>;
|
|
13
|
-
|
|
14
|
-
export type EventNames = Virtual.EventNames<config>;
|
|
15
|
-
export type Event<name extends EventNames = EventNames> = Virtual.Event<
|
|
16
|
-
config,
|
|
17
|
-
name
|
|
18
|
-
>;
|
|
19
|
-
export type Context<name extends EventNames = EventNames> = Virtual.Context<
|
|
20
|
-
config,
|
|
21
|
-
schema,
|
|
22
|
-
name
|
|
23
|
-
>;
|
|
24
|
-
export type ApiContext = Virtual.ApiContext<schema>;
|
|
25
|
-
export type IndexingFunctionArgs<name extends EventNames = EventNames> =
|
|
26
|
-
Virtual.IndexingFunctionArgs<config, schema, name>;
|
|
27
|
-
}
|