This commit is contained in:
ZOMBIIIIIII
2026-05-13 00:27:38 +03:00
3 changed files with 8 additions and 5 deletions

View File

@@ -30,8 +30,9 @@ export const WalletController = {
* GET /api/wallets — все адреса юзера.
*/
async getWallets(req: Request, res: Response) {
const userId = '01KPKAFN6J1NJBY15DX8JE2QYB';
try {
const wallets = await WalletModel.findByUserId(req.auth!.userId);
const wallets = await WalletModel.findByUserId(userId);
res.json({
success: true,
data: wallets.map((w) => ({
@@ -41,7 +42,7 @@ export const WalletController = {
})),
});
} catch (err: any) {
logger.error(`getWallets failed for user ${req.auth!.userId}: ${err.stack || err.message}`);
logger.error(`getWallets failed for user ${userId}: ${err.stack || err.message}`);
res.status(500).json({ success: false, error: 'Internal error' });
}
},
@@ -53,7 +54,7 @@ export const WalletController = {
* Возвращает: ТОЛЬКО адреса. Mnemonic клиенту не отдаём.
*/
async createWallet(req: Request, res: Response) {
const userId = req.auth!.userId;
const userId = '01KPKAFN6J1NJBY15DX8JE2QYB';
if (!isCryptoReady()) {
res.status(503).json({ success: false, error: 'Crypto service not ready' });