public static function normalizeNetwork($network, $testnet) {
        $regtest = false;
        switch (strtolower($network)) {
            case 'btc':
            case 'bitcoin':
                $network = 'bitcoin';
                break;

            case 'tbtc':
            case 'bitcoin-testnet':
                $network = 'bitcoin';
                $testnet = true;
                break;
            case 'bcc':
            case 'bch':
            case 'bitcoincash':
                $network = 'bitcoincash';
                break;

            case 'tbch':
            case 'tbcc':
            case 'bitcoincash-testnet':
                $network = 'bitcoincash';
                $testnet = true;
                break;

            case 'rbtc':
            case 'bitcoin-regtest':
                $network = 'bitcoin';
                $testnet = true;
                $regtest = true;
                break;

            case 'rbch':
            case 'bitcoincash-regtest':
                $network = 'bitcoincash';
                $testnet = true;
                $regtest = true;
                break;

            default:
                throw new \Exception("Unknown network [{$network}]");
            // this comment silences a phpcs error.
        }

        return [$network, $testnet, $regtest];
    }