Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions change/apibara-655744e6-c51d-4d42-aacc-99cc9f04026c.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "cli: update create template",
"packageName": "apibara",
"email": "jadejajaipal5@gmail.com",
"dependentChangeType": "patch"
}
5 changes: 2 additions & 3 deletions packages/cli/src/create/templates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,7 @@ ${storage === "postgres" ? `import * as schema from "../lib/schema";` : ""}


export default function (runtimeConfig${language === "typescript" ? ": ApibaraRuntimeConfig" : ""}) {
const indexerId = "${indexerId}";
const { startingBlock, streamUrl } = runtimeConfig[indexerId];
const { startingBlock, streamUrl } = runtimeConfig["${indexerId}"];
${
storage === "postgres"
? `const db = drizzle({
Expand All @@ -110,7 +109,7 @@ export default function (runtimeConfig${language === "typescript" ? ": ApibaraRu
finality: "accepted",
startingBlock: BigInt(startingBlock),
filter: {
header: "always",
${chain === "ethereum" ? "logs: []," : chain === "starknet" ? "events: []," : ""}
},
plugins: [${storage === "postgres" ? "drizzleStorage({ db, migrate: { migrationsFolder: './drizzle' } })" : ""}],
async transform({ endCursor, finality }) {
Expand Down