Thank you for your interest in contributing. This project is designed to be easy to contribute to — if you know React and TypeScript, you can add a hook, improve an existing one, write tests, or fix a bug without any blockchain or Stellar expertise.
devis the default branch and the base for all contributions. Branch offdev, and open your pull request againstdev.mainis production-only — it only ever moves via a release merge fromdev(see Releases below). Never branch offmainor target it directly with a feature/fix PR.
git checkout dev
git pull --rebase origin dev
git checkout -b your-feature-branch- New hooks — the most impactful contribution. See the list of open hook issues.
- New wallet support — add Albedo, Rabet, xBull, or any other Stellar wallet to
useWallet. - Tests — unit and integration tests for any hook.
- Bug fixes — anything labelled
bug. - Demo pages — add or improve the live demo for a hook.
- Documentation — improve the README, add JSDoc to hooks, or fix typos.
- Node.js 20+
- pnpm (We use pnpm workspaces)
No Rust, no Stellar CLI, no wallet required to run tests or work on most hooks.
git clone https://github.com/israelolrunfemi/use-stellar
cd use-stellar
git checkout dev
pnpm installnpm run testVerify the published package imports and type resolution integrity locally:
npm run test:packagenpm run devOpen http://localhost:3000. The demo shows every hook with a live output panel.
To test hooks that require a wallet (like useWallet and useSendPayment), install the Freighter browser extension and set it to Stellar testnet.
This project uses Husky to enforce code quality automatically.
Before every commit — Prettier formats your staged files and ESLint checks them. If either fails your commit is blocked. Fix the errors and try again.
Before every push — the SDK is built and all tests are run. If either fails your push is blocked.
To run checks manually at any time:
pnpm format # format all files
pnpm lint # run ESLint
pnpm typecheck # run TypeScript compiler checkThis is the most common contribution and follows a clear pattern.
packages/core/src/hooks/useYourHook.ts
Follow the pattern of an existing hook like useBalance.ts:
import { useState, useEffect } from "react";
import { useStellarContext } from "../context/StellarProvider";
export interface UseYourHookReturn {
data: SomeType | null;
loading: boolean;
error: string | null;
refetch: () => void;
}
export function useYourHook(): UseYourHookReturn {
const { network } = useStellarContext();
const [data, setData] = useState<SomeType | null>(null);
const [loading, setLoading] = useState(false);
const [error, setError] = useState<string | null>(null);
async function fetch() {
setLoading(true);
try {
// your logic here
} catch (err) {
setError(err instanceof Error ? err.message : "Failed");
} finally {
setLoading(false);
}
}
useEffect(() => { fetch(); }, [network]);
return { data, loading, error, refetch: fetch };
}Add to packages/core/src/index.ts:
export { useYourHook } from "./hooks/useYourHook";Add any new interfaces to packages/core/src/types/index.ts.
Create packages/core/src/hooks/useYourHook.test.ts. Test the logic you can unit test — particularly any utility functions. For hooks that call Horizon, mock the server response.
Create packages/demo/app/demo/your-hook/page.tsx using the DemoCard component. See app/demo/balance/page.tsx as a reference.
Add your hook to the hooks array in packages/demo/app/page.tsx.
Wallets are added in packages/core/src/hooks/useWallet.ts.
- Add the wallet name to the
WalletTypeunion inpackages/core/src/types/index.ts - Add a
connectYourWallet()function inuseWallet.ts— seeconnectFreighter()as a reference - Add a case to the
connectfunction that calls your connector - Test it on Stellar testnet
- PR targets
dev, notmain - Tests pass (
npm run test) - TypeScript compiles (
npm run typecheck) - New hook is exported from
packages/core/src/index.ts - New hook has a demo page
- PR references the relevant issue (
Closes #N)
Keep it simple and descriptive:
add usePaymentHistory hook
fix: useBalance not updating on address change
test: add useAccount unit tests
docs: add useSendPayment example to README
main only moves via a release — never push or merge feature work into it directly. Releases are automated via .github/workflows/release.yml, which triggers on version tags (v*.*.*) regardless of branch, but tags should always be cut from main.
To publish a new version:
- Open a PR merging
devintomainoncedevis in a release-ready state. - Update
CHANGELOG.md— move items from[Unreleased]to a new versioned section, e.g.## [0.2.0] - 2026-06-24. - Bump the version in
packages/core/package.json. - Merge into
main, then tag the resulting commit:
git checkout main
git pull origin main
git tag v0.2.0
git push origin v0.2.0The workflow will automatically:
- Run tests and build
- Publish
packages/coreto npm (requiresNODE_AUTH_TOKENsecret set in repository settings) - Create a GitHub Release with the changelog notes for that version
Open a GitHub Discussion or comment on the issue you're working on. No question is too basic.