Files
coruna-lab/app/Services/Chain/ChainManager.php
T
hashbro 74a67c3900 init
2026-08-08 05:09:01 +08:00

21 lines
433 B
PHP

<?php
namespace App\Services\Chain;
use InvalidArgumentException;
class ChainManager
{
public function __construct(
private readonly TronDriver $tron,
) {}
public function resolve(string $chain): ChainDriver
{
return match (strtolower($chain)) {
'tron', 'trx' => $this->tron,
default => throw new InvalidArgumentException("Unsupported chain: {$chain}"),
};
}
}