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.
Files changed (95) hide show
  1. package/README.md +7 -7
  2. package/dist/index.js +9 -4
  3. package/package.json +1 -1
  4. package/templates/empty/package.json +2 -1
  5. package/templates/empty/ponder-env.d.ts +11 -24
  6. package/templates/empty/ponder.config.ts +1 -1
  7. package/templates/empty/ponder.schema.ts +1 -1
  8. package/templates/empty/src/api/index.ts +2 -2
  9. package/templates/empty/src/index.ts +1 -1
  10. package/templates/etherscan/package.json +2 -1
  11. package/templates/etherscan/ponder-env.d.ts +11 -24
  12. package/templates/etherscan/ponder.schema.ts +1 -1
  13. package/templates/feature-accounts/_dot_env.local +5 -0
  14. package/templates/feature-accounts/_dot_eslintrc.json +3 -0
  15. package/templates/feature-accounts/_dot_gitignore +18 -0
  16. package/templates/feature-accounts/package.json +28 -0
  17. package/templates/feature-accounts/ponder-env.d.ts +15 -0
  18. package/templates/feature-accounts/ponder.config.ts +22 -0
  19. package/templates/feature-accounts/ponder.schema.ts +7 -0
  20. package/templates/feature-accounts/src/index.ts +22 -0
  21. package/templates/feature-accounts/tsconfig.json +26 -0
  22. package/templates/feature-api-functions/package.json +2 -3
  23. package/templates/feature-api-functions/ponder-env.d.ts +11 -23
  24. package/templates/feature-api-functions/ponder.config.ts +1 -1
  25. package/templates/feature-api-functions/ponder.schema.ts +1 -1
  26. package/templates/feature-api-functions/src/api/index.ts +3 -3
  27. package/templates/feature-api-functions/src/index.ts +2 -2
  28. package/templates/feature-blocks/package.json +2 -1
  29. package/templates/feature-blocks/ponder-env.d.ts +11 -23
  30. package/templates/feature-blocks/ponder.config.ts +1 -1
  31. package/templates/feature-blocks/ponder.schema.ts +1 -1
  32. package/templates/feature-blocks/src/index.ts +2 -2
  33. package/templates/feature-call-traces/package.json +2 -1
  34. package/templates/feature-call-traces/ponder-env.d.ts +11 -23
  35. package/templates/feature-call-traces/ponder.config.ts +2 -2
  36. package/templates/feature-call-traces/ponder.schema.ts +1 -1
  37. package/templates/feature-call-traces/src/index.ts +2 -2
  38. package/templates/feature-factory/package.json +2 -1
  39. package/templates/feature-factory/ponder-env.d.ts +11 -23
  40. package/templates/feature-factory/ponder.config.ts +6 -5
  41. package/templates/feature-factory/ponder.schema.ts +1 -1
  42. package/templates/feature-factory/src/LlamaCore.ts +1 -1
  43. package/templates/feature-filter/package.json +2 -1
  44. package/templates/feature-filter/ponder-env.d.ts +11 -23
  45. package/templates/feature-filter/ponder.config.ts +1 -1
  46. package/templates/feature-filter/ponder.schema.ts +1 -1
  47. package/templates/feature-filter/src/index.ts +2 -2
  48. package/templates/feature-multichain/package.json +2 -1
  49. package/templates/feature-multichain/ponder-env.d.ts +11 -23
  50. package/templates/feature-multichain/ponder.config.ts +1 -1
  51. package/templates/feature-multichain/ponder.schema.ts +1 -1
  52. package/templates/feature-multichain/src/index.ts +2 -2
  53. package/templates/feature-proxy/package.json +2 -1
  54. package/templates/feature-proxy/ponder-env.d.ts +11 -23
  55. package/templates/feature-proxy/ponder.config.ts +1 -1
  56. package/templates/feature-proxy/ponder.schema.ts +1 -1
  57. package/templates/feature-proxy/src/index.ts +2 -2
  58. package/templates/feature-read-contract/package.json +2 -1
  59. package/templates/feature-read-contract/ponder-env.d.ts +11 -23
  60. package/templates/feature-read-contract/ponder.config.ts +1 -1
  61. package/templates/feature-read-contract/ponder.schema.ts +1 -1
  62. package/templates/feature-read-contract/src/FileStore.ts +2 -2
  63. package/templates/project-friendtech/package.json +2 -1
  64. package/templates/project-friendtech/ponder-env.d.ts +11 -23
  65. package/templates/project-friendtech/ponder.config.ts +1 -1
  66. package/templates/project-friendtech/ponder.schema.ts +1 -1
  67. package/templates/project-friendtech/src/FriendtechSharesV1.ts +2 -2
  68. package/templates/project-uniswap-v3-flash/package.json +2 -1
  69. package/templates/project-uniswap-v3-flash/ponder-env.d.ts +11 -23
  70. package/templates/project-uniswap-v3-flash/ponder.config.ts +3 -3
  71. package/templates/project-uniswap-v3-flash/ponder.schema.ts +1 -1
  72. package/templates/project-uniswap-v3-flash/src/index.ts +2 -2
  73. package/templates/reference-erc1155/package.json +2 -1
  74. package/templates/reference-erc1155/ponder-env.d.ts +11 -23
  75. package/templates/reference-erc1155/ponder.config.ts +1 -1
  76. package/templates/reference-erc1155/ponder.schema.ts +1 -1
  77. package/templates/reference-erc1155/src/index.ts +2 -2
  78. package/templates/reference-erc20/package.json +2 -1
  79. package/templates/reference-erc20/ponder-env.d.ts +11 -23
  80. package/templates/reference-erc20/ponder.config.ts +1 -1
  81. package/templates/reference-erc20/ponder.schema.ts +1 -1
  82. package/templates/reference-erc20/src/index.ts +2 -2
  83. package/templates/reference-erc4626/package.json +2 -1
  84. package/templates/reference-erc4626/ponder-env.d.ts +11 -23
  85. package/templates/reference-erc4626/ponder.config.ts +1 -1
  86. package/templates/reference-erc4626/ponder.schema.ts +1 -1
  87. package/templates/reference-erc4626/src/index.ts +2 -2
  88. package/templates/reference-erc721/package.json +2 -1
  89. package/templates/reference-erc721/ponder-env.d.ts +11 -23
  90. package/templates/reference-erc721/ponder.config.ts +1 -1
  91. package/templates/reference-erc721/ponder.schema.ts +1 -1
  92. package/templates/reference-erc721/src/index.ts +2 -2
  93. package/templates/subgraph/package.json +2 -1
  94. package/templates/subgraph/ponder-env.d.ts +11 -29
  95. 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 "@ponder/core";
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 "@ponder/core";
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 "@/generated";
112
- import * as schema from "../ponder.schema";
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
- - `@ponder/core`
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/@ponder/core?label=License
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/@ponder/core
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.7.17",
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 "@ponder/core";
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 '@/generated'
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["@ponder/core"] = `^${package_default.version}`;
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-ponder",
3
- "version": "0.7.17",
3
+ "version": "0.8.1",
4
4
  "type": "module",
