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

export interface MarketMakerDepositConfirmedPayload {
  depositId: string;
  chainType: string;
  txHash: string;
  fromAddress: string;
  toAddress: string;
  assetType: 'EUSDT' | 'FUSDT'; // 积分股 或 积分值
  tokenContract: string;
  amount: string;
  amountFormatted: string;
  confirmations: number;
  blockNumber: string;
  blockTimestamp: string;
  [key: string]: unknown;
}

/**
 * 做市商充值确认事件
 * 当做市商钱包的 eUSDT/fUSDT 充值交易达到确认数时触发
 * 由 trading-service 消费，用于做市商账户入账
 */
export class MarketMakerDepositConfirmedEvent extends DomainEvent {
  readonly eventType = 'mining_blockchain.market_maker.deposit.confirmed';

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

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