Skip to content

refactor: consolidate API clients into one canonical client - #235

Closed
ishwariyer wants to merge 1 commit into
bridgelet-org:mainfrom
ishwariyer:refactor/228-consolidate-api-client
Closed

refactor: consolidate API clients into one canonical client#235
ishwariyer wants to merge 1 commit into
bridgelet-org:mainfrom
ishwariyer:refactor/228-consolidate-api-client

Conversation

@ishwariyer

Copy link
Copy Markdown

What

Consolidates the frontend's three separate, competing API-client modules into a
single canonical client.

Why

lib/sdk.ts, lib/api-client.ts, and lib/redeem.ts each independently talked to
the backend and disagreed on routes, payloads, and headers. Three sources of truth
meant a fix applied to one client silently left the other two wrong, and new
contributors couldn't tell which one was real. This is the prerequisite that
unblocks the route/field/auth fixes (#229#232).

Changes

  • lib/create-bridgelet-client.ts is now the one canonical client — absorbed
    RateLimitError, SWEEP_STUB_WARNING, and the default-client helpers.
  • lib/bridgelet.ts trimmed to types only (it's regenerated by generate:types,
    so client code doesn't belong there).
  • Repointed the lone RateLimitError import in components/claim-status-card.tsx.
  • Deleted lib/sdk.ts, lib/api-client.ts, lib/redeem.ts.
  • Documented the canonical client in the frontend README.

No behavior change

Pure refactor — request routes and payloads are unchanged. Correcting the routes to
match the backend is the separate follow-up in #229.

Tests

No automated tests are included: the frontend has no test harness configured yet, and
this PR changes no behavior. Correctness is verified by npm run typecheck and
npm run build (both passing). Test coverage for the canonical client will land with
the route fix in #229 (see also #142).

Closes #228

Merge sdk.ts, api-client.ts and redeem.ts into create-bridgelet-client.ts,
trim bridgelet.ts to types only, and document the client in the README.
No route or behavior changes.

Closes bridgelet-org#228
@vercel

vercel Bot commented Jul 18, 2026

Copy link
Copy Markdown

@ishwariyer is attempting to deploy a commit to the aminubabafatima8-gmailcom's projects Team on Vercel.

A member of the Team first needs to authorize it.

@phertyameen

Copy link
Copy Markdown
Contributor

@ishwariyer checkout mindblocklabs in the campaign for an issue (frontend, backend or contract) you can solve and you've got it!

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.

Consolidate the three competing API client implementations into one

2 participants