Skip to content

Eliminate any types from API layer#229

Open
DevRushd wants to merge 1 commit into
TrusTrove:mainfrom
DevRushd:Elimination-of-any-Types-in-API-Layer
Open

Eliminate any types from API layer#229
DevRushd wants to merge 1 commit into
TrusTrove:mainfrom
DevRushd:Elimination-of-any-Types-in-API-Layer

Conversation

@DevRushd

Copy link
Copy Markdown
Contributor

Summary

Defines typed raw response interfaces to replace all any usages in apps/web/lib/api.ts, eliminating TypeScript type-safety holes in the API layer.

Changes

  • New interfaces: RawInvoiceResponse, RawPoolStatsResponse, RawLPPositionResponse, RawEventLogResponse — model the exact snake_case shapes returned by the indexer API
  • Typed parse functions: All raw: any parameters replaced with the corresponding Raw* interface
  • Typed API calls: All apiFetch<any> calls replaced with apiFetch<Raw*Response>
  • Typed pagination: data: any[] replaced with data: RawInvoiceResponse[] in the inline paginated response type

Impact

  • No any types remain in apps/web/lib/api.ts
  • Compile-time safety for all raw API response access
  • Runtime crash risk reduced when accessing malformed API responses

Acceptance criteria

  • No any types used in lib/api.ts
  • All existing tests pass (verified via tsc --noEmit — only pre-existing errors remain)

Closes #210

Define typed raw response interfaces (RawInvoiceResponse,
RawPoolStatsResponse, RawLPPositionResponse, RawEventLogResponse)
to replace all any usages in parse functions and apiFetch calls.

Closes TrusTrove#210
@vercel

vercel Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

@DevRushd is attempting to deploy a commit to the K1NGD4VID Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Jun 29, 2026

Copy link
Copy Markdown

@DevRushd Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@K1NGD4VID

Copy link
Copy Markdown
Contributor

resolve Conflict @DevRushd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Elimination of any Types in API Layer

2 participants