5
5
  "description": "A CLI tool to create Ponder apps",
6
6
  "license": "MIT",
@@ -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
- "@ponder/core": "^0.0.95",
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,4 +1,4 @@
1
- import { createConfig } from "@ponder/core";
1
+ import { createConfig } from "ponder";
2
2
  import { http } from "viem";
3
3
 
4
4
  import { ExampleContractAbi } from "./abis/ExampleContractAbi";
@@ -1,4 +1,4 @@
1
- import { onchainTable } from "@ponder/core";
1
+ import { onchainTable } from "ponder";
2
2
 
3
3
  export const example = onchainTable("example", (t) => ({
4
4
  id: t.text().primaryKey(),
@@ -1,5 +1,5 @@
1
- import { ponder } from "@/generated";
2
- import { graphql } from "@ponder/core";
1
+ import { ponder } from "ponder:registry";
2
+ import { graphql } from "ponder";
3
3
 
4
4
  ponder.use("/graphql", graphql());
5
5
  ponder.use("/", graphql());
@@ -1 +1 @@
1
- import { ponder } from "@/generated";
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
- "@ponder/core": "^0.0.95",
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,4 +1,4 @@
1
- import { onchainTable } from "@ponder/core";
1
+ import { onchainTable } from "ponder";
2
2
 
3
3
  export const example = onchainTable("example", (t) => ({
4
4
  id: t.text().primaryKey(),
@@ -0,0 +1,5 @@
1
+ # Mainnet RPC URL used for fetching blockchain data. Alchemy is recommended.
2
+ PONDER_RPC_URL_1=
3
+
4
+ # (Optional) Postgres database URL. If not provided, SQLite will be used.
5
+ DATABASE_URL=
@@ -0,0 +1,3 @@
1
+ {
2
+ "extends": "ponder"
3
+ }
@@ -0,0 +1,18 @@
1
+ # Dependencies
2
+ /node_modules
3
+
4
+ # Debug
5
+ npm-debug.log*
6
+ yarn-debug.log*
7
+ yarn-error.log*
8
+ .pnpm-debug.log*
9
+
10
+ # Misc
11
+ .DS_Store
12
+
13
+ # Env files
14
+ .env*.local
15
+
16
+ # Ponder
17
+ /generated/
18
+ /.ponder/
@@ -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,7 @@
1
+ import { onchainTable } from "ponder";
2
+
3
+ export const transactionEvents = onchainTable("transaction_events", (t) => ({
4
+ to: t.hex().primaryKey(),
5
+ value: t.bigint().notNull(),
6
+ data: t.hex().notNull(),
7
+ }));
@@ -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,4 +1,4 @@
1
- import { createConfig } from "@ponder/core";
1
+ import { createConfig } from "ponder";
2
2
  import { http } from "viem";
3
3
  import { erc20ABI } from "./abis/erc20ABI";
4
4
 
@@ -1,4 +1,4 @@
1
- import { index, onchainTable, primaryKey } from "@ponder/core";
1
+ import { index, onchainTable, primaryKey } from "ponder";
2
2
 
3
3
  export const account = onchainTable("account", (p) => ({
4
4
  address: p.hex().primaryKey(),
@@ -1,7 +1,7 @@
1
- import { ponder } from "@/generated";
2
- import { count, desc, eq, graphql, or, replaceBigInts } from "@ponder/core";
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 "@/generated";
1
+ import { ponder } from "ponder:registry";
2
2
  import {
3
3
  account,
4
4
  allowance,
5
5
  approvalEvent,
6
6
  transferEvent,
7
- } from "../ponder.schema";
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
- "@ponder/core": "workspace:*",
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,4 +1,4 @@
1
- import { createConfig } from "@ponder/core";
1
+ import { createConfig } from "ponder";
2
2
  import { http } from "viem";
3
3
 
4
4
  export default createConfig({
@@ -1,4 +1,4 @@
1
- import { onchainTable } from "@ponder/core";
1
+ import { onchainTable } from "ponder";
2
2
 
3
3
  export const chainlinkPrice = onchainTable("chainlink_price", (t) => ({
4
4
  timestamp: t.bigint().primaryKey(),
@@ -1,6 +1,6 @@
1
- import { ponder } from "@/generated";
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
- "@ponder/core": "workspace:*",
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,5 +1,5 @@
1
- import { createConfig } from "@ponder/core";
2
- import { http, Abi, multicall3Abi } from "viem";
1
+ import { createConfig } from "ponder";
2
+ import { http, multicall3Abi } from "viem";
3
3
  import { mainnet } from "viem/chains";
4
4
 
5
5
  export default createConfig({