Firearm , Cannons and hand-Guns are mentioned in Hinduism scriptures like Ramayana And mahabharata. The word used for Cannons in scripture is shataghnii -शतघ्नी .
This śataghnī literally is that which can kill a thousand people, and
it is said to be a canon.
Mentioning of canons in Ramayana.
Valmiki Ramayana is mentioning about cannons deployed in city of Dasharatha in -Book I : Bala Kanda - Sarga 5- The Youthful Majesties .
सूत मागध संबाधाम् श्रीमतीम् अतुल प्रभाम् |
उच्चाट्टाल ध्वजवतीम्
शतघ्नी शत संकुलाम् || VR .1.5.11||
suuta maagadha sambaadhaam shriimatiim atula prabhaam | ucchaaTTaala
dhvajavatiim shataghnii shata samkulaam ||
She that prosperous city Ayodhya is muchly crammed with many a
eulogist and panegyrist, yet she is highly splendorous with many a
bastion, flag and hundreds of batteries of canons, and Dasharatha
dwells therein. [1-5-11]
Note that here the word "shataghnii " is used for canons .
Mentioning of Cannons and Hand Guns in Mahabharata.
Similarly Mahabharata is also describing this canon called shataghnii . It is mentioned in Mahabharata Adi Parva - Viduragamana Parva - Chapter 199.
भीमोतमहाचक्रं बृहतटटालसंवृतं |
दृढप्राकारनिर्युहं शतघ्नीजालसंवृत्तं ||
Here there are big giant wheels which are frightning. The slabs of the entrance gates of this city is pretty much strong. And this city is surrounded by series of Shatagni cannons .
And
here is different verse from same chapter
तीक्ष्णाङ्कुश शतघ्नीभिर यन्त्रजालैश च शॊभितम |
आयसैश च महाचक्रैः
शुशुभे तत पुरॊत्तमम ||33||
tīkṣṇāṅkuśa śataghnībhir yantrajālaiś ca śobhitam
āyasaiś ca
mahācakraiḥ śuśubhe tat purottamam
here Mahabharata is mentioning a series of mechanism which are similar to cannons.
Mahabharata is also mentioning about
hand cannons and hand guns. It is mentioned in Mahabharata -
Adi-Parva - khandav Dahan Parva - Chapter 226 - Verse - 25. In the description of war between Devas and Krishna-Arjuna during Khandav Dahana episode.
अय:कणपचक्राश्म भुषुण्डयुद्यतवावह: |
कृष्णपार्थो जिघांसन्त:
क्रोधसम्मुर्छतौजस || 25||
Somebody was holding the mechanism which were propelling balls made
up of iron (handguns ,cannons etc.) and others were equipped with
Chakra , Stones and bhusundi. Angrily they approached towards Shree
Krishna and wanted to kill both.
And here is Sacred Text translation of above verse.
iron balls and bullets, and catapults for propelling huge stones, and
rockets, See p. 443