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

export interface PoolAccountDepositConfirmedPayload {
  depositId: string;
  chainType: string;
  txHash: string;
  fromAddress: string;
  toAddress: string;
  poolType: 'BURN_POOL' | 'MINING_POOL';
  tokenContract: string;
  amount: string;
  amountFormatted: string;
  confirmations: number;
  blockNumber: string;
  blockTimestamp: string;
  [key: string]: unknown;
}

/**
 * 池账户充值确认事件
 * 当池钱包的 fUSDT 充值交易达到确认数时触发
 * 由 mining-wallet-service 消费，用于池账户入账
 */
export class PoolAccountDepositConfirmedEvent extends DomainEvent {
  readonly eventType = 'mining_blockchain.pool_account.deposit.confirmed';

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

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