Thank you for your interest in contributing! Whether you're fixing a bug, improving docs, or adding a new feature, your help is welcome and appreciated. This guide will get you set up and show you what we expect from contributions.
- Getting Started
- Development Setup
- Available Commands
- Project Structure
- Code Style
- Writing Tests
- Branching and Commits
- Pull Request Checklist
- Reporting Issues
- Fork the repository on GitHub.
- Clone your fork locally:
git clone https://github.com/<your-username>/pocketpay-sdk.git cd pocketpay-sdk
- Install dependencies (Node.js ≥ 18 required):
npm install
- Copy the environment template and fill in any values you need for local testing:
cp .env.example .env
The SDK targets the Stellar Testnet by default. Most tests are unit-level and do not require a live network connection, but if you're working on Horizon or Soroban integration you can set the relevant URLs in your .env file.
| Variable | Description |
|---|---|
STELLAR_NETWORK |
testnet or mainnet (default: testnet) |
STELLAR_HORIZON_URL |
Override the default Horizon endpoint |
STELLAR_SOROBAN_RPC_URL |
Override the default Soroban RPC endpoint |
VAULT_CONTRACT_ID |
Deployed vault contract ID for Soroban tests |
⚠️ Never commit real secret keys. The.envfile is gitignored for your protection.
# Build the SDK (outputs to dist/)
npm run build
# Run all tests once
npm test
# Run tests in watch mode during development
npm run test:watch
# Type-check without emitting files
npm run lint
# Start the dev watcher
npm run devsrc/
config/ SDK configuration and network defaults
payments/ XLM payment logic
soroban/ Soroban vault contract interactions
transactions/ Transaction building and history
types/ Shared TypeScript types
utils/ Helper utilities
wallet/ Wallet creation and management
index.ts Public API surface
tests/
fixtures/ Shared test data (accounts, transactions, payments)
*.test.ts Test files mirroring the src/ modules
docs/ Extended documentation (error handling, logging, security)
examples/ Runnable usage examples
- The project is written in TypeScript with strict mode enabled.
- Run
npm run lintbefore pushing — this type-checks the full source tree. - Match the naming and file conventions already present in
src/. - Keep functions focused and add JSDoc comments for any exported API.
- Do not introduce new runtime dependencies without discussion in the issue first.
Tests live in tests/ and use Vitest. We use fixtures in tests/fixtures/ to keep test data consistent.
- Write tests for any behaviour change or new feature. Bug fixes should include a regression test.
- Keep tests isolated — avoid relying on live network calls. Mock external requests where needed.
- Use the existing fixture helpers (
tests/fixtures/accounts.ts,transactions.ts, etc.) rather than hardcoding data.
Run the suite before opening a PR:
npm testAll tests must pass. ✅
Use a descriptive branch name that references the issue:
feat/contributing-guide-6
fix/soroban-error-handling-42
docs/update-readme-15
Commit messages should be clear and in the imperative mood:
Add CONTRIBUTING.md for SDK contributors
Fix wallet keypair type mismatch on mainnet
Keep commits focused — one logical change per commit makes reviews easier.
Before opening a PR, run through this list:
-
npm run lintpasses with no errors -
npm testpasses with no failures - New behaviour is covered by tests
- Relevant docs (
docs/,README.md) are updated if needed - The PR description explains what changed and why
- The PR references the related issue (e.g.
Closes #6) - No
.envor secret values are committed
Found a bug or have a feature idea? Open an issue and fill in as much detail as you can:
- What you expected to happen
- What actually happened
- Steps to reproduce
- SDK version and Node.js version
We appreciate every contribution, no matter the size. Thanks for helping make PocketPay SDK better! 🚀