feat: combined address endpoint, displayAmount, date filters, summary & eventType filter#6
Merged
Miracle656 merged 1 commit intoApr 4, 2026
Conversation
…, eventType filter Closes Miracle656#1, Miracle656#2, Miracle656#3, Miracle656#4, Miracle656#5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements all 5 open feature issues.
Closes #1 —
GET /transfers/address/:addressAdded a combined incoming + outgoing endpoint. Results are merged and sorted by ledger descending. Each record includes a
directionfield ("incoming"|"outgoing"). Supports all existing query params (contractId,fromLedger,toLedger,limit,offset).Closes #2 —
displayAmountfield on all transfer responsesAdded a
displayAmountfield alongside the rawamounton every transfer response (all endpoints including/incoming,/outgoing,/address,/tx). Uses BigInt arithmetic to divide by 10^7 and format to 7 decimal places — no floating-point precision loss. e.g."10000000000"→"1000.0000000".Closes #3 —
fromDate/toDatefiltersAdded ISO 8601 date range filtering via
ledgerClosedAton/incoming,/outgoing, and/addressendpoints. Invalid date strings return HTTP 400 with a clear error message. Works alongside existingfromLedger/toLedgerparams.Closes #4 —
GET /summary/:addressAdded aggregate stats endpoint grouped by
contractId. ReturnstotalReceived,totalSent,netFlow(can be negative) and theirdisplay*variants. Uses a raw SQL query withPrisma.sqlparameterisation since Prisma cannotSUMstring-typed columns. SupportsfromDate,toDate, andcontractIdfilters.Closes #5 —
eventTypefilterAdded
eventTypequery param to/incoming,/outgoing, and/addressendpoints. Accepts a single value or comma-separated list (e.g.eventType=transfer,mint). Invalid values return HTTP 400. Requests withouteventTypereturn all event types — no breaking change.Changes
src/db.ts— extendedTransferQueryParamsandAllTransfersQueryParamswithfromDate,toDate,eventTypes; addedquerySummary(raw SQL aggregate) andqueryAllTransfers(combined OR query withdirectionmapping)src/api.ts— addedtoDisplayAmounthelper (exported, BigInt-safe, handles negatives for netFlow),parseEventTypesvalidator,parseDateParamvalidator; wired all new params into existing and new endpoints