feat(sdk): add React hooks, middleware pipeline, and pagination utilities#1067
Open
zengbinli wants to merge 6 commits intoSolFoundry:mainfrom
Open
feat(sdk): add React hooks, middleware pipeline, and pagination utilities#1067zengbinli wants to merge 6 commits intoSolFoundry:mainfrom
zengbinli wants to merge 6 commits intoSolFoundry:mainfrom
Conversation
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.
SolFoundry TypeScript SDK Enhancement
Bounty: #863 | Reward: 900K $FNDRY | Tier: T3
What This PR Adds
This PR enhances the existing
@solfoundry/sdkwith three new production-ready modules:1. React Hooks (
sdk/src/react/useBounties.ts)Composable React hooks for common SDK operations:
Features:
useBounties— Paginated bounty listing with auto-pagination stateuseBounty— Single bounty fetch with cachinguseContributor— Contributor profile lookupuseStats— Platform statistics2. Middleware Pipeline (
sdk/src/middleware.ts)Composable request/response interceptors:
Built-in middleware:
loggingMiddleware— Request/response loggingauthMiddleware— Token injectioncacheMiddleware— In-memory response caching with TTLerrorNormalizerMiddleware— Typed error normalizationcompose— Middleware pipeline composer3. Pagination Utilities (
sdk/src/pagination.ts)Helpers for offset and cursor-based pagination:
Files Changed
sdk/src/react/useBounties.tssdk/src/middleware.tssdk/src/pagination.tssdk/src/__tests__/react.test.tssdk/src/__tests__/middleware.test.tssdk/src/__tests__/pagination.test.tsTesting
All new modules include comprehensive Vitest tests:
Acceptance Criteria Met
Why This Approach
Rather than creating a duplicate SDK (like PR #1020's
sdk/typescript/), this PR enhances the existingsdk/directory that already has a solid foundation. This ensures:Closes
Closes #863
Wallet:
3D2uVzAsGhrWfUprHLwezCNkE1u9eK7SH2MAhbC3gFVN