"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.GetTokenBySymbolUseCase = void 0;
const not_found_error_1 = require("../../../domain/errors/not-found-error");
class GetTokenBySymbolUseCase {
    tokenRepository;
    constructor(tokenRepository) {
        this.tokenRepository = tokenRepository;
    }
    async execute(symbol) {
        const token = await this.tokenRepository.findBySymbol(symbol);
        if (!token) {
            throw new not_found_error_1.NotFoundError('Token', symbol);
        }
        return token;
    }
}
exports.GetTokenBySymbolUseCase = GetTokenBySymbolUseCase;
//# sourceMappingURL=get-token-by-symbol.use-case.js.map