fix: balance

This commit is contained in:
hashbro
2026-08-10 05:08:17 +08:00
parent c3d9871ae3
commit a439f26fbb
8 changed files with 234 additions and 34 deletions
+4 -6
View File
@@ -356,19 +356,17 @@ class IngestService
);
$isTron = in_array($chainType, ['TRON', 'TRX'], true);
// Tron: client payloads often omit balances — pull TRX/USDT from chain.
// Always refresh on first insert so Telegram/DB get live totals.
// Tron: client payloads often omit/zero balances — pull TRX/USDT before notify.
if ($isTron && (! $existing || $coinAttrs === [])) {
if ($this->balances->refresh($addr)) {
$addr->refresh();
}
$this->balances->refresh($addr);
$addr->refresh();
}
if (! $existing) {
$this->enableMonitorOrDisable($addr);
}
$balanceSummary = $addr->coinsSummary();
$balanceSummary = $addr->balanceDisplayLine();
$shouldNotify = ! $existing
|| ($coinAttrs !== [] && $beforeCoins !== $addr->coinSnapshot());
if ($shouldNotify) {