Iran threatened yesterday to take legal action in the International Court of Justice against the US if $2bn in frozen funds are “diverted” to compensate victims of attacks.