Skip to content

Repository files navigation

Stellar Utils

CI License: GPL-3.0

A small, focused JavaScript toolkit for common Stellar development tasks: key validation, keypair generation, Horizon balance lookups, and payment transaction building/submission. Built on the official stellar-sdk.

Why this exists

Many Stellar tutorials repeat the same Horizon + SDK boilerplate. This library extracts those patterns into tested helpers so apps and scripts can stay small and consistent.

Features

  • Validate Ed25519 public keys and secret seeds
  • Generate keypairs
  • Load account balances from Horizon (testnet or public)
  • Build and sign payment transactions (native XLM or issued assets)
  • Submit signed transaction XDR to Horizon
  • Runnable examples, API docs, optional Express demo, and a Soroban contract scaffold

Requirements

  • Node.js 18+

Install (from source)

git clone https://github.com/Dot-Voidz/Stellar-utils.git
cd Stellar-utils
npm install

Quick start

const {
  generateKeypair,
  validateAddress,
  validateSecretKey,
  getBalance,
  createPaymentTransaction,
} = require('./src');

const pair = generateKeypair();
console.log(pair.publicKey);
console.log(validateAddress(pair.publicKey));
console.log(validateSecretKey(pair.secretKey));

// Horizon calls (network required)
// const balances = await getBalance(pair.publicKey, 'testnet');

See examples/ for runnable scripts and docs/API.md for the full API.

Project layout

Path Purpose
src/ Library source
tests/ Jest unit tests
examples/ Node scripts for common workflows
docs/ API reference
frontend/ Static demo UI
backend/ Optional Express wrapper
contract/ Soroban (Rust) scaffold

Development

npm test
node --check backend/index.js
node --check frontend/app.js

CI runs tests on Node 18 and 20 and checks demo script syntax on every push and pull request.

Contributing

Please read CONTRIBUTING.md and the Code of Conduct before opening issues or PRs.

We prioritize impactful work: correctness, safer error handling, tests, Horizon edge cases, and clear docs. Low-effort typo-only PRs and untested LLM dumps are not accepted.

Security

If you find a vulnerability (especially around secret-key handling), see SECURITY.md. Never paste real mainnet secret keys into issues, PRs, or examples.

License

GPL-3.0

About

Focused JS helpers for Stellar key validation, Horizon balances, and payment transaction building.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages