import { MonitoredAddress } from '@/domain/aggregates/monitored-address';
import { ChainType, EvmAddress } from '@/domain/value-objects';

export const MONITORED_ADDRESS_REPOSITORY = Symbol('MONITORED_ADDRESS_REPOSITORY');

export interface IMonitoredAddressRepository {
  /**
   * 保存监控地址
   */
  save(address: MonitoredAddress): Promise<MonitoredAddress>;

  /**
   * 根据ID查找
   */
  findById(id: bigint): Promise<MonitoredAddress | null>;

  /**
   * 根据链类型和地址查找
   */
  findByChainAndAddress(
    chainType: ChainType,
    address: EvmAddress,
  ): Promise<MonitoredAddress | null>;

  /**
   * 查找链上所有活跃地址
   */
  findActiveByChain(chainType: ChainType): Promise<MonitoredAddress[]>;

  /**
   * 根据用户ID查找
   */
  findByUserId(userId: bigint): Promise<MonitoredAddress[]>;

  /**
   * 检查地址是否已存在
   */
  existsByChainAndAddress(chainType: ChainType, address: EvmAddress): Promise<boolean>;

  /**
   * 获取所有活跃地址（用于构建地址集合）
   */
  getAllActiveAddresses(chainType: ChainType): Promise<string[]>;
}
