mm-balance 0.2.0__py3-none-any.whl → 0.2.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/config/example.toml +1 -1
- mm_balance/config.py +17 -25
- {mm_balance-0.2.0.dist-info → mm_balance-0.2.1.dist-info}/METADATA +3 -3
- {mm_balance-0.2.0.dist-info → mm_balance-0.2.1.dist-info}/RECORD +6 -6
- {mm_balance-0.2.0.dist-info → mm_balance-0.2.1.dist-info}/WHEEL +0 -0
- {mm_balance-0.2.0.dist-info → mm_balance-0.2.1.dist-info}/entry_points.txt +0 -0
mm_balance/config/example.toml
CHANGED
mm_balance/config.py
CHANGED
|
@@ -43,14 +43,24 @@ class Group(BaseConfig):
|
|
|
43
43
|
return self
|
|
44
44
|
|
|
45
45
|
def process_addresses(self, address_groups: list[AddressGroup]) -> None:
|
|
46
|
-
|
|
47
|
-
for
|
|
48
|
-
if
|
|
49
|
-
|
|
46
|
+
result = []
|
|
47
|
+
for line in self.addresses:
|
|
48
|
+
if line.startswith("file:"):
|
|
49
|
+
path = Path(line.removeprefix("file:").strip()).expanduser()
|
|
50
|
+
if path.is_file():
|
|
51
|
+
result += path.read_text().strip().splitlines()
|
|
52
|
+
else:
|
|
53
|
+
fatal(f"File with addresses not found: {path}")
|
|
54
|
+
elif line.startswith("group:"):
|
|
55
|
+
group_name = line.removeprefix("group:").strip()
|
|
56
|
+
address_group = next((ag for ag in address_groups if ag.name == group_name), None)
|
|
57
|
+
if address_group is None:
|
|
58
|
+
raise ValueError(f"Address group not found: {group_name}")
|
|
59
|
+
result += address_group.addresses
|
|
50
60
|
else:
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
self.addresses = pydash.uniq(
|
|
61
|
+
result.append(line)
|
|
62
|
+
# TODO: check address is valid. There is network info in the group
|
|
63
|
+
self.addresses = pydash.uniq(result)
|
|
54
64
|
|
|
55
65
|
|
|
56
66
|
class AddressGroup(BaseConfig):
|
|
@@ -103,21 +113,3 @@ class Config(BaseConfig):
|
|
|
103
113
|
def detect_token_address(ticker: str, network: Network) -> str | None:
|
|
104
114
|
if network in TOKEN_ADDRESS:
|
|
105
115
|
return TOKEN_ADDRESS[network].get(ticker)
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
def get_address_group_by_name(address_groups: list[AddressGroup], name: str) -> AddressGroup | None:
|
|
109
|
-
return pydash.find(address_groups, lambda g: g.name == name)
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
def process_file_addresses(addresses: list[str]) -> list[str]:
|
|
113
|
-
result = []
|
|
114
|
-
for address in addresses:
|
|
115
|
-
if address.startswith("file://"):
|
|
116
|
-
path = Path(address.removeprefix("file://"))
|
|
117
|
-
if path.is_file():
|
|
118
|
-
result.extend(path.read_text().strip().splitlines())
|
|
119
|
-
else:
|
|
120
|
-
fatal(f"File with addresses not found: {path}")
|
|
121
|
-
else:
|
|
122
|
-
result.append(address)
|
|
123
|
-
return result
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mm-balance
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.1
|
|
4
4
|
Requires-Python: >=3.12
|
|
5
5
|
Requires-Dist: mm-aptos==0.2.0
|
|
6
6
|
Requires-Dist: mm-btc==0.3.0
|
|
7
|
-
Requires-Dist: mm-eth==0.3.
|
|
8
|
-
Requires-Dist: mm-sol==0.3.
|
|
7
|
+
Requires-Dist: mm-eth==0.3.1
|
|
8
|
+
Requires-Dist: mm-sol==0.3.1
|
|
9
9
|
Requires-Dist: typer>=0.15.1
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
mm_balance/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
2
|
mm_balance/cli.py,sha256=glOveB7bhcmuHBZvKZpmO1iMB1S21E6TnIIwuB25jUo,3398
|
|
3
|
-
mm_balance/config.py,sha256=
|
|
3
|
+
mm_balance/config.py,sha256=4zz1hOdob4bronkzLxR9XRuj614OlWcXd5hjqCaRimc,4260
|
|
4
4
|
mm_balance/constants.py,sha256=kqG2zuwv0l-PzDHIrMJVQpfQWiXjr2DsqGPcKmqNJLo,2334
|
|
5
5
|
mm_balance/price.py,sha256=DzvcQngS6wgi_4YWoXxGvOuOkwJvUbN0KI8DeIxbB5A,1494
|
|
6
6
|
mm_balance/result.py,sha256=WsVLbf54cCJ76rIM2zHaOCQXMfZZMczdg8rlC2tDGWY,4533
|
|
7
7
|
mm_balance/token_decimals.py,sha256=7XL_x_1ZIhp_cr1TvXwnqLqINUWFGo0j5_5lWuxmwpE,2277
|
|
8
8
|
mm_balance/utils.py,sha256=bngYS2WFIakGZO31_ey4MPsllvDhgOxkAnGiXqom3J4,286
|
|
9
9
|
mm_balance/workers.py,sha256=vEmmUI-ioMOv1C_Jcz0rnzI3vn7BaVWFnyXddteJkoA,3766
|
|
10
|
-
mm_balance/config/example.toml,sha256=
|
|
10
|
+
mm_balance/config/example.toml,sha256=vj5-jDB_V3I0-lSuEByI10P_3o0DIhHYH1QzJu8WVrg,1788
|
|
11
11
|
mm_balance/output/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
12
12
|
mm_balance/output/utils.py,sha256=WUFwshFMKZKdcwRtO21nhxqW78JeLAatDyHPZhdV96A,716
|
|
13
13
|
mm_balance/output/formats/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -18,7 +18,7 @@ mm_balance/rpc/aptos.py,sha256=1JCYCqDim4tk1axXscaAJRXPd4J6vV1ABFbwMbPgrL0,641
|
|
|
18
18
|
mm_balance/rpc/btc.py,sha256=iGDoO7HXP6reLI0bWm0UhEl7-UFZTo5xCWNzFngbITw,458
|
|
19
19
|
mm_balance/rpc/evm.py,sha256=ewlMmRrcXKlky3DPNbnUBTVwnvyw7N9iCZLsCX2V14w,1007
|
|
20
20
|
mm_balance/rpc/solana.py,sha256=c756415rlhQkHsVsqxHcA7wIaSM64IqyxMohjz8IGhY,1031
|
|
21
|
-
mm_balance-0.2.
|
|
22
|
-
mm_balance-0.2.
|
|
23
|
-
mm_balance-0.2.
|
|
24
|
-
mm_balance-0.2.
|
|
21
|
+
mm_balance-0.2.1.dist-info/METADATA,sha256=r7KoFJHCD1PNDFC5pmrU7SsdA9YU1uf5Dr7ohPezchs,225
|
|
22
|
+
mm_balance-0.2.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
23
|
+
mm_balance-0.2.1.dist-info/entry_points.txt,sha256=rSnP0ZW1a3ACNwTWM7T53CmOycKbzhG43m2_wseENng,50
|
|
24
|
+
mm_balance-0.2.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|