Description
The wallet layer is non-trivial and undocumented: constants/wallet-kits.constant.ts exposes a client-only getKit() that initializes StellarWalletsKit (defaulting to Freighter, allowAllModules), hooks/useWallet.hook.ts wraps it for connectWallet/disconnectWallet/signTransaction, and context/WalletContext.tsx persists state in localStorage and reconnects on mount. The top commented-out block in useWallet.hook.ts even shows an older, abandoned approach. This issue produces a contributor-facing guide so new developers can use the wallet hooks correctly and understand the supported wallets and network config.
Requirements and context
- Add
docs/WALLET.md documenting: the supported wallet IDs surfaced in useWallet.hook.ts (Freighter, LOBSTR, XBull, Albedo, Rabet), the getKit() SSR guard, the connect/disconnect/sign API and their {success, ...} return shapes, and the localStorage persistence/reconnect behavior of WalletContext.
- Document the network configuration path (
lib/config.ts stellar.network and NEXT_PUBLIC_STELLAR_NETWORK) and note the current hardcoded WalletNetwork.TESTNET in signTransaction as a known limitation.
- Include a minimal usage snippet showing a component consuming
useWallet.
- Non-functional: all symbols/paths referenced must exist; remove confusion by explaining that the leading commented-out block in
useWallet.hook.ts is dead code; link the doc from docs/README.md.
- Do not document submit/broadcast as implemented (it is not) — describe it as a follow-up.
Acceptance criteria
Suggested execution
1. Fork the repo and create a branch — git checkout -b docs/wallet-integration.
2. Implement changes — add docs/WALLET.md; update docs/README.md.
3. Write/extend tests — docs need no unit tests; verify the example snippet type-checks conceptually against hooks/useWallet.hook.ts. (Code in this repo is tested with Jest + React Testing Library via pnpm.)
4. Test and commit —
pnpm install
pnpm lint
pnpm build
Example commit message
docs(wallet): document the wallet hooks, supported wallets, and network config
Guidelines
- No coverage change for docs; ensure every referenced symbol/path is verified against the source.
- Keep the snippet accurate and accessible; explicitly flag the dead commented code and the unimplemented broadcast step.
- Timeframe: 96 hours.
Description
The wallet layer is non-trivial and undocumented:
constants/wallet-kits.constant.tsexposes a client-onlygetKit()that initializesStellarWalletsKit(defaulting to Freighter,allowAllModules),hooks/useWallet.hook.tswraps it forconnectWallet/disconnectWallet/signTransaction, andcontext/WalletContext.tsxpersists state inlocalStorageand reconnects on mount. The top commented-out block inuseWallet.hook.tseven shows an older, abandoned approach. This issue produces a contributor-facing guide so new developers can use the wallet hooks correctly and understand the supported wallets and network config.Requirements and context
docs/WALLET.mddocumenting: the supported wallet IDs surfaced inuseWallet.hook.ts(Freighter, LOBSTR, XBull, Albedo, Rabet), thegetKit()SSR guard, the connect/disconnect/sign API and their{success, ...}return shapes, and thelocalStoragepersistence/reconnect behavior ofWalletContext.lib/config.tsstellar.networkandNEXT_PUBLIC_STELLAR_NETWORK) and note the current hardcodedWalletNetwork.TESTNETinsignTransactionas a known limitation.useWallet.useWallet.hook.tsis dead code; link the doc fromdocs/README.md.Acceptance criteria
docs/WALLET.mddocuments supported wallets, the kit SSR guard, and the connect/disconnect/sign API with return shapes.WalletContextis described accurately.useWalletusage snippet is included.docs/README.mdand references only existing symbols/paths.Suggested execution
1. Fork the repo and create a branch —
git checkout -b docs/wallet-integration.2. Implement changes — add
docs/WALLET.md; updatedocs/README.md.3. Write/extend tests — docs need no unit tests; verify the example snippet type-checks conceptually against
hooks/useWallet.hook.ts. (Code in this repo is tested with Jest + React Testing Library via pnpm.)4. Test and commit —
Example commit message
Guidelines