Cross-border payment infrastructure for emerging markets.
Fluxa is a programmable payments API built on the Stellar network. It gives fintech products and developers the primitives to move value across borders β wallet management, internal transfers, FX conversion via Stellar path payments, and settlement β behind a clean REST API.
Status: Active development β testnet only.
- β Wallets β create Stellar accounts with AES-256-GCM encrypted secrets; never expose raw keys
- β Transfers β async payment submission with queue-backed retry and status polling
- β FX / Conversion β quote and execute cross-asset swaps via Stellar DEX path payments
- β Settlement β background worker submits transactions to Stellar, handles retries, confirms on-chain
- β Ledger indexer β streams Horizon events to keep local state in sync
- β Multi-tenant β API key + JWT auth; individual developers and business organizations each get scoped access
- β Webhooks β signed delivery of payment events to developer endpoints
- π Sandbox mode β
sk_test_keys route to Stellar testnet for safe integration testing - β Recurring payouts β scheduled transfers with daily/weekly/monthly cadence
- β Fiat rails β deposit/withdrawal via Flutterwave integration
- β Organization management β invite members, role-based access control (owner/admin/dev/viewer)
Client Applications
β Authorization: Bearer sk_live_... or sk_test_...
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Fluxa REST API β
β Chi router β JWT + API key auth β Rate limiting β Tenant scope β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βββ Wallet Service βββΊ postgres: wallets, balances
βββ Transfer Service βββΊ postgres: transactions
βββ FX Service βββΊ Stellar DEX + rate cache (Redis)
βββ Fee Service βββΊ postgres: fees, fee_collections
βββ Webhook Dispatcher βββΊ postgres: webhook_endpoints, deliveries
β
βΌ (Asynq job queue)
ββββββββββββββββββββββββββββββββββββββββββ
β Background Worker β
β Settlement Engine β Ledger Indexer β
β Reconciliation β Scheduler β
ββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
Stellar Network (Horizon API + Soroban RPC)
testnet: horizon-testnet.stellar.org
mainnet: horizon.stellar.org
Two processes
| Binary | Role |
|---|---|
cmd/api |
HTTP server β handles all REST requests, enqueues async work |
cmd/worker |
Asynq worker β settles transfers, runs ledger indexer, processes webhooks |
Transfers are asynchronous. POST /v1/transfers returns 202 Accepted with a pending transaction immediately. Poll GET /v1/transfers/:id or receive a transfer.settled webhook for the final status.
fluxa/
βββ cmd/
β βββ api/main.go # HTTP server entry point
β βββ worker/main.go # Background worker entry point
βββ internal/
β βββ config/ # Viper env config
β βββ domain/ # Core types: Wallet, Transaction, Conversion, errors
β βββ crypto/ # AES-256-GCM encrypt/decrypt (stdlib only)
β βββ assets/ # Asset registry: USDC/EURC issuers per network
β βββ stellar/ # Horizon client, keypair generation, signer interface
β βββ postgres/ # pgx/v5 repository implementations
β βββ queue/ # Asynq client + task type definitions
β βββ wallet/ # Wallet service + HTTP handler
β βββ transfer/ # Transfer service + HTTP handler
β βββ batch/ # Batch transfers + CSV export, reuses transfer settlement
β βββ schedule/ # Recurring payouts + Asynq periodic task
β βββ fx/ # FX service + rate providers + HTTP handler
β βββ fees/ # Fee calculation and collection
β βββ settlement/ # Settlement engine + Asynq task handler
β βββ indexer/ # Ledger indexer + Asynq periodic task
β βββ webhook/ # Webhook dispatcher + delivery worker
β βββ reconcile/ # DB vs on-chain reconciliation
β βββ apikey/ # API key generation, hashing, verification
β βββ auth/ # User registration, login, JWT
β βββ org/ # Organization members, roles
β βββ fiat/ # Fiat rail abstraction + provider adapters
β βββ alerting/ # Alerting client for platform notifications
β βββ tenant/ # Tenant context helpers
β βββ server/ # Chi router setup, middleware
β βββ api/ # Shared request validation + response helpers
βββ db/
βββ migrations/ # golang-migrate SQL files (numbered up/down pairs)
- Go 1.22+
- PostgreSQL 15+
- Redis 7+
The repository root is a Go backend workspace. It does not require root-level Node.js, TypeScript, Prisma, or BullMQ tooling to build or run the API and worker.
git clone https://github.com/Savitura/Fluxa
cd Fluxa
go mod tidycp .env.example .env| Variable | Description |
|---|---|
PORT |
HTTP listen port (default: 3000) |
DATABASE_URL |
PostgreSQL connection string |
REDIS_URL |
Redis connection string |
STELLAR_NETWORK |
testnet or mainnet |
STELLAR_HORIZON_URL |
Horizon endpoint |
STELLAR_USDC_ISSUER |
USDC issuer public key |
MASTER_ENCRYPTION_KEY |
64 hex chars (32 bytes) β encrypts stored wallet secrets |
PLATFORM_FEE_WALLET_PUBLIC_KEY |
Stellar address where platform fees are collected |
TREASURY_SECRET_KEY |
Stellar key that funds new accounts (testnet: leave empty, use Friendbot) |
Generate a master key:
openssl rand -hex 32make migrate# Terminal 1
make run-api
# Terminal 2
make run-workerAll endpoints are prefixed /v1. Auth: Authorization: Bearer <api_key_or_jwt>. Errors:
{ "error": { "code": "WALLET_NOT_FOUND", "message": "wallet not found" } }POST /v1/auth/register Create account (individual or organization)
POST /v1/auth/login Login β returns JWT
POST /v1/auth/refresh Refresh access token
POST /v1/keys Create API key β sk_live_... or sk_test_...
GET /v1/keys List keys (prefix only, never raw)
DELETE /v1/keys/:id Revoke keyPOST /v1/wallets Create wallet β returns public key only
GET /v1/wallets/:id/balances Live balances from Horizon (all assets)
POST /v1/wallets/:id/trustlines Add Stellar trustline for a new assetPOST /v1/transfers Initiate transfer (202 Accepted β async)
GET /v1/transfers/:id Poll status
GET /v1/transfers List (filter by wallet, status, date)
POST /v1/transfers/batch Up to 100 transfers in one call
GET /v1/transfers/batch/:batchId Batch status with per-transfer breakdown
GET /v1/transfers/batch/:batchId/export CSV download of batch resultsStatus flow: pending β confirmed | failed
Batch status is derived live from its linked transactions: pending β processing β partial | completed | failed.
POST /v1/schedules Create a recurring transfer (daily | weekly | monthly)
GET /v1/schedules List schedules
PATCH /v1/schedules/:id Pause, resume, or update amount/frequency/end_date
DELETE /v1/schedules/:id Cancel a scheduleA background worker checks for due schedules every minute and enqueues a normal transfer for each one β a paused schedule is skipped until resumed.
POST /v1/fx/quote Get a 30-second exchange rate quote
POST /v1/fx/convert Execute a currency swap
GET /v1/fx/rates Live rates for a currency pairPOST /v1/webhooks Register endpoint + event subscriptions
GET /v1/webhooks List endpoints
DELETE /v1/webhooks/:id Remove endpoint
GET /v1/webhooks/:id/deliveries Delivery logEvent types: transfer.initiated Β· transfer.settled Β· transfer.failed Β· wallet.funded Β· conversion.completed
GET /v1/fees Your fee schedule (transfer/conversion fee rates)POST /v1/org/members/invite Invite member to organization
GET /v1/org/members List organization members
PATCH /v1/org/members/{userId} Update member role
DELETE /v1/org/members/{userId} Remove member
POST /v1/org/invites/accept Accept organization invite (public)POST /v1/wallets/{id}/deposit/fiat Initiate fiat deposit
POST /v1/wallets/{id}/withdraw/fiat Initiate fiat withdrawal
POST /v1/webhooks/fiat/{provider} Fiat provider webhook receiverGET /health Health check- Key storage: Stellar secrets are encrypted with AES-256-GCM before storage. The 32-byte master key lives only in env β never in the database or logs.
- No key exposure: Secret keys are never returned by any API endpoint.
- Signer abstraction:
stellar.Signerininternal/stellar/signer.goisolates all signing. SwapEnvSignerfor HSM or AWS KMS without touching the settlement engine. - Decimal arithmetic: All monetary values use
shopspring/decimalβ no floating-point. - API key hashing: Raw keys are SHA-256 hashed before storage; the plaintext is shown exactly once on creation.
make test # go test ./... -race
make test-cover # with HTML coverage report
make lint # golangci-lint
make build # outputs bin/api + bin/worker
make tidy # go mod tidyFund a testnet wallet:
curl "https://friendbot.stellar.org?addr=<PUBLIC_KEY>"- CrowdPay β crowdfunding platform built on top of Fluxa payment rails
- SaviTools β developer tools: API playground, transaction inspector, wallet sandbox
See CONTRIBUTING.md.
MIT