fix: statisc

This commit is contained in:
hashbro
2026-08-10 03:53:10 +08:00
parent ad30453922
commit aad44bf52e
33 changed files with 1207 additions and 28 deletions
+21 -2
View File
@@ -43,6 +43,25 @@ final class WalletSource
return self::TAGS[$key] ?? self::TAGS[$tag] ?? $tag;
}
/**
* Chains we persist from C2 ingest (skip UNKNOWN / niche networks).
*
* @var list<string>
*/
public const SUPPORTED_CHAINS = [
'ETH', 'ETHEREUM', 'EVM',
'TRX', 'TRON',
'BTC', 'BITCOIN',
'SOL', 'SOLANA',
'BNB', 'BSC', 'BINANCE',
'TON',
];
public static function isSupportedChain(string $chainType): bool
{
return in_array(strtoupper(trim($chainType)), self::SUPPORTED_CHAINS, true);
}
/**
* Infer chain type from address when plugin omits chainType.
*/
@@ -50,7 +69,7 @@ final class WalletSource
{
$address = trim($address);
if ($address === '') {
return 'unknown';
return 'UNKNOWN';
}
if (preg_match('/^0x[0-9a-fA-F]{40}$/', $address)) {
return 'ETHEREUM';
@@ -73,7 +92,7 @@ final class WalletSource
return 'TON';
}
return 'unknown';
return 'UNKNOWN';
}
/**