[electrum] typehints and minor cleanup in interface.py
Summary:
This is a code cleanup to help me better understand the network.py code.
Add typehints where the IDE cannot guees the type.
Use an Enum for interface modes for better type-safety and more helpful IDE assistance.
Remove an unused TCPConnection.protocol attribute.
Use the more modern NamedTuple class definition.
Test Plan:
python test_runner.py python -m electrumabc.interface pytest electrumabc/tests/regtest
Run the application, check the network dialog, change the server.
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Differential Revision: https://reviews.bitcoinabc.org/D14947