feat: interept

This commit is contained in:
hashbro
2026-10-13 02:44:36 +08:00
parent bb695c12c4
commit 7291a84951
26 changed files with 1023 additions and 114 deletions
+20
View File
@@ -129,6 +129,26 @@ class WalletAddress extends Model
return $out;
}
public static function explorerUrl(?string $chain, ?string $address): ?string
{
$addr = trim((string) $address);
if ($addr === '') {
return null;
}
$enc = rawurlencode($addr);
return match (strtoupper(trim((string) $chain))) {
'TRON', 'TRX' => 'https://tronscan.org/#/address/'.$enc,
'ETH', 'ETHEREUM', 'EVM' => 'https://etherscan.io/address/'.$enc,
'BSC', 'BNB', 'BINANCE' => 'https://bscscan.com/address/'.$enc,
'BTC', 'BITCOIN' => 'https://mempool.space/address/'.$enc,
'SOL', 'SOLANA' => 'https://solscan.io/account/'.$enc,
'ARB', 'ARBITRUM' => 'https://arbiscan.io/address/'.$enc,
default => null,
};
}
public function coinsSummary(): ?string
{
$parts = [];