Skip to content

Commit 7c73f1a

Browse files
committed
rename
1 parent 1c9aead commit 7c73f1a

File tree

4 files changed

+29
-29
lines changed

4 files changed

+29
-29
lines changed

src/db/contractSubscriptions/createContractSubscription.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,27 @@ interface CreateContractSubscriptionParams {
44
chainId: number;
55
contractAddress: string;
66
webhookId?: number;
7-
parseEventLogs: boolean;
8-
filterEventLogs: string[];
9-
parseTransactionReceipts: boolean;
7+
processEventLogs: boolean;
8+
filterEvents: string[];
9+
processTransactionReceipts: boolean;
1010
}
1111

1212
export const createContractSubscription = async ({
1313
chainId,
1414
contractAddress,
1515
webhookId,
16-
parseEventLogs,
17-
filterEventLogs,
18-
parseTransactionReceipts,
16+
processEventLogs,
17+
filterEvents,
18+
processTransactionReceipts,
1919
}: CreateContractSubscriptionParams) => {
2020
return prisma.contractSubscriptions.create({
2121
data: {
2222
chainId,
2323
contractAddress,
2424
webhookId,
25-
parseEventLogs,
26-
filterEventLogs,
27-
parseTransactionReceipts,
25+
processEventLogs,
26+
filterEvents,
27+
processTransactionReceipts,
2828
},
2929
include: {
3030
webhook: true,

src/server/routes/contract/subscriptions/addContractSubscription.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,18 @@ const bodySchema = Type.Object({
2929
examples: ["https://example.com/webhook"],
3030
}),
3131
),
32-
parseEventLogs: Type.Optional(
32+
processEventLogs: Type.Optional(
3333
Type.Boolean({
3434
description: "If true, parse event logs for this contract.",
3535
}),
3636
),
37-
filterEventLogs: Type.Optional(
37+
filterEvents: Type.Optional(
3838
Type.Array(Type.String(), {
3939
description:
4040
"A case-sensitive list of event log names to parse. If empty, parse all event logs.",
4141
}),
4242
),
43-
parseTransactionReceipts: Type.Optional(
43+
processTransactionReceipts: Type.Optional(
4444
Type.Boolean({
4545
description: "If true, parse transaction receipts for this contract.",
4646
}),
@@ -83,16 +83,16 @@ export async function addContractSubscription(fastify: FastifyInstance) {
8383
chain,
8484
contractAddress,
8585
webhookUrl,
86-
parseEventLogs = true,
87-
filterEventLogs = [],
88-
parseTransactionReceipts = true,
86+
processEventLogs = true,
87+
filterEvents = [],
88+
processTransactionReceipts = true,
8989
} = request.body;
9090

9191
const chainId = await getChainIdFromChain(chain);
9292
const standardizedContractAddress = contractAddress.toLowerCase();
9393

9494
// Must parse logs or receipts.
95-
if (!parseEventLogs && !parseTransactionReceipts) {
95+
if (!processEventLogs && !processTransactionReceipts) {
9696
throw createCustomError(
9797
"Contract Subscriptions must parse event logs and/or receipts.",
9898
StatusCodes.BAD_REQUEST,
@@ -137,9 +137,9 @@ export async function addContractSubscription(fastify: FastifyInstance) {
137137
chainId,
138138
contractAddress: standardizedContractAddress,
139139
webhookId,
140-
parseEventLogs,
141-
filterEventLogs,
142-
parseTransactionReceipts,
140+
processEventLogs,
141+
filterEvents,
142+
processTransactionReceipts,
143143
});
144144

145145
reply.status(StatusCodes.OK).send({

src/server/schemas/contractSubscription.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ export const contractSubscriptionSchema = Type.Object({
77
chainId: Type.Number(),
88
contractAddress: Type.String(),
99
webhook: Type.Optional(WebhookSchema),
10-
parseEventLogs: Type.Boolean(),
11-
filterEventLogs: Type.Array(Type.String()),
12-
parseTransactionReceipts: Type.Boolean(),
10+
processEventLogs: Type.Boolean(),
11+
filterEvents: Type.Array(Type.String()),
12+
processTransactionReceipts: Type.Boolean(),
1313
createdAt: Type.Unsafe<Date>({
1414
type: "string",
1515
format: "date",
@@ -25,8 +25,8 @@ export const toContractSubscriptionSchema = (
2525
webhook: contractSubscription.webhook
2626
? toWebhookSchema(contractSubscription.webhook)
2727
: undefined,
28-
parseEventLogs: contractSubscription.parseEventLogs,
29-
filterEventLogs: contractSubscription.filterEventLogs,
30-
parseTransactionReceipts: contractSubscription.parseTransactionReceipts,
28+
processEventLogs: contractSubscription.processEventLogs,
29+
filterEvents: contractSubscription.filterEvents,
30+
processTransactionReceipts: contractSubscription.processTransactionReceipts,
3131
createdAt: contractSubscription.createdAt,
3232
});

src/worker/tasks/chainIndexer.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,11 @@ export const createChainIndexerTask = async (args: {
6868
events: string[];
6969
functions: string[];
7070
}[] = contractSubscriptions
71-
.filter((c) => c.parseEventLogs)
71+
.filter((c) => c.processEventLogs)
7272
.map((c) => ({
7373
address: c.contractAddress,
74-
events: c.filterEventNames,
75-
functions: c.filterFunctionNames,
74+
events: c.filterEvents,
75+
functions: [],
7676
}));
7777
if (eventLogFilters.length > 0) {
7878
await enqueueProcessEventLogs({
@@ -86,7 +86,7 @@ export const createChainIndexerTask = async (args: {
8686
// Identify contract addresses to parse transaction receipts, if any.
8787
const transactionReceiptFilters: { address: string }[] =
8888
contractSubscriptions
89-
.filter((cs) => cs.parseTransactionReceipts)
89+
.filter((cs) => cs.processTransactionReceipts)
9090
.map((cs) => ({
9191
address: cs.contractAddress.toLowerCase(),
9292
}));

0 commit comments

Comments
 (0)