create-ponder 0.10.26 → 0.11.0

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 CHANGED
@@ -55,7 +55,7 @@ pnpm dev
55
55
  yarn dev
56
56
  ```
57
57
 
58
- ### 3. Add contracts & networks
58
+ ### 3. Add contracts & chains
59
59
 
60
60
  Ponder fetches event logs for the contracts added to `ponder.config.ts`, and passes those events to the indexing functions you write.
61
61
 
@@ -63,21 +63,20 @@ Ponder fetches event logs for the contracts added to `ponder.config.ts`, and pas
63
63
  // ponder.config.ts
64
64
 
65
65
  import { createConfig } from "ponder";
66
- import { http } from "viem";
67
66
 
68
67
  import { BaseRegistrarAbi } from "./abis/BaseRegistrar";
69
68
 
70
69
  export default createConfig({
71
- networks: {
70
+ chains: {
72
71
  mainnet: {
73
- chainId: 1,
74
- transport: http("https://eth-mainnet.g.alchemy.com/v2/...")
72
+ id: 1,
73
+ rpc: "https://eth-mainnet.g.alchemy.com/v2/...",
75
74
  },
76
75
  },
77
76
  contracts: {
78
77
  BaseRegistrar: {
79
78
  abi: BaseRegistrarAbi,
80
- network: "mainnet",
79
+ chain: "mainnet",
81
80
  address: "0x57f1887a8BF19b14fC0dF6Fd9B2acc9Af147eA85",
82
81
  startBlock: 9380410,
83
82
  },
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.10.26",
19
+ version: "0.11.0",
20
20
  type: "module",
21
21
  description: "A CLI tool to create Ponder apps",
22
22
  license: "MIT",
@@ -210,17 +210,17 @@ var fromEtherscan = async ({
210
210
  }
211
211
  }
212
212
  const config = {
213
- networks: {
213
+ chains: {
214
214
  [name]: {
215
- chainId,
216
- transport: `http(process.env.PONDER_RPC_URL_${chainId})`
215
+ id: chainId,
216
+ rpc: `http(process.env.PONDER_RPC_URL_${chainId})`
217
217
  }
218
218
  },
219
219
  contracts: {
220
220
  [contractName]: {
221
221
  abi: abiConfig,
222
222
  address: contractAddress,
223
- network: name,
223
+ chain: name,
224
224
  startBlock: blockNumber ?? void 0
225
225
  }
226
226
  }
@@ -549,7 +549,7 @@ var fromSubgraphId = async ({
549
549
  const contracts = {};
550
550
  manifest.dataSources.forEach((d) => {
551
551
  contracts[d.name] = {
552
- network: d.network,
552
+ chain: d.network,
553
553
  address: d.source.address,
554
554
  startBlock: d.source.startBlock
555
555
  };
@@ -579,11 +579,11 @@ var fromSubgraphId = async ({
579
579
  );
580
580
  const ponderContracts = dataSources.map((sourceInvalid) => {
581
581
  const source = validateGraphProtocolSource(sourceInvalid);
582
- const network = source.network || "mainnet";
582
+ const chain = source.network || "mainnet";
583
583
  const abiRelativePath = `./abis/${source.source.abi}Abi.ts`;
584
584
  return {
585
585
  name: source.name,
586
- network,
586
+ chain,
587
587
  address: source.source.address,
588
588
  abi: {
589
589
  abi: abis[source.source.abi],
@@ -594,18 +594,18 @@ var fromSubgraphId = async ({
594
594
  };
595
595
  });
596
596
  const contractsObject = {};
597
- const networksObject = {};
597
+ const chainsObject = {};
598
598
  ponderContracts.forEach((pc) => {
599
- const chainId = getGraphProtocolChainId(pc.network);
599
+ const chainId = getGraphProtocolChainId(pc.chain);
600
600
  contractsObject[pc.name] = pc;
601
- networksObject[pc.network] = {
602
- chainId,
603
- transport: `http(process.env.PONDER_RPC_URL_${chainId})`
601
+ chainsObject[pc.chain] = {
602
+ id: chainId,
603
+ rpc: `process.env.PONDER_RPC_URL_${chainId}!`
604
604
  };
605
605
  contractsObject[pc.name].name = void 0;
606
606
  });
607
607
  const config = {
608
- networks: networksObject,
608
+ chains: chainsObject,
609
609
  contracts: contractsObject
610
610
  };
611
611
  const warnings = [];
@@ -870,7 +870,6 @@ async function run({
870
870
  if (config) {
871
871
  const configContent = `
