Skip to content

Commit 1695948

Browse files
committed
wallet: type hints
1 parent 9b15667 commit 1695948

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

electrum/wallet.py

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1101,14 +1101,14 @@ def get_spendable_balance_sat(
11011101
oc_balance = sum([coin.value_sats() for coin in spendable_coins]) - anchor_reserve
11021102
return max(0, oc_balance)
11031103

1104-
def get_addr_balance(self, address):
1104+
def get_addr_balance(self, address) -> tuple[int, int, int]:
11051105
return self.adb.get_balance([address])
11061106

11071107
def get_utxos(
11081108
self,
11091109
domain: Optional[Iterable[str]] = None,
11101110
**kwargs,
1111-
):
1111+
) -> Sequence[PartialTxInput]:
11121112
if domain is None:
11131113
domain = self.get_addresses()
11141114
return self.adb.get_utxos(domain=domain, **kwargs)
@@ -1142,11 +1142,11 @@ def get_receiving_addresses(self, *, slice_start=None, slice_stop=None) -> Seque
11421142
def get_change_addresses(self, *, slice_start=None, slice_stop=None) -> Sequence[str]:
11431143
pass
11441144

1145-
def dummy_address(self):
1145+
def dummy_address(self) -> str:
11461146
# first receiving address
11471147
return self.get_receiving_addresses(slice_start=0, slice_stop=1)[0]
11481148

1149-
def get_frozen_balance(self):
1149+
def get_frozen_balance(self) -> tuple[int, int, int]:
11501150
with self._freeze_lock:
11511151
frozen_addresses = self._frozen_addresses.copy()
11521152
# note: for coins, use is_frozen_coin instead of _frozen_coins,
@@ -1203,7 +1203,8 @@ def get_onchain_history(
12031203
from_timestamp=None,
12041204
to_timestamp=None,
12051205
from_height=None,
1206-
to_height=None) -> Dict[str, OnchainHistoryItem]:
1206+
to_height=None
1207+
) -> Dict[str, OnchainHistoryItem]:
12071208
# sanity check
12081209
if (from_timestamp is not None or to_timestamp is not None) \
12091210
and (from_height is not None or to_height is not None):
@@ -1420,7 +1421,14 @@ def is_onchain_invoice_paid(self, invoice: BaseInvoice) -> Tuple[bool, Optional[
14201421
return is_paid, conf_needed
14211422

14221423
@profiler
1423-
def get_full_history(self, fx=None, *, onchain_domain=None, include_lightning=True, include_fiat=False) -> dict:
1424+
def get_full_history(
1425+
self,
1426+
fx=None,
1427+
*,
1428+
onchain_domain=None,
1429+
include_lightning=True,
1430+
include_fiat=False
1431+
) -> OrderedDictWithIndex:
14241432
"""
14251433
includes both onchain and lightning
14261434
includes grouping information

0 commit comments

Comments
 (0)