"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.GetAddressByAddressUseCase = void 0;
const not_found_error_1 = require("../../../domain/errors/not-found-error");
class GetAddressByAddressUseCase {
    addressRepository;
    constructor(addressRepository) {
        this.addressRepository = addressRepository;
    }
    async execute(address) {
        const record = await this.addressRepository.findByAddress(address);
        if (!record) {
            throw new not_found_error_1.NotFoundError('Address', address);
        }
        return {
            id: record.id,
            address: record.address,
            type: record.type,
            walletId: record.walletId,
        };
    }
}
exports.GetAddressByAddressUseCase = GetAddressByAddressUseCase;
//# sourceMappingURL=get-address-by-address.use-case.js.map