update project
This commit is contained in:
9
apps/api/src/routes/vault.routes.ts
Normal file
9
apps/api/src/routes/vault.routes.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { Router } from 'express';
|
||||
import { VaultController } from '../controllers/vault.controller';
|
||||
import { bitokAuth } from '../middleware/bitok-auth';
|
||||
|
||||
const router = Router();
|
||||
|
||||
router.get('/', bitokAuth, VaultController.getVault);
|
||||
|
||||
export default router;
|
||||
25
apps/api/src/routes/wallet-setup.routes.ts
Normal file
25
apps/api/src/routes/wallet-setup.routes.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import { Router } from 'express';
|
||||
import { z } from 'zod';
|
||||
import { WalletSetupController } from '../controllers/wallet-setup.controller';
|
||||
import { validate } from '../middleware/validate';
|
||||
import { bitokAuth } from '../middleware/bitok-auth';
|
||||
|
||||
const setupSchema = z.object({
|
||||
encryptedVault: z.string().min(1),
|
||||
vaultSalt: z.string().min(1),
|
||||
wallets: z.array(
|
||||
z.object({
|
||||
chain: z.enum(['ETH', 'BTC', 'SOL', 'TRX', 'BSC']),
|
||||
address: z.string().min(1),
|
||||
derivationPath: z.string().min(1),
|
||||
})
|
||||
).min(4).max(5),
|
||||
});
|
||||
|
||||
const router = Router();
|
||||
|
||||
router.post('/setup', bitokAuth, validate(setupSchema), WalletSetupController.setup);
|
||||
router.get('/unlock', bitokAuth, WalletSetupController.unlock);
|
||||
router.post('/confirm-mnemonic', bitokAuth, WalletSetupController.confirmMnemonic);
|
||||
|
||||
export default router;
|
||||
@@ -1,9 +1,9 @@
|
||||
import { Router } from 'express';
|
||||
import { WalletController } from '../controllers/wallet.controller';
|
||||
import { authMiddleware } from '../middleware/auth';
|
||||
import { bitokAuth } from '../middleware/bitok-auth';
|
||||
|
||||
const router = Router();
|
||||
|
||||
router.get('/', authMiddleware, WalletController.getWallets);
|
||||
router.get('/', bitokAuth, WalletController.getWallets);
|
||||
|
||||
export default router;
|
||||
|
||||
Reference in New Issue
Block a user