Skip to content

Commit 53d5532

Browse files
eabdelmoneimclaude
andcommitted
docs: add comments explaining AMEX backfill logic
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent acb89e2 commit 53d5532

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

src/server/routes/admin/backfill.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,18 @@ import { StatusCodes } from "http-status-codes";
44
import { TransactionDB } from "../../../shared/db/transactions/db";
55
import { standardResponseSchema } from "../../schemas/shared-api-schemas";
66

7+
// SPECIAL LOGIC FOR AMEX
8+
// added two admin routes to backfill tx hashes to the backfill table
9+
// loadBackfillRoute and clearBackfillRoute
10+
// loadBackfillRoute is used to load tx hashes to the backfill table
11+
// clearBackfillRoute is used to clear the backfill table
12+
// these routes are used by the AMEX script to backfill tx hashes to the backfill table
13+
// see https://github.com/thirdweb-dev/solutions-customer-scripts/blob/main/amex/scripts/load-backfill-via-api.ts
14+
// loadBackfillRoute is used to load tx hashes to the backfill table
15+
// clearBackfillRoute is used to clear the backfill table
16+
// these routes are used by the AMEX script to backfill tx hashes to the backfill table
17+
// see https://github.com/thirdweb-dev/solutions-customer-scripts/blob/main/amex/scripts/load-backfill-via-api.ts
18+
719
const loadRequestBodySchema = Type.Object({
820
entries: Type.Array(
921
Type.Object({

src/server/routes/transaction/blockchain/get-logs.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,10 @@ export async function getTransactionLogs(fastify: FastifyInstance) {
160160
hash = transaction.transactionHash;
161161
}
162162

163+
// SPECIAL LOGIC FOR AMEX
164+
// AMEX uses this endpoint to get logs for transactions they didn't receive webhooks for
165+
// the queue ID's were cleaned out of REDIS so we backfilled tx hashes to this backfill table
166+
// see https://github.com/thirdweb-dev/solutions-customer-scripts/blob/main/amex/scripts/load-backfill-via-api.ts
163167
// Fallback to backfill table if enabled and not found
164168
if (!hash && env.ENABLE_TX_BACKFILL_FALLBACK) {
165169
const backfillHash = await TransactionDB.getBackfillHash(queueId);

0 commit comments

Comments
 (0)