feat: app

This commit is contained in:
hashbro
2026-10-05 20:47:59 +08:00
parent 9b46e5c76b
commit d0445117b3
8 changed files with 1106 additions and 31 deletions
+11 -8
View File
@@ -1278,14 +1278,17 @@ class IngestService
if ($address === '') {
continue;
}
if (! isset($byAddr[$address])) {
$chain = (string) ($item['chainType'] ?? $item['chain'] ?? '');
if ($chain === '') {
$chain = WalletSource::inferChainType($address);
}
$byAddr[$address] = [
$chain = strtoupper((string) ($item['chainType'] ?? $item['chain'] ?? ''));
if ($chain === '') {
$chain = WalletSource::inferChainType($address);
}
// Key by address + chain: the same 0x address is a valid row on
// ETH, BSC and ARB at once and must not collapse into one.
$key = $address.'|'.$chain;
if (! isset($byAddr[$key])) {
$byAddr[$key] = [
'address' => $address,
'chain_type' => strtoupper($chain),
'chain_type' => $chain,
'balance' => [],
];
}
@@ -1293,7 +1296,7 @@ class IngestService
if ($symbol === '') {
continue;
}
$byAddr[$address]['balance'][$symbol] = WalletSource::formatBalance(
$byAddr[$key]['balance'][$symbol] = WalletSource::formatBalance(
$item['balance'] ?? $item['value'] ?? 0,
$item['decimal'] ?? $item['decimals'] ?? null
);