Green’s Dictionary of Slang

shanty n.1

(US) a black eye.

[UK]Maggie Cline [perf.] ‘Down Went McGinty’ 🎵 So he tightly grabbed his stick and hit the driver a lick / Then he raised a little shanty on his eye.
[US](con. 1890s) H. Asbury Gangs of N.Y. 276: ‘I only give her a little poke,’ he exclaimed. ‘Just enough to put a shanty on her glimmer. But I always takes off me knucks first.’.
[US]W.R. Burnett Dark Hazard (1934) 61: He felt a stinging pain under his right eye. A shanty; blue and purple probably.
[US]Berrey & Van den Bark Amer. Thes. Sl. §121.23: blackened eye, shanty.

In phrases

hang a shanty on (v.)

(Aus.) to give someone a black eye.

[Aus]Bulletin (Sydney) 12 Apr. 12/2: Whenever he appeared with a shanty hung on his eye — and that was not seldom.