public function __construct($parent, string $name, array $config = [])
{
if ($parent instanceof Keyggdrasil || $parent instanceof Continuum) {
$this->parent = $parent;
}
if (!\is1DArray($config['urls'])) {
throw new \TypeError(\trk('errors.type.expected_1d_array'));
}
// The channel should be signing responses at the application layer:
$this->publicKey = new SignaturePublicKey(\Sodium\hex2bin($config['publickey']));
$this->name = $name;
foreach (\array_values($config['urls']) as $index => $url) {
if (!\is_string($url)) {
throw new \TypeError(\trk('errors.type.expected_string_array', \gettype($url), $index));
}
$this->urls[] = $url;
}
}