import { Controller, Get } from '@nestjs/common';
import { ApiTags, ApiOperation } from '@nestjs/swagger';
import { AccountingService } from './accounting.service';
import { RelayService } from '../relay/relay.service';

@ApiTags('accounting')
@Controller('v1/accounting')
export class AccountingController {
  constructor(
    private readonly accounting: AccountingService,
    private readonly relay: RelayService,
  ) {}

  @Get('stats')
  @ApiOperation({ summary: 'Gas 补贴统计（总量/趋势/按用户分布）' })
  getStats() {
    return this.accounting.getStats();
  }

  @Get('balance')
  @ApiOperation({ summary: 'Relayer 热钱包余额' })
  async getBalance() {
    const balance = await this.relay.getRelayerBalance();
    return { relayerBalance: balance };
  }
}
