Loading repository data…
Loading repository data…
oche2920 / repository
Mooring is a type-safe TypeScript SDK for building Stellar Anchors. It handles SEP-10 authentication, SEP-24 interactive deposit and withdrawal flows, webhook processing, and background job lifecycle — so you can focus on business logic instead of protocol plumbing.
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
Mooring is a developer-friendly, type-safe SDK for building Stellar Anchors. It abstracts the complexity of Stellar Ecosystem Proposals (SEPs)—specifically SEP-6, SEP-24, and SEP-31—allowing you to focus on your business logic while ensuring compliance and security.
Designed for Bun and TypeScript, Mooring aims to make Stellar Anchors simple, modular, and "just work."
⚠️ Status: Early Development. Not yet ready for production use.
This repository now ships a usable MVP with:
anchor.getExpressRouter()startBackgroundJobs / stopBackgroundJobs)The SDK does not own listen() and does not bind network ports.
bun add mooring
import express from 'express';
import { createAnchor } from 'mooring';
const app = express();
app.use(express.json());
const anchor = createAnchor({
network: { network: 'testnet' },
server: { interactiveDomain: 'https://anchor.example.com' },
security: {
sep10SigningKey: process.env.SEP10_SIGNING_KEY!,
interactiveJwtSecret: process.env.INTERACTIVE_JWT_SECRET!,
distributionAccountSecret: process.env.DISTRIBUTION_ACCOUNT_SECRET!,
webhookSecret: process.env.WEBHOOK_SECRET,
verifyWebhookSignatures: true,
},
assets: {
assets: [
{
code: 'USDC',
issuer: process.env.USDC_ISSUER!,
deposits_enabled: true,
},
],
},
framework: {
database: {
provider: 'postgres',
url: process.env.DATABASE_URL!,
},
queue: {
backend: 'memory',
concurrency: 5,
},
watchers: {
enabled: true,
pollIntervalMs: 15000,
transactionTimeoutMs: 300000,
},
},
webhooks: {
onEvent: async (event, ctx) => {
console.log('webhook event', event.eventId, ctx.receivedAt);
},
},
});
await anchor.init();
await anchor.startBackgroundJobs();
app.use('/anchor', anchor.getExpressRouter());
app.listen(3000);
For tests and local development, makeSqliteDbUrlForTests creates a temporary SQLite database URL that you can import directly from mooring.
import { makeSqliteDbUrlForTests } from 'mooring';
const databaseUrl = makeSqliteDbUrlForTests();
Mounted under your chosen base path (for example /anchor):
GET /healthGET /infoGET /auth/challengePOST /auth/token (expects wallet-signed SEP-10 challenge XDR)POST /transactions/deposit/interactive (Bearer auth)GET /transactions/:id (Bearer auth)POST /webhooks/eventsThe root package also exports public TypeScript transaction helpers, including Transaction, TransactionKind, and TransactionStatus.
MIT