End-to-end test harness for the Stellar network. Run scenario-based integration tests against Testnet or Futurenet — no local node required.
Covers payments, DEX operations (trustlines, buy/sell offers, path payments), and Soroban smart contract lifecycle (upload, deploy, invoke).
- Zero infrastructure — Friendbot funds test accounts automatically
- Multi-network — Testnet and Futurenet supported out of the box
- Scenario-based — each test file is a self-contained, readable scenario
- Resilient — built-in retry logic for flaky Testnet/Futurenet responses
- TypeScript-first — strict types, full declarations, source maps
src/
index.ts # Public API
network.ts # TestNetwork helper (fund, load accounts)
utils.ts # Retry + error handling utilities
tests/
scenarios/
payment.test.ts # XLM transfer
dex.test.ts # Trustline, buy offer, sell offer, path payment
soroban.test.ts # Wasm upload, contract deploy, contract invoke
.github/
workflows/
ci.yml # GitHub Actions CI
npm install
npm testAll tests run against public Testnet/Futurenet. No .env or local node setup needed.
Funds two accounts via Friendbot and submits an XLM transfer between them.
- Establishes a USDC trustline
- Places a buy offer (XLM → USDC)
- Places a sell offer (USDC → XLM)
- Executes a path payment strict send
- Uploads a compiled
.wasmcontract - Deploys the contract to get a contract ID
- Invokes a contract function and asserts the result
Note: Soroban scenarios target Futurenet. Replace the placeholder wasm in
soroban.test.tswith a real compiled contract:const wasmBuffer = fs.readFileSync("path/to/contract.wasm");
| Network | Horizon URL | RPC URL |
|---|---|---|
| Testnet | https://horizon-testnet.stellar.org | — |
| Futurenet | https://horizon-futurenet.stellar.org | https://rpc-futurenet.stellar.org |
Custom networks can be passed directly to TestNetwork:
import { TestNetwork } from "lumens-lab";
const net = new TestNetwork({
horizonUrl: "https://your-horizon.example.com",
networkPassphrase: "My Custom Network ; 2024",
friendbotUrl: "https://your-friendbot.example.com",
});All network calls can be wrapped with the built-in withRetry helper:
import { withRetry } from "./utils";
const result = await withRetry(() => net.server.submitTransaction(tx));Defaults: 3 attempts, 1 s exponential backoff.
- Fork the repo
- Add a scenario under
tests/scenarios/ - Ensure
npm testpasses - Open a PR
MIT