Skip to content

Commit ce9ea49

Browse files
tk-olightwalker-ethvercel[bot]
authored
feat(ponder-sdk): create Ponder Client (#1602)
Co-authored-by: lightwalker.eth <126201998+lightwalker-eth@users.noreply.github.com> Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
1 parent a14120d commit ce9ea49

22 files changed

Lines changed: 571 additions & 5 deletions

.changeset/config.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@
1616
"@ensnode/ponder-metadata",
1717
"@ensnode/ensnode-schema",
1818
"@ensnode/ensnode-react",
19-
"@ensnode/ponder-subgraph",
2019
"@ensnode/ensnode-sdk",
20+
"@ensnode/ponder-sdk",
21+
"@ensnode/ponder-subgraph",
2122
"@ensnode/shared-configs",
2223
"@docs/ensnode",
2324
"@docs/ensrainbow",

.changeset/cozy-turkeys-fix.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@ensnode/ponder-sdk": minor
3+
---
4+
5+
Introduce the `ponder-sdk` package, including an initial `PonderClient` implementation.

.github/workflows/release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ jobs:
104104
or .name == "@ensnode/ensrainbow-sdk"
105105
or .name == "@ensnode/namehash-ui"
106106
or .name == "@ensnode/ponder-metadata"
107+
or .name == "@ensnode/ponder-sdk"
107108
or .name == "@ensnode/ponder-subgraph"
108109
))
109110

.github/workflows/release_preview.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,8 +305,9 @@ jobs:
305305
pnpm add @ensnode/ensrainbow-sdk@${{ needs.validate-and-prepare.outputs.dist-tag }}
306306
pnpm add @ensnode/ensnode-schema@${{ needs.validate-and-prepare.outputs.dist-tag }}
307307
pnpm add @ensnode/ensnode-sdk@${{ needs.validate-and-prepare.outputs.dist-tag }}
308-
pnpm add @ensnode/ponder-subgraph@${{ needs.validate-and-prepare.outputs.dist-tag }}
309308
pnpm add @ensnode/ponder-metadata@${{ needs.validate-and-prepare.outputs.dist-tag }}
309+
pnpm add @ensnode/ponder-sdk@${{ needs.validate-and-prepare.outputs.dist-tag }}
310+
pnpm add @ensnode/ponder-subgraph@${{ needs.validate-and-prepare.outputs.dist-tag }}
310311
pnpm add @ensnode/ens-referrals@${{ needs.validate-and-prepare.outputs.dist-tag }}
311312
pnpm add @ensnode/namehash-ui@${{ needs.validate-and-prepare.outputs.dist-tag }}
312313

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,15 +173,19 @@ TypeScript library for interacting with the [ENSRainbow API](apps/ensrainbow).
173173

174174
### [`packages/ensnode-schema`](packages/ensnode-schema)
175175

176-
Shared Drizzle schema definitions used by ENSNode
176+
Shared Drizzle schema definitions used by ENSNode.
177+
178+
### [`packages/ponder-sdk`](packages/ponder-sdk)
179+
180+
A utility library for interacting with Ponder apps and data.
177181

178182
### [`packages/ponder-subgraph`](packages/ponder-subgraph)
179183

180-
Subgraph-compatible GraphQL API
184+
Subgraph-compatible GraphQL API.
181185

182186
### [`packages/shared-configs`](packages/shared-configs)
183187

184-
Shared internal configuration files
188+
Shared internal configuration files.
185189

186190
## Docs
187191

packages/ponder-sdk/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 NameHash
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

packages/ponder-sdk/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Ponder SDK
2+
3+
This package is a utility library for interacting with Ponder apps and data.

packages/ponder-sdk/package.json

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{
2+
"name": "@ensnode/ponder-sdk",
3+
"version": "1.5.1",
4+
"type": "module",
5+
"description": "A utility library for interacting with Ponder apps and data.",
6+
"license": "MIT",
7+
"repository": {
8+
"type": "git",
9+
"url": "git+https://github.com/namehash/ensnode.git",
10+
"directory": "packages/ponder-sdk"
11+
},
12+
"homepage": "https://github.com/namehash/ensnode/tree/main/packages/ponder-sdk",
13+
"keywords": [
14+
"ENSNode",
15+
"Ponder"
16+
],
17+
"files": [
18+
"dist"
19+
],
20+
"exports": {
21+
".": "./src/index.ts"
22+
},
23+
"publishConfig": {
24+
"access": "public",
25+
"exports": {
26+
".": {
27+
"import": {
28+
"types": "./dist/index.d.ts",
29+
"default": "./dist/index.js"
30+
},
31+
"require": {
32+
"types": "./dist/index.d.cts",
33+
"default": "./dist/index.cjs"
34+
}
35+
}
36+
},
37+
"main": "./dist/index.cjs",
38+
"module": "./dist/index.js",
39+
"types": "./dist/index.d.ts"
40+
},
41+
"scripts": {
42+
"prepublish": "tsup",
43+
"typecheck": "tsc --noEmit",
44+
"test": "vitest",
45+
"lint": "biome check --write .",
46+
"lint:ci": "biome ci"
47+
},
48+
"devDependencies": {
49+
"@ensnode/shared-configs": "workspace:*",
50+
"@types/node": "catalog:",
51+
"tsup": "catalog:",
52+
"typescript": "catalog:",
53+
"vitest": "catalog:",
54+
"zod": "catalog:"
55+
},
56+
"peerDependencies": {
57+
"zod": "catalog:"
58+
}
59+
}

packages/ponder-sdk/src/blocks.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import { z } from "zod/v4";
2+
3+
import { nonnegativeIntegerSchema } from "./numbers";
4+
import { unixTimestampSchema } from "./time";
5+
6+
//// Block Number
7+
8+
export const blockNumberSchema = nonnegativeIntegerSchema;
9+
10+
/**
11+
* Block Number
12+
*
13+
* Guaranteed to be a non-negative integer.
14+
*/
15+
export type BlockNumber = z.infer<typeof blockNumberSchema>;
16+
17+
export const blockRefSchema = z.object({
18+
number: blockNumberSchema,
19+
timestamp: unixTimestampSchema,
20+
});
21+
22+
/**
23+
* BlockRef
24+
*
25+
* Reference to a block.
26+
*/
27+
export type BlockRef = z.infer<typeof blockRefSchema>;

packages/ponder-sdk/src/chains.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import type { z } from "zod/v4";
2+
3+
import { positiveIntegerSchema } from "./numbers";
4+
5+
// Chain ID
6+
7+
export const chainIdSchema = positiveIntegerSchema;
8+
9+
/**
10+
* Chain ID
11+
*
12+
* Represents a unique identifier for a chain.
13+
* Guaranteed to be a positive integer.
14+
*
15+
* Chain id standards are organized by the Ethereum Community @ https://github.com/ethereum-lists/chains
16+
**/
17+
export type ChainId = z.infer<typeof chainIdSchema>;

0 commit comments

Comments
 (0)