West Ham have agreed to sell striker Lucas Perez to Alaves, according to Sky sources.