"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.GetWalletSeedPhraseUseCase = void 0;
const not_found_error_1 = require("../../../domain/errors/not-found-error");
class GetWalletSeedPhraseUseCase {
    walletRepository;
    encryptionService;
    constructor(walletRepository, encryptionService) {
        this.walletRepository = walletRepository;
        this.encryptionService = encryptionService;
    }
    async execute(id) {
        const wallet = await this.walletRepository.findById(id);
        if (!wallet) {
            throw new not_found_error_1.NotFoundError('Wallet', id);
        }
        return this.encryptionService.decrypt(wallet.encryptedPhrase);
    }
}
exports.GetWalletSeedPhraseUseCase = GetWalletSeedPhraseUseCase;
//# sourceMappingURL=get-wallet-seed-phrase.use-case.js.map