feat: app
This commit is contained in:
@@ -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
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user