function addNetwork(data) {
  var network = new Network();

  JSUtil.defineImmutable(network, {
    name: data.name,
    alias: data.alias,
    is: data.is,
    pubkeyhash: data.pubkeyhash,
    privatekey: data.privatekey,
    scripthash: data.scripthash,
    bech32prefix: data.bech32prefix,
    xpubkey: data.xpubkey,
    xprivkey: data.xprivkey
  });

  if (data.networkMagic) {
    JSUtil.defineImmutable(network, {
      networkMagic: BufferUtil.integerAsBuffer(data.networkMagic)
    });
  }

  if (data.port) {
    JSUtil.defineImmutable(network, {
      port: data.port
    });
  }

  if (data.dnsSeeds) {
    JSUtil.defineImmutable(network, {
      dnsSeeds: data.dnsSeeds
    });
  }

  for (const value of Object.values(network)) {
    if (value != null && typeof value !== 'object') {
      if (!networkMaps[value]) {
        networkMaps[value] = [];
      }
      networkMaps[value].push(network);
    }
  };

  networks.push(network);

  for (const variant of data.variants || []) {
    addNetwork({
      ...data,
      variants: undefined,
      ...variant,
    });
  }

  return network;
}
@function
@member Networks#add
Will add a custom Network
@param {Object} data
@param {string} data.name - The name of the network
@param {string} data.alias - The aliased name of the network
@param {Number} data.pubkeyhash - The publickey hash prefix
@param {Number} data.privatekey - The privatekey prefix
@param {Number} data.scripthash - The scripthash prefix
@param {string} data.bech32prefix - The native segwit prefix
@param {Number} data.xpubkey - The extended public key magic
@param {Number} data.xprivkey - The extended private key magic
@param {Array}  data.variants - An array of variants
@param {string} data.variants.name - The name of the variant
@param {Number} data.variants.networkMagic - The network magic number
@param {Number} data.variants.port - The network port
@param {Array}  data.variants.dnsSeeds - An array of dns seeds
@return Network