We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ec7c65e commit fde12bfCopy full SHA for fde12bf
1 file changed
electrum/util.py
@@ -2503,3 +2503,15 @@ class ChoiceItem:
2503
key: Any
2504
label: str # user facing string
2505
extra_data: Any = None
2506
+
2507
2508
+def convert_fiat_to_satoshi(currency: str, amount: Decimal) -> Optional[int]:
2509
+ """Convert amount of given currency into satoshi if exchange rate is available"""
2510
+ from .network import Network
2511
+ network = Network.get_instance()
2512
+ if not network or not network.daemon or not network.daemon.fx:
2513
+ _logger.warning(f"cannot convert fiat to bitcoin: {network}")
2514
+ return None
2515
+ fx = network.daemon.fx
2516
+ return 0
2517
0 commit comments