Repository navigation
Description
Description
src/hooks/ contains four fully-implemented React hooks — useWallet, useEscrow, useBalance, useTransaction (148 lines total, re-exported by src/hooks/index.ts) — that wrap wallet connection, escrow state, balance, and transaction status for consumers building a React UI on top of the SDK (exactly what trustflow-frontend needs, see its companion issue). However, src/index.ts — the package's actual public entrypoint per package.json's main/module/types/exports fields — never does export * from './hooks', so none of these hooks are reachable by any consumer of @trustflow/sdk today.
Compounding this: useWallet.ts (and presumably the others) import { useState, useCallback } from 'react', but react is not declared anywhere in package.json — not as a dependency, and not as a peerDependency. If a consumer did somehow reach these hooks via a deep import path (@trustflow/sdk/dist/hooks/useWallet), it would fail to resolve react unless the consumer happened to have it installed for unrelated reasons, with no peerDependency warning to tell them why.
Component
SDK
Difficulty
🔴 Hard
Tasks
- Decide the export strategy: re-export hooks from the main entrypoint (simplest, but forces
reacton every consumer including Node-only integrators), or split into a separate subpath export (e.g.@trustflow/sdk/react) so non-React consumers aren't affected - Add
reactas apeerDependency(withpeerDependenciesMeta.optional: trueif going the subpath-export route) and addreact/@types/reactas devDependencies for building/testing the hooks - Update
tsupconfig if a separate subpath build output is needed - Add tests for each hook (currently none exist) using
@testing-library/react-hooksor equivalent, mockingwallet/connect.tsand the escrow client - Update the README/package
exportsfield and document the hooks as part of the public API
Acceptance Criteria
-
useWallet,useEscrow,useBalance,useTransactionare importable from a documented, stable path from@trustflow/sdk -
reactis correctly declared so consumers get a clear peer-dependency warning/error instead of a silent runtime failure - Non-React consumers (Node scripts, CLI tools) importing only the core client are unaffected by the hooks now being reachable
- Each hook has test coverage for its primary success and error paths
Estimated Time
2-3 days
Activity
DammyAji commentedon Aug 16, 2026
Hello @meshackyaro, please I'd like to take on this issue. I'm a software developer who is familiar and have worked on projects using React.js. For this issue, I'd be able to implement changes needed from the tasks outlined, to the acceptance criteria. I'd also go through the codespace to understand the architecture of the project. I'd really appreciate it if you assign me this issue. Thank you.
Samueltorres22 commentedon Aug 17, 2026
I'm a full-stack TypeScript/React developer comfortable with SDK/package build config (tsup, exports fields, peerDependencies). I'll: (1) add a documented subpath export (@trustflow/sdk/react) so non-React consumers stay unaffected, (2) declare react as an optional peerDependency + devDependency, (3) update tsup config for the subpath build, (4) add tests for useWallet/useEscrow/useBalance/useTransaction with @testing-library/react-hooks mocking wallet/connect.ts and the escrow client, and (5) document the hooks in the README. Can deliver within the estimated window.
oluwagbemigaphilip commentedon Aug 27, 2026
@oluwagbemigaphilip has applied to work on this issue as part of the Stellar Wave Program's 8th wave.
ℹ️ Repo Maintainers: To accept this application, review their application or assign @oluwagbemigaphilip to this issue.
drips-wave commentedon Aug 27, 2026
Congratulations, @oluwagbemigaphilip! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on August 31, 2026.
🧑💻 @oluwagbemigaphilip: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.
Warning
When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.
🤠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.
🌊 Happy Wave 🌊
fix(hooks): export React hooks via a /react subpath, declare react pe…
Update the fixes
drips-wave commentedon Aug 27, 2026
This issue has been completed by @oluwagbemigaphilip as part of the Stellar Wave Program's 8th Wave 🥳
😎 @oluwagbemigaphilip: You earned 200 Points for completing this issue! After the current Wave ends, you'll be eligible for a percentage of the Wave's reward pool based on the percentage of total points you've earned. Learn more here. You can also Leave a review to share your experience working on this issue.
🧑💻 Repo maintainers: How'd the contributor do? Leave a review to share your experience working with them.