872
872
  import { createConfig${Object.values(config.contracts).some((c) => Array.isArray(c.abi)) ? ", mergeAbis" : ""} } from "ponder";
873
- import { http } from "viem";
874
873
 
875
874
  ${Object.values(config.contracts).flatMap((c) => c.abi).filter(
876
875
  (tag, index, array) => array.findIndex((t) => t.dir === tag.dir) === index
@@ -879,10 +878,10 @@ async function run({
879
878
  ).join("\n")}
880
879
 
881
880
  export default createConfig({
882
- networks: ${JSON.stringify(config.networks).replaceAll(
881
+ chains: ${JSON.stringify(config.chains).replaceAll(
883
882
  /"process.env.PONDER_RPC_URL_(.*?)"/g,
884
883
  "process.env.PONDER_RPC_URL_$1"
885
- ).replaceAll(/"http\((.*?)\)"/g, "http($1)")},
884
+ )},
886
885
  contracts: ${JSON.stringify(
887
886
  Object.entries(config.contracts).reduce(
888
887
  (acc, [name, c]) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-ponder",
3
- "version": "0.10.26",
3
+ "version": "0.11.0",
4
4
  "type": "module",
5
5
  "description": "A CLI tool to create Ponder apps",
6
6
  "license": "MIT",
@@ -1,18 +1,17 @@
1
1
  import { createConfig } from "ponder";
2
- import { http } from "viem";
3
2
 
4
3
  import { ExampleContractAbi } from "./abis/ExampleContractAbi";
5
4
 
6
5
  export default createConfig({
7
- networks: {
6
+ chains: {
8
7
  mainnet: {
9
- chainId: 1,
10
- transport: http(process.env.PONDER_RPC_URL_1),
8
+ id: 1,
9
+ rpc: process.env.PONDER_RPC_URL_1!,
11
10
  },
12
11
  },
13
12
  contracts: {
14
13
  ExampleContract: {
15
- network: "mainnet",
14
+ chain: "mainnet",
16
15
  abi: ExampleContractAbi,
17
16
  address: "0x0000000000000000000000000000000000000000",
18
17
  startBlock: 1234567,
@@ -1,16 +1,15 @@
1
1
  import { createConfig } from "ponder";
2
- import { http } from "viem";
3
2
 
4
3
  export default createConfig({
5
- networks: {
4
+ chains: {
6
5
  mainnet: {
7
- chainId: 1,
8
- transport: http(process.env.PONDER_RPC_URL_1),
6
+ id: 1,
7
+ rpc: process.env.PONDER_RPC_URL_1,
9
8
  },
10
9
  },
11
10
  accounts: {
12
11
  BeaverBuilder: {
13
- network: "mainnet",
12
+ chain: "mainnet",
14
13
  startBlock: "latest",
15
14
  address: "0x95222290DD7278Aa3Ddd389Cc1E1d165CC4BAfe5",
16
15
  },
@@ -1,17 +1,16 @@
1
1
  import { createConfig } from "ponder";
2
- import { http } from "viem";
3
2
  import { erc20ABI } from "./abis/erc20ABI";
4
3
 
5
4
  export default createConfig({
6
- networks: {
5
+ chains: {
7
6
  mainnet: {
8
- chainId: 1,
9
- transport: http(process.env.PONDER_RPC_URL_1),
7
+ id: 1,
8
+ rpc: process.env.PONDER_RPC_URL_1,
10
9
  },
11
10
  },
12
11
  contracts: {
13
12
  ERC20: {
14
- network: "mainnet",
13
+ chain: "mainnet",
15
14
  abi: erc20ABI,
16
15
  address: "0x32353A6C91143bfd6C7d363B546e62a9A2489A20",
17
16
  startBlock: 13142655,
@@ -1,16 +1,15 @@
1
1
  import { createConfig } from "ponder";
2
- import { http } from "viem";
3
2
 
4
3
  export default createConfig({
5
- networks: {
4
+ chains: {
6
5
  mainnet: {
7
- chainId: 1,
8
- transport: http(process.env.PONDER_RPC_URL_1),
6
+ id: 1,
7
+ rpc: process.env.PONDER_RPC_URL_1,
9
8
  },
10
9
  },
11
10
  blocks: {
12
11
  ChainlinkPriceOracle: {
13
- network: "mainnet",
12
+ chain: "mainnet",
14
13
  startBlock: 19_750_000,
15
14
  interval: 5, // every minute
16
15
  },
@@ -1,17 +1,17 @@
1
1
  import { createConfig } from "ponder";
2
- import { http, multicall3Abi } from "viem";
2
+ import { multicall3Abi } from "viem";
3
3
  import { mainnet } from "viem/chains";
4
4
 
5
5
  export default createConfig({
6
- networks: {
6
+ chains: {
7
7
  mainnet: {
8
- chainId: 1,
9
- transport: http(process.env.PONDER_RPC_URL_1),
8
+ id: 1,
9
+ rpc: process.env.PONDER_RPC_URL_1,
10
10
  },
11
11
  },
12
12
  contracts: {
13
13
  multicall3: {
14
- network: "mainnet",
14
+ chain: "mainnet",
15
15
  abi: multicall3Abi,
16
16
  address: mainnet.contracts.multicall3.address,
17
17
  startBlock: 19_800_000,
@@ -1,8 +1,6 @@
1
1
  import { parseAbiItem } from "abitype";
2
2
  import { createConfig, factory } from "ponder";
3
3
 
4
- import { http } from "viem";
5
-
6
4
  import { LlamaCoreAbi } from "./abis/LlamaCoreAbi";
7
5
  import { LlamaPolicyAbi } from "./abis/LlamaPolicyAbi";
8
6
 
@@ -11,15 +9,15 @@ const llamaFactoryEvent = parseAbiItem(
11
9
  );
12
10
 
13
11
  export default createConfig({
14
- networks: {
12
+ chains: {
15
13
  sepolia: {
16
- chainId: 11155111,
17
- transport: http(process.env.PONDER_RPC_URL_11155111),
14
+ id: 11155111,
15
+ rpc: process.env.PONDER_RPC_URL_11155111,
18
16
  },
19
17
  },
20
18
  contracts: {
21
19
  LlamaCore: {
22
- network: "sepolia",
20
+ chain: "sepolia",
23
21
  abi: LlamaCoreAbi,
24
22
  address: factory({
25
23
  address: "0xFf5d4E226D9A3496EECE31083a8F493edd79AbEB",
@@ -29,7 +27,7 @@ export default createConfig({
29
27
  startBlock: 4121269,
30
28
  },
31
29
  LlamaPolicy: {
32
- network: "sepolia",
30
+ chain: "sepolia",
33
31
  abi: LlamaPolicyAbi,
34
32
  address: factory({
35
33
  address: "0xFf5d4E226D9A3496EECE31083a8F493edd79AbEB",
@@ -1,18 +1,17 @@
1
1
  import { createConfig } from "ponder";
2
- import { http } from "viem";
3
2
 
4
3
  import { PrimitiveManagerAbi } from "./abis/PrimitiveManagerAbi";
5
4
 
6
5
  export default createConfig({
7
- networks: {
6
+ chains: {
8
7
  mainnet: {
9
- chainId: 1,
10
- transport: http(process.env.PONDER_RPC_URL_1),
8
+ id: 1,
9
+ rpc: process.env.PONDER_RPC_URL_1,
11
10
  },
12
11
  },
13
12
  contracts: {
14
13
  PrimitiveManager: {
15
- network: "mainnet",
14
+ chain: "mainnet",
16
15
  abi: PrimitiveManagerAbi,
17
16
  address: "0x54522dA62a15225C95b01bD61fF58b866C50471f",
18
17
  startBlock: 14438081,
@@ -1,33 +1,32 @@
1
1
  import { createConfig } from "ponder";
2
- import { http } from "viem";
3
2
 
4
3
  import { weth9Abi } from "./abis/weth9Abi";
5
4
 
6
5
  export default createConfig({
7
6
  ordering: "multichain",
8
- networks: {
7
+ chains: {
9
8
  mainnet: {
10
- chainId: 1,
11
- transport: http(process.env.PONDER_RPC_URL_1),
9
+ id: 1,
10
+ rpc: process.env.PONDER_RPC_URL_1,
12
11
  },
13
12
  base: {
14
- chainId: 8453,
15
- transport: http(process.env.PONDER_RPC_URL_8453),
13
+ id: 8453,
14
+ rpc: process.env.PONDER_RPC_URL_8453,
16
15
  },
17
16
  optimism: {
18
- chainId: 10,
19
- transport: http(process.env.PONDER_RPC_URL_10),
17
+ id: 10,
18
+ rpc: process.env.PONDER_RPC_URL_10,
20
19
  },
21
20
  polygon: {
22
- chainId: 137,
23
- transport: http(process.env.PONDER_RPC_URL_137),
21
+ id: 137,
22
+ rpc: process.env.PONDER_RPC_URL_137,
24
23
  },
25
24
  },
26
25
  contracts: {
27
26
  weth9: {
28
27
  abi: weth9Abi,
29
28
  startBlock: "latest",
30
- network: {
29
+ chain: {
31
30
  mainnet: { address: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" },
32
31
  base: { address: "0x4200000000000000000000000000000000000006" },
33
32
  optimism: { address: "0x4200000000000000000000000000000000000006" },
@@ -1,19 +1,18 @@
1
1
  import { createConfig, mergeAbis } from "ponder";
2
- import { http } from "viem";
3
2
 
4
3
  import { RouterImplAbi } from "./abis/RouterImplAbi";
5
4
  import { RouterProxyAbi } from "./abis/RouterProxyAbi";
6
5
 
7
6
  export default createConfig({
8
- networks: {
7
+ chains: {
9
8
  mainnet: {
10
- chainId: 1,
11
- transport: http(process.env.PONDER_RPC_URL_1),
9
+ id: 1,
10
+ rpc: process.env.PONDER_RPC_URL_1,
12
11
  },
13
12
  },
14
13
  contracts: {
15
14
  AstariaRouter: {
16
- network: "mainnet",
15
+ chain: "mainnet",
17
16
  abi: mergeAbis([RouterProxyAbi, RouterImplAbi]),
18
17
  address: "0x42CDc5D4B05E8dACc2FCD181cbe0Cc86Ee14c439",
19
18
  startBlock: 17942156,
@@ -1,18 +1,17 @@
1
1
  import { createConfig } from "ponder";
2
- import { http } from "viem";
3
2
 
4
3
  import { FileStoreAbi } from "./abis/FileStoreAbi";
5
4
 
6
5
  export default createConfig({
7
- networks: {
6
+ chains: {
8
7
  mainnet: {
9
- chainId: 1,
10
- transport: http(process.env.PONDER_RPC_URL_1),
8
+ id: 1,
9
+ rpc: process.env.PONDER_RPC_URL_1,
11
10
  },
12
11
  },
13
12
  contracts: {
14
13
  FileStore: {
15
- network: "mainnet",
14
+ chain: "mainnet",
16
15
  abi: FileStoreAbi,
17
16
  address: "0x9746fD0A77829E12F8A9DBe70D7a322412325B91",
18
17
  startBlock: 15963553,
@@ -1,18 +1,17 @@
1
1
  import { createConfig } from "ponder";
2
- import { http } from "viem";
3
2
 
4
3
  import { FriendtechSharesV1Abi } from "./abis/FriendtechSharesV1Abi";
5
4
 
6
5
  export default createConfig({
7
- networks: {
6
+ chains: {
8
7
  base: {
9
- chainId: 8453,
10
- transport: http(process.env.PONDER_RPC_URL_8453),
8
+ id: 8453,
9
+ rpc: process.env.PONDER_RPC_URL_8453,
11
10
  },
12
11
  },
13
12
  contracts: {
14
13
  FriendtechSharesV1: {
15
- network: "base",
14
+ chain: "base",
16
15
  abi: FriendtechSharesV1Abi,
17
16
  address: "0xcf205808ed36593aa40a44f10c7f7c2f67d4a4d4",
18
17
  startBlock: 2430440,
@@ -1,15 +1,15 @@
1
1
  import { createConfig, factory } from "ponder";
2
- import { http, getAbiItem } from "viem";
2
+ import { getAbiItem } from "viem";
3
3
  import { UniswapV3FactoryAbi } from "./abis/UniswapV3FactoryAbi";
4
4
  import { UniswapV3PoolAbi } from "./abis/UniswapV3PoolAbi";
5
5
 
6
6
  export default createConfig({
7
- networks: {
8
- mainnet: { chainId: 1, transport: http(process.env.PONDER_RPC_URL_1) },
7
+ chains: {
8
+ mainnet: { id: 1, rpc: process.env.PONDER_RPC_URL_1 },
9
9
  },
10
10
  contracts: {
11
11
  UniswapV3Pool: {
12
- network: "mainnet",
12
+ chain: "mainnet",
13
13
  abi: UniswapV3PoolAbi,
14
14
  address: factory({
15
15
  address: "0x1F98431c8aD98523631AE4a59f267346ea31F984",
@@ -1,17 +1,16 @@
1
1
  import { createConfig } from "ponder";
2
- import { http } from "viem";
3
2
  import { erc1155ABI } from "./abis/erc1155Abi";
4
3
 
5
4
  export default createConfig({
6
- networks: {
5
+ chains: {
7
6
  mainnet: {
8
- chainId: 1,
9
- transport: http(process.env.PONDER_RPC_URL_1),
7
+ id: 1,
8
+ rpc: process.env.PONDER_RPC_URL_1,
10
9
  },
11
10
  },
12
11
  contracts: {
13
12
  ERC1155: {
14
- network: "mainnet",
13
+ chain: "mainnet",
15
14
  abi: erc1155ABI,
16
15
  address: "0x73da73ef3a6982109c4d5bdb0db9dd3e3783f313",
17
16
  startBlock: 12129118,
@@ -1,17 +1,16 @@
1
1
  import { createConfig } from "ponder";
2
- import { http } from "viem";
3
2
  import { erc20ABI } from "./abis/erc20ABI";
4
3
 
5
4
  export default createConfig({
6
- networks: {
5
+ chains: {
7
6
  mainnet: {
8
- chainId: 1,
9
- transport: http(process.env.PONDER_RPC_URL_1),
7
+ id: 1,
8
+ rpc: process.env.PONDER_RPC_URL_1,
10
9
  },
11
10
  },
12
11
  contracts: {
13
12
  ERC20: {
14
- network: "mainnet",
13
+ chain: "mainnet",
15
14
  abi: erc20ABI,
16
15
  address: "0x32353A6C91143bfd6C7d363B546e62a9A2489A20",
17
16
  startBlock: 13142655,
@@ -1,17 +1,16 @@
1
1
  import { createConfig } from "ponder";
2
- import { http } from "viem";
3
2
  import { erc4626ABI } from "./abis/erc4626ABI";
4
3
 
5
4
  export default createConfig({
6
- networks: {
5
+ chains: {
7
6
  mainnet: {
8
- chainId: 1,
9
- transport: http(process.env.PONDER_RPC_URL_1),
7
+ id: 1,
8
+ rpc: process.env.PONDER_RPC_URL_1,
10
9
  },
11
10
  },
12
11
  contracts: {
13
12
  ERC4626: {
14
- network: "mainnet",
13
+ chain: "mainnet",
15
14
  abi: erc4626ABI,
16
15
  address: "0xc21F107933612eCF5677894d45fc060767479A9b",
17
16
  startBlock: 15774471,
@@ -1,17 +1,16 @@
1
1
  import { createConfig } from "ponder";
2
- import { http } from "viem";
3
2
  import { erc721ABI } from "./abis/erc721ABI";
4
3
 
5
4
  export default createConfig({
6
- networks: {
5
+ chains: {
7
6
  arbitrum: {
8
- chainId: 42161,
9
- transport: http(process.env.PONDER_RPC_URL_42161),
7
+ id: 42161,
8
+ rpc: process.env.PONDER_RPC_URL_42161,
10
9
  },
11
10
  },
12
11
  contracts: {
13
12
  ERC721: {
14
- network: "arbitrum",
13
+ chain: "arbitrum",
15
14
  abi: erc721ABI,
16
15
  address: "0x6325439389E0797Ab35752B4F43a14C004f22A9c",
17
16
  startBlock: 3163146,