We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e85a3ab commit fa631b4Copy full SHA for fa631b4
1 file changed
electrum/util.py
@@ -2524,3 +2524,15 @@ class ChoiceItem:
2524
key: Any
2525
label: str # user facing string
2526
extra_data: Any = None
2527
+
2528
2529
+def convert_fiat_to_satoshi(currency: str, amount: Decimal) -> Optional[int]:
2530
+ """Convert amount of given currency into satoshi if exchange rate is available"""
2531
+ from .network import Network
2532
+ network = Network.get_instance()
2533
+ if not network or not network.daemon or not network.daemon.fx:
2534
+ _logger.warning(f"cannot convert fiat to bitcoin: {network}")
2535
+ return None
2536
+ fx = network.daemon.fx
2537
+ return 0
2538
0 commit comments