fn infer_network_from_chain_id( networks: NetworkConfigs, chain_id: Option<u64>, ) -> Result<NetworkConfigs>