Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions packages/backend/src/admin/admin.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export class AdminService {
switch (action) {
case 'EXECUTE':
case 'CREATE_ACCOUNT':
case 'CLAIM':
return 'Horizen';
case 'DENY':
return '';
Expand Down Expand Up @@ -216,6 +217,23 @@ export class AdminService {
}
}

if (dto?.includeClaim) {
const claimHistories = await this.prisma.claimHistory.findMany({
where: hasDateFilter ? { createdAt: dateFilter } : undefined,
orderBy: { createdAt: 'asc' },
});

for (const claim of claimHistories) {
records.push({
timestamp: claim.createdAt,
action: 'CLAIM',
userAddress: claim.toAddress,
multisigWallet: null,
txHash: claim.txHash || 'PENDING',
});
}
}

// 5. EXECUTE records
const executedTxs = await this.prisma.transaction.findMany({
where: {
Expand Down Expand Up @@ -297,6 +315,8 @@ export class AdminService {
txHash = `${this.explorerConfig.HORIZEN_EXPLORER_ADDRESS}/${record.txHash}`;
} else if (record.action === 'EXECUTE') {
txHash = `${this.explorerConfig.HORIZEN_EXPLORER_TX}/${record.txHash}`;
} else if (record.action === 'CLAIM') {
txHash = `${this.explorerConfig.HORIZEN_EXPLORER_TX}/${record.txHash}`;
}
} else if (record.txHash === 'PENDING') {
txHash = 'PENDING';
Expand Down
9 changes: 9 additions & 0 deletions packages/backend/src/admin/dto/analytics-report.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,13 @@ export class AnalyticsReportDto {
@IsBoolean()
@Transform(({ value }) => value === 'true' || value === true)
includeDeny?: boolean;

@ApiPropertyOptional({
description: 'Include CLAIM records',
default: true,
})
@IsOptional()
@IsBoolean()
@Transform(({ value }) => value === 'true' || value === true)
includeClaim?: boolean;
}