create-ponder 0.0.10 → 0.0.12
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/dist/src/bin/create-ponder +25 -30
- package/dist/src/bin/create-ponder.d.ts +7 -0
- package/dist/src/helpers/detectPackageManager.d.ts +5 -0
- package/dist/src/helpers/detectPackageManager.js +65 -96
- package/dist/src/helpers/getEtherscanChainId.d.ts +4 -0
- package/dist/src/helpers/getEtherscanChainId.js +18 -46
- package/dist/src/helpers/getGraphProtocolChainId.d.ts +2 -0
- package/dist/src/helpers/getGraphProtocolChainId.js +36 -66
- package/dist/src/helpers/validateGraphProtocolSource.d.ts +27 -0
- package/dist/src/helpers/validateGraphProtocolSource.js +4 -32
- package/dist/src/index.d.ts +26 -0
- package/dist/src/index.js +99 -198
- package/dist/src/templates/basic.d.ts +3 -0
- package/dist/src/templates/basic.js +41 -86
- package/dist/src/templates/etherscan.d.ts +3 -0
- package/dist/src/templates/etherscan.js +102 -151
- package/dist/src/templates/subgraph.d.ts +3 -0
- package/dist/src/templates/subgraph.js +81 -136
- package/package.json +9 -18
|
@@ -1,169 +1,120 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
11
4
|
};
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
return to;
|
|
22
|
-
};
|
|
23
|
-
var __toESM = (mod, isNodeMode, target) => (
|
|
24
|
-
(target = mod != null ? __create(__getProtoOf(mod)) : {}),
|
|
25
|
-
__copyProps(
|
|
26
|
-
isNodeMode || !mod || !mod.__esModule
|
|
27
|
-
? __defProp(target, "default", { value: mod, enumerable: true })
|
|
28
|
-
: target,
|
|
29
|
-
mod
|
|
30
|
-
)
|
|
31
|
-
);
|
|
32
|
-
var __toCommonJS = (mod) =>
|
|
33
|
-
__copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
34
|
-
var etherscan_exports = {};
|
|
35
|
-
__export(etherscan_exports, {
|
|
36
|
-
fromEtherscan: () => fromEtherscan,
|
|
37
|
-
});
|
|
38
|
-
module.exports = __toCommonJS(etherscan_exports);
|
|
39
|
-
var import_node_fs = require("node:fs");
|
|
40
|
-
var import_node_path = __toESM(require("node:path"));
|
|
41
|
-
var import_node_fetch = __toESM(require("node-fetch"));
|
|
42
|
-
var import_prettier = __toESM(require("prettier"));
|
|
43
|
-
var import_getEtherscanChainId = require("../helpers/getEtherscanChainId");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.fromEtherscan = void 0;
|
|
7
|
+
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
8
|
+
const node_fs_1 = require("node:fs");
|
|
9
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
10
|
+
const node_fetch_1 = __importDefault(require("node-fetch"));
|
|
11
|
+
const prettier_1 = __importDefault(require("prettier"));
|
|
12
|
+
const getEtherscanChainId_1 = require("../helpers/getEtherscanChainId");
|
|
44
13
|
const delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
45
14
|
const fromEtherscan = async (options) => {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
await
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
await
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
);
|
|
75
|
-
const abiRelativePath = `./abis/${contractName}.json`;
|
|
76
|
-
const abiAbsolutePath = import_node_path.default.join(
|
|
77
|
-
ponderRootDir,
|
|
78
|
-
abiRelativePath
|
|
79
|
-
);
|
|
80
|
-
(0, import_node_fs.writeFileSync)(
|
|
81
|
-
abiAbsolutePath,
|
|
82
|
-
import_prettier.default.format(abi, { parser: "json" })
|
|
83
|
-
);
|
|
84
|
-
const schemaGraphqlFileContents = `
|
|
15
|
+
const { ponderRootDir } = options;
|
|
16
|
+
if (!options.fromEtherscan) {
|
|
17
|
+
throw new Error(`Internal error: fromEtherscan undefined`);
|
|
18
|
+
}
|
|
19
|
+
const apiKey = options.etherscanApiKey || process.env.ETHERSCAN_API_KEY;
|
|
20
|
+
const url = new URL(options.fromEtherscan);
|
|
21
|
+
const network = (0, getEtherscanChainId_1.getNetworkByEtherscanHostname)(url.hostname);
|
|
22
|
+
if (!network) {
|
|
23
|
+
throw new Error(`Unrecognized etherscan hostname: ${url.hostname}`);
|
|
24
|
+
}
|
|
25
|
+
const apiUrl = `https://api.${url.hostname}/api`;
|
|
26
|
+
const contractAddress = url.pathname.slice(1).split("/")[1];
|
|
27
|
+
const txHash = await getContractCreationTxn(contractAddress, apiUrl, apiKey);
|
|
28
|
+
if (!apiKey) {
|
|
29
|
+
console.log("(1/2) Waiting 5 seconds for Etherscan API rate limit");
|
|
30
|
+
await delay(5000);
|
|
31
|
+
}
|
|
32
|
+
const blockNumber = await getTxBlockNumber(txHash, apiUrl, apiKey);
|
|
33
|
+
if (!apiKey) {
|
|
34
|
+
console.log("(2/2) Waiting 5 seconds for Etherscan API rate limit");
|
|
35
|
+
await delay(5000);
|
|
36
|
+
}
|
|
37
|
+
const { abi, contractName } = await getContractAbiAndName(contractAddress, apiUrl, apiKey);
|
|
38
|
+
// Write contract ABI file.
|
|
39
|
+
const abiRelativePath = `./abis/${contractName}.json`;
|
|
40
|
+
const abiAbsolutePath = node_path_1.default.join(ponderRootDir, abiRelativePath);
|
|
41
|
+
(0, node_fs_1.writeFileSync)(abiAbsolutePath, prettier_1.default.format(abi, { parser: "json" }));
|
|
42
|
+
const schemaGraphqlFileContents = `
|
|
85
43
|
type ExampleEntity @entity {
|
|
86
44
|
id: ID!
|
|
87
45
|
name: String!
|
|
88
46
|
}
|
|
89
47
|
`;
|
|
90
|
-
|
|
91
|
-
ponderRootDir,
|
|
92
|
-
"
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
address: contractAddress,
|
|
118
|
-
startBlock: blockNumber,
|
|
119
|
-
},
|
|
120
|
-
],
|
|
121
|
-
};
|
|
122
|
-
return ponderConfig;
|
|
48
|
+
// Generate the schema.graphql file.
|
|
49
|
+
const ponderSchemaFilePath = node_path_1.default.join(ponderRootDir, "schema.graphql");
|
|
50
|
+
(0, node_fs_1.writeFileSync)(ponderSchemaFilePath, prettier_1.default.format(schemaGraphqlFileContents, { parser: "graphql" }));
|
|
51
|
+
// Build and return the partial ponder config.
|
|
52
|
+
const ponderConfig = {
|
|
53
|
+
plugins: ["graphqlPlugin()"],
|
|
54
|
+
database: {
|
|
55
|
+
kind: "sqlite",
|
|
56
|
+
},
|
|
57
|
+
networks: [
|
|
58
|
+
{
|
|
59
|
+
name: network.name,
|
|
60
|
+
chainId: network.chainId,
|
|
61
|
+
rpcUrl: `process.env.PONDER_RPC_URL_${network.chainId}`,
|
|
62
|
+
},
|
|
63
|
+
],
|
|
64
|
+
sources: [
|
|
65
|
+
{
|
|
66
|
+
name: contractName,
|
|
67
|
+
network: network.name,
|
|
68
|
+
abi: abiRelativePath,
|
|
69
|
+
address: contractAddress,
|
|
70
|
+
startBlock: blockNumber,
|
|
71
|
+
},
|
|
72
|
+
],
|
|
73
|
+
};
|
|
74
|
+
return ponderConfig;
|
|
123
75
|
};
|
|
76
|
+
exports.fromEtherscan = fromEtherscan;
|
|
124
77
|
const fetchEtherscan = async (url) => {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
78
|
+
const response = await (0, node_fetch_1.default)(url);
|
|
79
|
+
const data = await response.json();
|
|
80
|
+
if (data.status === "0") {
|
|
81
|
+
throw new Error(`Etherscan API error: ${data.result}`);
|
|
82
|
+
}
|
|
83
|
+
return data;
|
|
131
84
|
};
|
|
132
85
|
const getContractCreationTxn = async (contractAddress, apiUrl, apiKey) => {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
86
|
+
const searchParams = new URLSearchParams({
|
|
87
|
+
module: "contract",
|
|
88
|
+
action: "getcontractcreation",
|
|
89
|
+
contractaddresses: contractAddress,
|
|
90
|
+
});
|
|
91
|
+
if (apiKey)
|
|
92
|
+
searchParams.append("apikey", apiKey);
|
|
93
|
+
const data = await fetchEtherscan(`${apiUrl}?${searchParams.toString()}`);
|
|
94
|
+
return data.result[0].txHash;
|
|
141
95
|
};
|
|
142
96
|
const getTxBlockNumber = async (txHash, apiUrl, apiKey) => {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
97
|
+
const searchParams = new URLSearchParams({
|
|
98
|
+
module: "proxy",
|
|
99
|
+
action: "eth_getTransactionByHash",
|
|
100
|
+
txhash: txHash,
|
|
101
|
+
});
|
|
102
|
+
if (apiKey)
|
|
103
|
+
searchParams.append("apikey", apiKey);
|
|
104
|
+
const data = await fetchEtherscan(`${apiUrl}?${searchParams.toString()}`);
|
|
105
|
+
const hexBlockNumber = data.result.blockNumber;
|
|
106
|
+
return parseInt(hexBlockNumber.slice(2), 16);
|
|
152
107
|
};
|
|
153
108
|
const getContractAbiAndName = async (contractAddress, apiUrl, apiKey) => {
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
109
|
+
const searchParams = new URLSearchParams({
|
|
110
|
+
module: "contract",
|
|
111
|
+
action: "getsourcecode",
|
|
112
|
+
address: contractAddress,
|
|
113
|
+
});
|
|
114
|
+
if (apiKey)
|
|
115
|
+
searchParams.append("apikey", apiKey);
|
|
116
|
+
const data = await fetchEtherscan(`${apiUrl}?${searchParams.toString()}`);
|
|
117
|
+
const abi = data.result[0].ABI;
|
|
118
|
+
const contractName = data.result[0].ContractName;
|
|
119
|
+
return { abi, contractName };
|
|
164
120
|
};
|
|
165
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
166
|
-
0 &&
|
|
167
|
-
(module.exports = {
|
|
168
|
-
fromEtherscan,
|
|
169
|
-
});
|
|
@@ -1,143 +1,88 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
11
4
|
};
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
return to;
|
|
22
|
-
};
|
|
23
|
-
var __toESM = (mod, isNodeMode, target) => (
|
|
24
|
-
(target = mod != null ? __create(__getProtoOf(mod)) : {}),
|
|
25
|
-
__copyProps(
|
|
26
|
-
isNodeMode || !mod || !mod.__esModule
|
|
27
|
-
? __defProp(target, "default", { value: mod, enumerable: true })
|
|
28
|
-
: target,
|
|
29
|
-
mod
|
|
30
|
-
)
|
|
31
|
-
);
|
|
32
|
-
var __toCommonJS = (mod) =>
|
|
33
|
-
__copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
34
|
-
var subgraph_exports = {};
|
|
35
|
-
__export(subgraph_exports, {
|
|
36
|
-
fromSubgraph: () => fromSubgraph,
|
|
37
|
-
});
|
|
38
|
-
module.exports = __toCommonJS(subgraph_exports);
|
|
39
|
-
var import_node_fs = require("node:fs");
|
|
40
|
-
var import_node_path = __toESM(require("node:path"));
|
|
41
|
-
var import_yaml = require("yaml");
|
|
42
|
-
var import_getGraphProtocolChainId = require("../helpers/getGraphProtocolChainId");
|
|
43
|
-
var import_validateGraphProtocolSource = require("../helpers/validateGraphProtocolSource");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.fromSubgraph = void 0;
|
|
7
|
+
const node_fs_1 = require("node:fs");
|
|
8
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
9
|
+
const yaml_1 = require("yaml");
|
|
10
|
+
const getGraphProtocolChainId_1 = require("../helpers/getGraphProtocolChainId");
|
|
11
|
+
const validateGraphProtocolSource_1 = require("../helpers/validateGraphProtocolSource");
|
|
44
12
|
const fromSubgraph = (options) => {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
),
|
|
63
|
-
{
|
|
64
|
-
encoding: "utf-8",
|
|
13
|
+
if (!options.fromSubgraph) {
|
|
14
|
+
throw new Error(`Internal error: fromSubgraph undefined`);
|
|
15
|
+
}
|
|
16
|
+
const { ponderRootDir } = options;
|
|
17
|
+
const subgraphRootDir = node_path_1.default.resolve(options.fromSubgraph);
|
|
18
|
+
const ponderNetworks = [];
|
|
19
|
+
let ponderSources = [];
|
|
20
|
+
// If the `--from-subgraph` option was passed, parse subgraph files
|
|
21
|
+
const subgraphRootDirPath = node_path_1.default.resolve(subgraphRootDir);
|
|
22
|
+
// Read and parse the subgraph YAML file.
|
|
23
|
+
let subgraphYamlRaw = "";
|
|
24
|
+
for (const subgraphYamlFileName of getGraphProtocolChainId_1.subgraphYamlFileNames) {
|
|
25
|
+
try {
|
|
26
|
+
subgraphYamlRaw = (0, node_fs_1.readFileSync)(node_path_1.default.join(subgraphRootDirPath, subgraphYamlFileName), {
|
|
27
|
+
encoding: "utf-8",
|
|
28
|
+
});
|
|
29
|
+
break;
|
|
65
30
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
31
|
+
catch (e) {
|
|
32
|
+
continue;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
if (subgraphYamlRaw === "") {
|
|
36
|
+
throw new Error(`subgraph.yaml file not found`);
|
|
70
37
|
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
const abiAbsolutePath = import_node_path.default.join(
|
|
111
|
-
subgraphRootDirPath,
|
|
112
|
-
abiPath
|
|
113
|
-
);
|
|
114
|
-
const abiFileName = import_node_path.default.basename(abiPath);
|
|
115
|
-
const ponderAbiRelativePath = `./abis/${abiFileName}`;
|
|
116
|
-
const ponderAbiAbsolutePath = import_node_path.default.join(
|
|
117
|
-
ponderRootDir,
|
|
118
|
-
ponderAbiRelativePath
|
|
119
|
-
);
|
|
120
|
-
(0, import_node_fs.copyFileSync)(abiAbsolutePath, ponderAbiAbsolutePath);
|
|
121
|
-
return {
|
|
122
|
-
name: source.name,
|
|
123
|
-
network,
|
|
124
|
-
address: source.source.address,
|
|
125
|
-
abi: ponderAbiRelativePath,
|
|
126
|
-
startBlock: source.source.startBlock,
|
|
127
|
-
};
|
|
38
|
+
const subgraphYaml = (0, yaml_1.parse)(subgraphYamlRaw);
|
|
39
|
+
// Copy over the schema.graphql file.
|
|
40
|
+
const subgraphSchemaFilePath = node_path_1.default.join(subgraphRootDirPath, subgraphYaml.schema.file);
|
|
41
|
+
const ponderSchemaFilePath = node_path_1.default.join(ponderRootDir, "schema.graphql");
|
|
42
|
+
(0, node_fs_1.copyFileSync)(subgraphSchemaFilePath, ponderSchemaFilePath);
|
|
43
|
+
// Build the ponder sources. Also copy over the ABI files for each source.
|
|
44
|
+
ponderSources = subgraphYaml.dataSources
|
|
45
|
+
.map(validateGraphProtocolSource_1.validateGraphProtocolSource)
|
|
46
|
+
.map((source) => {
|
|
47
|
+
const abiPath = source.mapping.abis.find((abi) => abi.name === source.name)?.file;
|
|
48
|
+
if (!abiPath) {
|
|
49
|
+
throw new Error(`ABI path not found for source: ${source.name}`);
|
|
50
|
+
}
|
|
51
|
+
const network = source.network || "mainnet";
|
|
52
|
+
const chainId = (0, getGraphProtocolChainId_1.getGraphProtocolChainId)(network);
|
|
53
|
+
if (!chainId || chainId === -1) {
|
|
54
|
+
throw new Error(`Unhandled network name: ${network}`);
|
|
55
|
+
}
|
|
56
|
+
if (!ponderNetworks.map((n) => n.name).includes(network)) {
|
|
57
|
+
ponderNetworks.push({
|
|
58
|
+
name: network,
|
|
59
|
+
chainId: chainId,
|
|
60
|
+
rpcUrl: `process.env.PONDER_RPC_URL_${chainId}`,
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
// Copy the ABI file.
|
|
64
|
+
const abiAbsolutePath = node_path_1.default.join(subgraphRootDirPath, abiPath);
|
|
65
|
+
const abiFileName = node_path_1.default.basename(abiPath);
|
|
66
|
+
const ponderAbiRelativePath = `./abis/${abiFileName}`;
|
|
67
|
+
const ponderAbiAbsolutePath = node_path_1.default.join(ponderRootDir, ponderAbiRelativePath);
|
|
68
|
+
(0, node_fs_1.copyFileSync)(abiAbsolutePath, ponderAbiAbsolutePath);
|
|
69
|
+
return {
|
|
70
|
+
name: source.name,
|
|
71
|
+
network: network,
|
|
72
|
+
address: source.source.address,
|
|
73
|
+
abi: ponderAbiRelativePath,
|
|
74
|
+
startBlock: source.source.startBlock,
|
|
75
|
+
};
|
|
128
76
|
});
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
77
|
+
// Build the partial ponder config.
|
|
78
|
+
const ponderConfig = {
|
|
79
|
+
plugins: ["graphqlPlugin()"],
|
|
80
|
+
database: {
|
|
81
|
+
kind: "sqlite",
|
|
82
|
+
},
|
|
83
|
+
networks: ponderNetworks,
|
|
84
|
+
sources: ponderSources,
|
|
85
|
+
};
|
|
86
|
+
return ponderConfig;
|
|
138
87
|
};
|
|
139
|
-
|
|
140
|
-
0 &&
|
|
141
|
-
(module.exports = {
|
|
142
|
-
fromSubgraph,
|
|
143
|
-
});
|
|
88
|
+
exports.fromSubgraph = fromSubgraph;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-ponder",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.12",
|
|
4
4
|
"description": "Tool to bootstrap a Ponder project",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "olias.eth",
|
|
@@ -10,19 +10,6 @@
|
|
|
10
10
|
"bin": {
|
|
11
11
|
"create-ponder": "dist/src/bin/create-ponder"
|
|
12
12
|
},
|
|
13
|
-
"scripts": {
|
|
14
|
-
"clean": "rm -rf dist",
|
|
15
|
-
"typecheck": "tsc",
|
|
16
|
-
"lint": "eslint src",
|
|
17
|
-
"format": "prettier src --write",
|
|
18
|
-
"replace-paths": "tsconfig-replace-paths --src src",
|
|
19
|
-
"esbuild": "esbuild `find . \\( -name '*.ts' \\)` --platform=node --format=cjs --outdir=dist && $npm_execpath run replace-paths",
|
|
20
|
-
"build": "$npm_execpath run clean && $npm_execpath run esbuild && mv dist/src/bin/create-ponder.js dist/src/bin/create-ponder",
|
|
21
|
-
"format-dist": "prettier dist --write --loglevel warn",
|
|
22
|
-
"prerelease": "$npm_execpath run build && $npm_execpath run format-dist",
|
|
23
|
-
"release": "$npm_execpath run prerelease && VERSION=$(npm version patch) && npm publish && git add ./package.json && git commit -m \"release(create-ponder): $VERSION\"",
|
|
24
|
-
"test": "$npm_execpath build && export $(grep -v '^#' .env.local | xargs) && jest"
|
|
25
|
-
},
|
|
26
13
|
"dependencies": {
|
|
27
14
|
"@ethersproject/abi": "^5.6.4",
|
|
28
15
|
"@ethersproject/providers": "^5.6.8",
|
|
@@ -35,14 +22,18 @@
|
|
|
35
22
|
"yaml": "^2.1.1"
|
|
36
23
|
},
|
|
37
24
|
"devDependencies": {
|
|
38
|
-
"@ponder/core": "latest",
|
|
39
25
|
"@types/jest": "^29.2.3",
|
|
40
26
|
"@types/node": "^18.7.8",
|
|
41
27
|
"@types/node-fetch": "2",
|
|
42
28
|
"@types/prettier": "^2.7.1",
|
|
43
|
-
"esbuild": "^0.15.2",
|
|
44
29
|
"jest": "^29.3.1",
|
|
45
30
|
"tsconfig-replace-paths": "^0.0.11",
|
|
46
|
-
"typescript": "^4.5.5"
|
|
31
|
+
"typescript": "^4.5.5",
|
|
32
|
+
"@ponder/core": "0.0.23"
|
|
33
|
+
},
|
|
34
|
+
"scripts": {
|
|
35
|
+
"build": "rm -rf dist && tsc && tsconfig-replace-paths --src . && mv dist/src/bin/create-ponder.js dist/src/bin/create-ponder",
|
|
36
|
+
"test": "$npm_execpath build && export $(grep -v '^#' .env.local | xargs) && jest",
|
|
37
|
+
"typecheck": "tsc --noEmit"
|
|
47
38
|
}
|
|
48
|
-
}
|
|
39
|
+
}
|