From 606e49c6bc8ba1f0dc513267682fe46df26d4654 Mon Sep 17 00:00:00 2001 From: BoHsuu <115441679+Huygon764@users.noreply.github.com> Date: Wed, 11 Mar 2026 15:41:32 +0700 Subject: [PATCH 1/6] refactor: improve layout and responsiveness in Quest and Batch components (#200) - Updated QuestPage layout for better responsiveness with max-width and padding adjustments. - Changed BatchTransactions and TransactionSummary components to use flexbox for improved item alignment and responsiveness. - Enhanced QuestCard to allow for flexible width. - Added titles for new routes in the Title component. --- .../components/Batch/BatchContainer.tsx | 6 +--- .../components/Batch/TransactionSummary.tsx | 31 +++++-------------- 2 files changed, 9 insertions(+), 28 deletions(-) diff --git a/packages/nextjs/components/Batch/BatchContainer.tsx b/packages/nextjs/components/Batch/BatchContainer.tsx index febcefc..93cecd6 100644 --- a/packages/nextjs/components/Batch/BatchContainer.tsx +++ b/packages/nextjs/components/Batch/BatchContainer.tsx @@ -179,11 +179,7 @@ function BatchTransactions({ {/* Recipient */}
${balanceShort} / ${thresholdShort} ETH`,
+ );
+ } else {
+ this.logger.log(`${name} balance OK: ${balanceFormatted} ETH`);
+ }
+ } catch (error) {
+ this.logger.error(
+ `Failed to check balance on ${name}: ${error.message}`,
+ );
+ alerts.push(
+ `${name}\nFailed to check balance: ${error.message}`,
+ );
+ }
+ }
+
+ if (alerts.length > 0) {
+ const now = new Date().toLocaleString('vi-VN', {
+ timeZone: 'Asia/Ho_Chi_Minh',
+ day: '2-digit',
+ month: '2-digit',
+ year: 'numeric',
+ hour: '2-digit',
+ minute: '2-digit',
+ });
+
+ const message =
+ `ā ļø PolyPay Relayer ā Low Balance\n\n` +
+ `š ${this.walletAddress}\n\n` +
+ alerts.join('\n\n') +
+ `\n\nā° ${now} (UTC+7)`;
+
+ await this.telegramService.sendMessage(message);
+ }
+ }
+}
diff --git a/packages/backend/src/balance-alert/telegram.service.ts b/packages/backend/src/balance-alert/telegram.service.ts
new file mode 100644
index 0000000..df1b1d2
--- /dev/null
+++ b/packages/backend/src/balance-alert/telegram.service.ts
@@ -0,0 +1,80 @@
+import { Injectable, Logger } from '@nestjs/common';
+import { ConfigService } from '@nestjs/config';
+
+@Injectable()
+export class TelegramService {
+ private readonly logger = new Logger(TelegramService.name);
+ private readonly botToken: string | undefined;
+ private readonly chatId: string | undefined;
+ private readonly maxRetries = 3;
+
+ constructor(private readonly configService: ConfigService) {
+ this.botToken = this.configService.get{title}
+{title}
-+ Drag & drop a CSV file here, or browse +
+ { + const file = e.target.files?.[0]; + if (file) handleFile(file); + e.target.value = ""; + }} + /> +Expected CSV format:
+
+ address,amount,token
+
+ 0x1234...abcd,1.5,ETH
+
+ 0x5678...efgh,50.5,USDC
+
+ 0x5678...ef12,4.8,ZEN
+
+