feat: new chain
This commit is contained in:
@@ -8,12 +8,16 @@ class ChainManager
|
||||
{
|
||||
public function __construct(
|
||||
private readonly TronDriver $tron,
|
||||
private readonly EthDriver $eth,
|
||||
private readonly BtcDriver $btc,
|
||||
) {}
|
||||
|
||||
public function resolve(string $chain): ChainDriver
|
||||
{
|
||||
return match (strtolower($chain)) {
|
||||
'tron', 'trx' => $this->tron,
|
||||
'eth', 'ethereum' => $this->eth,
|
||||
'btc', 'bitcoin' => $this->btc,
|
||||
default => throw new InvalidArgumentException("Unsupported chain: {$chain}"),
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user