mm-balance 0.3.0__py3-none-any.whl → 0.3.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
mm_balance/cli.py CHANGED
@@ -49,10 +49,8 @@ def cli(
49
49
  debug: Annotated[bool | None, typer.Option("--debug", "-d", help="Print debug info.")] = None,
50
50
  print_config: Annotated[bool | None, typer.Option("--config", "-c", help="Print config and exit.")] = None,
51
51
  price: Annotated[bool | None, typer.Option("--price/--no-price", help="Print prices.")] = None,
52
- save_balances_file: Annotated[Path | None, typer.Option("--save-balances-file", help="Save balances file.")] = None,
53
- diff_from_balances_file: Annotated[
54
- Path | None, typer.Option("--diff-from-balances-file", help="Diff from balances file.")
55
- ] = None,
52
+ save_balances: Annotated[Path | None, typer.Option("--save-balances", help="Save balances file.")] = None,
53
+ diff_from_balances: Annotated[Path | None, typer.Option("--diff-from-balances", help="Diff from balances file.")] = None,
56
54
  _example: Annotated[bool | None, typer.Option("--example", callback=example_callback, help="Print a config example.")] = None,
57
55
  _networks: Annotated[
58
56
  bool | None, typer.Option("--networks", callback=networks_callback, help="Print supported networks.")
@@ -98,11 +96,11 @@ def cli(
98
96
  else:
99
97
  fatal("Unsupported print format")
100
98
 
101
- if save_balances_file:
102
- BalancesDict.from_balances_result(result).save_to_path(save_balances_file)
99
+ if save_balances:
100
+ BalancesDict.from_balances_result(result).save_to_path(save_balances)
103
101
 
104
- if diff_from_balances_file:
105
- old_balances = BalancesDict.from_file(diff_from_balances_file)
102
+ if diff_from_balances:
103
+ old_balances = BalancesDict.from_file(diff_from_balances)
106
104
  new_balances = BalancesDict.from_balances_result(result)
107
105
  diff = Diff.calc(old_balances, new_balances)
108
106
  diff.print(config.settings.print_format)
mm_balance/config.py CHANGED
@@ -60,6 +60,8 @@ class Group(BaseConfig):
60
60
  else:
61
61
  result.append(line)
62
62
  # TODO: check address is valid. There is network info in the group
63
+ if self.network.need_lowercase_address():
64
+ result = [address.lower() for address in result]
63
65
  self.addresses = pydash.uniq(result)
64
66
 
65
67
 
mm_balance/constants.py CHANGED
@@ -12,13 +12,19 @@ class Network(str):
12
12
  __slots__ = ()
13
13
 
14
14
  def is_evm_network(self) -> bool:
15
- return self in [NETWORK_ETHEREUM, NETWORK_ARBITRUM_ONE, NETWORK_OP_MAINNET] or self.startswith("evm-")
15
+ return self in EVM_NETWORKS or self.startswith("evm-")
16
+
17
+ def need_lowercase_address(self) -> bool:
18
+ return self.is_evm_network()
16
19
 
17
20
  @classmethod
18
21
  def __get_pydantic_core_schema__(cls, _source_type: object, handler: GetCoreSchemaHandler) -> CoreSchema:
19
22
  return core_schema.no_info_after_validator_function(cls, handler(str))
20
23
 
21
24
 
25
+ # evm networks
26
+
27
+ # other networks
22
28
  NETWORK_APTOS = Network("aptos")
23
29
  NETWORK_ARBITRUM_ONE = Network("arbitrum-one")
24
30
  NETWORK_BITCOIN = Network("bitcoin")
@@ -26,6 +32,7 @@ NETWORK_ETHEREUM = Network("ethereum")
26
32
  NETWORK_SOLANA = Network("solana")
27
33
  NETWORK_OP_MAINNET = Network("op-mainnet")
28
34
  NETWORKS = [NETWORK_APTOS, NETWORK_ARBITRUM_ONE, NETWORK_BITCOIN, NETWORK_ETHEREUM, NETWORK_SOLANA, NETWORK_OP_MAINNET]
35
+ EVM_NETWORKS = [NETWORK_ETHEREUM, NETWORK_ARBITRUM_ONE, NETWORK_OP_MAINNET]
29
36
 
30
37
 
31
38
  TOKEN_ADDRESS: dict[Network, dict[str, str]] = {
@@ -1,10 +1,10 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mm-balance
3
- Version: 0.3.0
3
+ Version: 0.3.1
4
4
  Requires-Python: >=3.12
5
5
  Requires-Dist: deepdiff==8.2.0
6
6
  Requires-Dist: mm-aptos==0.2.0
7
7
  Requires-Dist: mm-btc==0.3.0
8
- Requires-Dist: mm-eth==0.5.3
9
- Requires-Dist: mm-sol==0.5.1
8
+ Requires-Dist: mm-eth==0.5.4
9
+ Requires-Dist: mm-sol==0.5.2
10
10
  Requires-Dist: typer==0.15.1
@@ -1,7 +1,7 @@
1
1
  mm_balance/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- mm_balance/cli.py,sha256=nRDVejN-dnr1iRezBxNk4z0oLa59tiwzIVhgeOGzvbo,4498
3
- mm_balance/config.py,sha256=gywHNWEQL1xeG778cuca5aBoXElLIfoGle3xxW6m_0U,4564
4
- mm_balance/constants.py,sha256=kqG2zuwv0l-PzDHIrMJVQpfQWiXjr2DsqGPcKmqNJLo,2334
2
+ mm_balance/cli.py,sha256=ROfCm1h0KUm2Uh0a74wNCPIGMgQAOAZKIYBBFl7gcKc,4444
3
+ mm_balance/config.py,sha256=DsADA8jxCZSOT4-acQorKYdn0QbN10B-5GUGEiW9mfk,4675
4
+ mm_balance/constants.py,sha256=2rINgkMYX4SDju21Ep5Djp5WirvvjYbasQgSvtdb3yM,2479
5
5
  mm_balance/diff.py,sha256=GPRbykty2TIBBM8jpYXOV9Itjyd_mz0BTUsQ8KX7cNo,7099
6
6
  mm_balance/price.py,sha256=DzvcQngS6wgi_4YWoXxGvOuOkwJvUbN0KI8DeIxbB5A,1494
7
7
  mm_balance/result.py,sha256=-Ebq07JMLcQAmRs82cA6aYMbsT1qbZSyAOixr9K_wbg,5157
@@ -19,7 +19,7 @@ mm_balance/rpc/aptos.py,sha256=1JCYCqDim4tk1axXscaAJRXPd4J6vV1ABFbwMbPgrL0,641
19
19
  mm_balance/rpc/btc.py,sha256=wBMxUjbqdQipVsTFVkj4tk7loErA2czLVfvG8vjFLeE,493
20
20
  mm_balance/rpc/evm.py,sha256=LaU2csGL-VlQauCiTX_WFnstvTyZLMP5gDw2LyV53m8,1048
21
21
  mm_balance/rpc/solana.py,sha256=10rJ4eEr9sfEfhXx-X2R7bdJ5dL7bVMwHHfJ4R3QR7U,1071
22
- mm_balance-0.3.0.dist-info/METADATA,sha256=Owy1HtXoCk7RhiqeEwijv80KKLuDBHbgQdHOrjAxvEs,256
23
- mm_balance-0.3.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
24
- mm_balance-0.3.0.dist-info/entry_points.txt,sha256=rSnP0ZW1a3ACNwTWM7T53CmOycKbzhG43m2_wseENng,50
25
- mm_balance-0.3.0.dist-info/RECORD,,
22
+ mm_balance-0.3.1.dist-info/METADATA,sha256=3itefi1OrREJ0RuW8V_ziuWz5ehJHTMQYU-qwS4cXAE,256
23
+ mm_balance-0.3.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
24
+ mm_balance-0.3.1.dist-info/entry_points.txt,sha256=rSnP0ZW1a3ACNwTWM7T53CmOycKbzhG43m2_wseENng,50
25
+ mm_balance-0.3.1.dist-info/RECORD,,