"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createWalletRoutes = void 0;
const express_1 = require("express");
const validation_middleware_1 = require("../middleware/validation.middleware");
const dto_1 = require("../../application/dto");
/**
 * Wallet routes mounted under `/api/v1`.
 *
 * Routes:
 *  - POST   /wallets/seedphrase                         Generate a BIP39 seed phrase (not stored).
 *                                                        Body: { wordCount?: 12 | 24 }
 *  - POST   /wallets                                     Create a wallet and generate addresses for active networks.
 *                                                           *                                                        Body: { name: string, syncType: 'created' | 'imported', phrase: string, deviceIds: string[] }
 *  - GET    /wallets/:id                                 Get a wallet by its UUID.
 *                                                        Param: { id: string (UUID) }
 *  - GET    /devices/:deviceId/wallets                   List wallets linked to a device.
 *                                                        Param: { deviceId: string (UUID) }
 *  - GET    /wallets/:walletId/networks/:networkId/address Get or derive an address for a wallet on a network.
 *                                                        Params: { walletId: string (UUID), networkId: string (UUID) }
 *  - GET    /wallets/:walletId/addresses                 List all addresses for a wallet.
 *                                                        Param: { walletId: string (UUID) }
 *  - GET    /wallets/:id/seedphrase                     Reveal the decrypted seed phrase for a wallet.
 *                                                        Param: { id: string (UUID) }
 */
const createWalletRoutes = (controller, strictRateLimiter) => {
    const router = (0, express_1.Router)();
    router.post('/wallets/seedphrase', strictRateLimiter, (0, validation_middleware_1.validateRequest)({ body: dto_1.seedPhraseSchema }), controller.generateSeedphrase);
    router.post('/wallets', strictRateLimiter, (0, validation_middleware_1.validateRequest)({ body: dto_1.createWalletSchema }), controller.create);
    router.get('/wallets/:id', (0, validation_middleware_1.validateRequest)({ params: dto_1.walletIdParamSchema }), controller.getById);
    router.get('/devices/:deviceId/wallets', (0, validation_middleware_1.validateRequest)({ params: dto_1.walletDeviceParamsSchema }), controller.getByDevice);
    router.get('/wallets/:walletId/networks/:networkId/address', (0, validation_middleware_1.validateRequest)({ params: dto_1.walletNetworkParamsSchema }), controller.getAddressForNetwork);
    router.get('/wallets/:walletId/addresses', (0, validation_middleware_1.validateRequest)({ params: dto_1.walletAddressParamsSchema }), controller.getAllAddresses);
    router.get('/wallets/:id/seedphrase', (0, validation_middleware_1.validateRequest)({ params: dto_1.walletIdParamSchema }), controller.getSeedPhrase);
    return router;
};
exports.createWalletRoutes = createWalletRoutes;
//# sourceMappingURL=wallet.routes.js.map