import { DomainEvent } from './domain-event.base';

export interface DepositConfirmedPayload {
  depositId: string;
  chainType: string;
  txHash: string;
  toAddress: string;
  amount: string;
  amountFormatted: string;
  confirmations: number;
  accountSequence: string;  // 跨服务关联标识 (全局唯一业务ID)
  userId: string;           // 保留兼容
  [key: string]: unknown;
}

/**
 * 充值确认事件
 * 当充值交易达到确认数时触发
 */
export class DepositConfirmedEvent extends DomainEvent {
  readonly eventType = 'blockchain.deposit.confirmed';

  constructor(private readonly payload: DepositConfirmedPayload) {
    super();
  }

  toPayload(): DepositConfirmedPayload {
    return this.payload;
  }
}
