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
16 changes: 6 additions & 10 deletions .github/workflows/deploy-indexer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ on:
push:
branches: [dev, main]
paths:
- "apps/indexer/**/*.ts"
- "apps/api-gateway/**/*.ts"
- "infra/**"
- "apps/indexer/**/*"
- "apps/api-gateway/**/*"
- "infra/**/*"
- "apps/api/**/*"

jobs:
changes:
Expand All @@ -22,14 +23,9 @@ jobs:
base: ${{ github.ref_name }}
filters: |
api:
- 'apps/indexer/src/api/**'
- 'apps/api/src/**'
indexer:
- 'apps/indexer/src/eventHandlers/**'
- 'apps/indexer/src/indexer/**'
- 'apps/indexer/src/interfaces/**'
- 'apps/indexer/src/lib/**'
- 'apps/indexer/src/*.ts'
- 'apps/indexer/*.ts'
- 'apps/indexer/**/*'

get-daos:
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions apps/indexer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"clean": "rm -rf node_modules generated .ponder dump *.tsbuildinfo"
},
"dependencies": {
"hono": "^4.10.7",
"ponder": "^0.16.2",
"viem": "^2.37.11",
"zod": "^3.25.3"
Expand Down
Empty file removed apps/indexer/src/api/.gitkeep
Empty file.
3 changes: 3 additions & 0 deletions apps/indexer/src/api/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { Hono } from "hono/tiny";

export default new Hono();
39 changes: 10 additions & 29 deletions apps/indexer/src/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,13 @@ import { DaoIdEnum } from "@/lib/enums";

dotenv.config();

const envSchema = z.object({
RPC_URL: z.string(),
DATABASE_URL: z.string().optional(),
POLLING_INTERVAL: z.coerce.number().default(10000), // 10s
MAX_REQUESTS_PER_SECOND: z.coerce.number().default(20),
DAO_ID: z.nativeEnum(DaoIdEnum),
CHAIN_ID: z.coerce.number(),

// Treasury provider configuration
TREASURY_DATA_PROVIDER_ID: z
.enum(["DUNE", "DEFILLAMA", "COMPOUND"])
.optional(),
TREASURY_DATA_PROVIDER_API_URL: z.string().optional(),
TREASURY_DATA_PROVIDER_API_KEY: z.string().optional(),

COINGECKO_API_URL: z.string(),
COINGECKO_API_KEY: z.string(),
REDIS_URL: z.string().optional(),
PORT: z.coerce.number().default(42069),
});

const _env = envSchema.safeParse(process.env);

if (_env.success === false) {
console.error("Invalid environment variables", _env.error.format());
throw new Error("Invalid environment variables");
}

export const env = _env.data;
export const env = z
.object({
RPC_URL: z.string(),
DATABASE_URL: z.string().optional(),
POLLING_INTERVAL: z.coerce.number().default(10000), // 10s
MAX_REQUESTS_PER_SECOND: z.coerce.number().default(20),
DAO_ID: z.nativeEnum(DaoIdEnum),
CHAIN_ID: z.coerce.number(),
})
.parse(process.env);
11 changes: 7 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.