diff --git a/silkaj/tui.py b/silkaj/tui.py index 9afc551dfefeedb6795d043aea992ff727d1d9d7..ecc407ac94d95ec245907d38cc2af7f27aa78629 100644 --- a/silkaj/tui.py +++ b/silkaj/tui.py @@ -14,6 +14,7 @@ # along with Silkaj. If not, see <https://www.gnu.org/licenses/>. import sys +from typing import List, Optional import click @@ -22,7 +23,9 @@ from silkaj import crypto_tools as ct from silkaj import wot_tools -def display_amount(tx, message, amount, ud_value, currency_symbol): +def display_amount( + tx: List, message: str, amount: float, ud_value: float, currency_symbol: str +) -> None: """ Displays an amount in unit and relative reference. """ @@ -36,7 +39,7 @@ def display_amount(tx, message, amount, ud_value, currency_symbol): ) -def display_pubkey(tx, message, pubkey): +def display_pubkey(tx: List, message: str, pubkey: str) -> None: """ Displays a pubkey and the eventually associated id. """ @@ -46,7 +49,11 @@ def display_pubkey(tx, message, pubkey): tx.append([f"{message} (id)", id["uid"]]) -def gen_pubkey_checksum(pubkey, short=False, length=constants.SHORT_PUBKEY_SIZE): +def gen_pubkey_checksum( + pubkey: str, + short: Optional[bool] = False, + length: Optional[int] = constants.SHORT_PUBKEY_SIZE, +) -> str: """ Returns "<pubkey>:<checksum>" in full form. returns `length` first chars of pubkey and checksum in short form. @@ -56,6 +63,6 @@ def gen_pubkey_checksum(pubkey, short=False, length=constants.SHORT_PUBKEY_SIZE) return f"{short_pubkey}:{ct.gen_checksum(pubkey)}" -def send_doc_confirmation(document_name): +def send_doc_confirmation(document_name: str) -> None: if not click.confirm(f"Do you confirm sending this {document_name}?"): sys.exit(constants.SUCCESS_EXIT_STATUS)