feat: interept
This commit is contained in:
@@ -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 = [];
|
||||
|
||||
Reference in New Issue
Block a user