Hello!
Definitely get this checked out before you burn your house down. When you take the iPhone to the Apple Store for inspection, make sure to take both cables and the adapter you used with you, so the Apple staff can inspect them.
And I don’t know too much about electrical, but I have a feeling maybe your breaker should’ve tripped? I’m not sure though. iPhones don’t draw that much juice… what I’m trying to say is, consider having an electrician inspect your outlets/breaker panel, assuming you had an adapter plugged into the wall and were charging it that way. You didn’t say where the fire started, which is why I’m bringing this up.
Ok, stay safe and don’t put out electrical fires with water.