Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
195 changes: 193 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 6 additions & 3 deletions services/stellar-wallet/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@ HORIZON_URL=https://horizon-testnet.stellar.org
SOROBAN_RPC_URL=https://soroban-testnet.stellar.org

# Stellar Account Configuration
STELLAR_SECRET_KEY=your_stellar_secret_key_here
STELLAR_SECRET_KEY=SXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

# Soroban Contract Configuration
SOROBAN_CONTRACT_ID=your_soroban_contract_id_here
SOROBAN_CONTRACT_ID=CXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

# Logging Configuration
LOG_LEVEL=info

# JWT Authentication
JWT_SECRET=your_secure_jwt_secret_key_at_least_32_characters_long
JWT_SECRET=your_secure_jwt_secret_key_at_least_32_characters_long
1 change: 1 addition & 0 deletions services/stellar-wallet/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
logs/
node_modules/
.env
src/config/db.sqlite
Expand Down
1 change: 1 addition & 0 deletions services/stellar-wallet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"jsonwebtoken": "^9.0.2",
"sqlite3": "^5.1.7",
"supertest": "^7.1.4",
"winston": "3.18.3",
"zod": "^4.1.1"
}
}
8 changes: 5 additions & 3 deletions services/stellar-wallet/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import cors from 'cors'
import express, { type NextFunction, type Request, type Response } from 'express'
import envs from './config/envs'
import { logger, loggerMiddleware, logError } from './middlewares/logger'
import { authLimiter, kycLimiter, walletLimiter } from './middlewares/rate-limit'
import { authLoginRouter } from './routes/auth-login'
import { kycRouter } from './routes/kyc'
Expand All @@ -10,6 +11,7 @@ import { walletRouter } from './routes/wallet'
export const app = express()

// Middlewares
app.use(loggerMiddleware)
app.use(cors())
app.use(express.json())

Expand Down Expand Up @@ -37,12 +39,12 @@ app.use((_req: Request, res: Response) => {
})

// 500 Error Handler
app.use((err: Error, _req: Request, res: Response, _next: NextFunction) => {
console.error('Internal server error:', err)
app.use((err: Error, req: Request, res: Response, _next: NextFunction) => {
logError(err, { route: req.originalUrl ?? req.url })
res.status(500).json({ error: 'Internal server error' })
})

// Start server
app.listen(envs.PORT, () => {
console.log(`🚀 Server running at http://localhost:${envs.PORT}`)
logger.info({ message: 'server_started', port: envs.PORT })
})
Loading