You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Install dependencies
bun install
# Start Redis (optional, for caching)
docker compose -f docker-compose.dev.yml up -d
# Start development server
bun run dev
# Chain configurations are fetched from Safe Config Service automatically# Optionally override specific chains with TX_SERVICE_URLS
TX_SERVICE_URLS='{"1":"https://custom-tx-service.example.com"}' bun run dev
Docker
# Build and run with Docker Compose
docker compose up --build
# Or build image manually
docker build -t safe-transaction-service-api .
docker run -p 3000:3000 safe-transaction-service-api
Test Endpoints
# Health check
curl http://localhost:3000/health
# Get Safe info (requires TX_SERVICE_URLS)
curl http://localhost:3000/api/v1/chains/1/safes/0x0DA0C3e52C977Ed3cBc641fF02DD271c3ED55aFe
# Get Safes by owner
curl http://localhost:3000/api/v1/chains/1/owners/0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045/safes
# Get balances
curl http://localhost:3000/api/v1/chains/1/safes/0x0DA0C3e52C977Ed3cBc641fF02DD271c3ED55aFe/balances
API Endpoints
REST (Backwards Compatible)
Endpoint
Description
GET /health
Health check
GET /ready
Readiness check
GET /api/v1/chains/:chainId/safes/:address
Get Safe info
GET /api/v1/chains/:chainId/owners/:address/safes
Get Safes by owner
GET /api/v1/chains/:chainId/safes/:address/balances
Get Safe balances
GET /api/v1/chains/:chainId/safes/:address/multisig-transactions
Get transactions
GET /api/v1/chains/:chainId/transactions/:safeTxHash
bun run dev # Development server with hot reload
bun run start # Start production server
bun run build # Build for production
bun run test# Run unit + integration tests
bun run test:unit # Run unit tests only
bun run test:integration # Run integration tests only
bun run test:e2e # Run E2E tests (needs network)
bun run test:coverage # Run with coverage
bun run lint # ESLint
bun run lint:fix # ESLint with auto-fix
bun run format # Prettier
bun run typecheck # TypeScript check
The service automatically fetches chain configurations from Safe Config Service. This provides:
Dynamic chain support: No manual configuration needed for new chains
VPC URL support: Use internal network URLs for better performance (USE_TX_SERVICE_VPC_URL=true)
Override capability: Use TX_SERVICE_URLS to override specific chains for testing
URL Resolution Priority
TX_SERVICE_URLS override (if configured)
Config Service (VPC or public URL based on USE_TX_SERVICE_VPC_URL)
Error if chain not found
Example Configurations
# Use Config Service for all chains (recommended)
SAFE_CONFIG_BASE_URI=https://safe-config.safe.global/
# Use VPC URLs for internal network optimization
USE_TX_SERVICE_VPC_URL=true
# Override specific chains for local testing
TX_SERVICE_URLS='{"1":"http://localhost:8000","137":"https://custom-polygon.example.com"}'
Operating Modes
Mode 1: PROXY Mode 2: HYBRID Mode 3: NATIVE
───────────── ────────────── ─────────────
Forwards to Reads from unified Full unified
existing TX DB, falls back to database
Services TX Services
Zero migration Gradual migration Final state