refactor: consolidate API clients into one canonical client - #235
Closed
ishwariyer wants to merge 1 commit into
Closed
refactor: consolidate API clients into one canonical client#235ishwariyer wants to merge 1 commit into
ishwariyer wants to merge 1 commit into
Conversation
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
|
@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. |
4 tasks
Contributor
|
@ishwariyer checkout mindblocklabs in the campaign for an issue (frontend, backend or contract) you can solve and you've got it! |
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.
What
Consolidates the frontend's three separate, competing API-client modules into a
single canonical client.
Why
lib/sdk.ts,lib/api-client.ts, andlib/redeem.tseach independently talked tothe 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.tsis now the one canonical client — absorbedRateLimitError,SWEEP_STUB_WARNING, and the default-client helpers.lib/bridgelet.tstrimmed to types only (it's regenerated bygenerate:types,so client code doesn't belong there).
RateLimitErrorimport incomponents/claim-status-card.tsx.lib/sdk.ts,lib/api-client.ts,lib/redeem.ts.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 typecheckandnpm run build(both passing). Test coverage for the canonical client will land withthe route fix in #229 (see also #142).
Closes #228