I think that both of them are okay because "に" of them is called 格助詞, The target 「に」 particle, etc.
Here is 格助詞's words order,
noun + 格助詞
"十分" + に (in this case)
"に" indicates a final goal.
Enough sleeping is the final goal, in this case, then if words order is changed, we can understand the goal, so both of the sentences are okay and sounds natural.