mm-eth 0.7.1__py3-none-any.whl → 0.7.3__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_eth/abi.py +1 -2
- mm_eth/cli/cli_utils.py +1 -1
- mm_eth/cli/cmd/balances_cmd.py +2 -2
- mm_eth/cli/cmd/solc_cmd.py +1 -1
- mm_eth/cli/cmd/transfer_cmd.py +6 -4
- mm_eth/cli/cmd/wallet/private_key_cmd.py +1 -1
- mm_eth/rpc.py +1 -1
- mm_eth-0.7.3.dist-info/METADATA +7 -0
- {mm_eth-0.7.1.dist-info → mm_eth-0.7.3.dist-info}/RECORD +11 -11
- mm_eth-0.7.1.dist-info/METADATA +0 -7
- {mm_eth-0.7.1.dist-info → mm_eth-0.7.3.dist-info}/WHEEL +0 -0
- {mm_eth-0.7.1.dist-info → mm_eth-0.7.3.dist-info}/entry_points.txt +0 -0
mm_eth/abi.py
CHANGED
|
@@ -5,7 +5,6 @@ from typing import Any, cast
|
|
|
5
5
|
|
|
6
6
|
import eth_abi
|
|
7
7
|
import eth_utils
|
|
8
|
-
import pydash
|
|
9
8
|
from eth_typing import ABI, ABIFunction, HexStr
|
|
10
9
|
from pydantic import BaseModel
|
|
11
10
|
from web3 import Web3
|
|
@@ -62,7 +61,7 @@ def decode_function_input(contract_abi: ABI, tx_input: str) -> FunctionInput:
|
|
|
62
61
|
|
|
63
62
|
|
|
64
63
|
def get_function_abi(contr_abi: ABI, fn_name: str) -> ABIFunction:
|
|
65
|
-
abi =
|
|
64
|
+
abi = next((x for x in contr_abi if x.get("name", None) == fn_name and x.get("type", None) == "function"), None)
|
|
66
65
|
if not abi:
|
|
67
66
|
raise ValueError("can't find abi for function: " + fn_name)
|
|
68
67
|
return cast(ABIFunction, abi)
|
mm_eth/cli/cli_utils.py
CHANGED
|
@@ -46,7 +46,7 @@ async def check_nodes_for_chain_id(nodes: list[str], chain_id: int) -> None:
|
|
|
46
46
|
for node in nodes:
|
|
47
47
|
res = (await rpc.eth_chain_id(node)).unwrap("can't get chain_id")
|
|
48
48
|
if res != chain_id:
|
|
49
|
-
mm_print.
|
|
49
|
+
mm_print.exit_with_error(f"node {node} has a wrong chain_id: {res}")
|
|
50
50
|
|
|
51
51
|
|
|
52
52
|
def add_table_raw(table: Table, *row: object) -> None:
|
mm_eth/cli/cmd/balances_cmd.py
CHANGED
|
@@ -105,12 +105,12 @@ async def _get_tokens_info(config: Config) -> list[Token]:
|
|
|
105
105
|
for address in config.tokens:
|
|
106
106
|
decimals_res = await retry.erc20_decimals(5, config.nodes, None, token=address)
|
|
107
107
|
if decimals_res.is_err():
|
|
108
|
-
mm_print.
|
|
108
|
+
mm_print.exit_with_error(f"can't get token {address} decimals: {decimals_res.unwrap_err()}")
|
|
109
109
|
decimal = decimals_res.unwrap()
|
|
110
110
|
|
|
111
111
|
symbols_res = await retry.erc20_symbol(5, config.nodes, None, token=address)
|
|
112
112
|
if symbols_res.is_err():
|
|
113
|
-
mm_print.
|
|
113
|
+
mm_print.exit_with_error(f"can't get token {address} symbol: {symbols_res.unwrap_err()}")
|
|
114
114
|
symbol = symbols_res.unwrap()
|
|
115
115
|
|
|
116
116
|
result.append(Token(address=address, decimals=decimal, symbol=symbol))
|
mm_eth/cli/cmd/solc_cmd.py
CHANGED
|
@@ -11,7 +11,7 @@ def run(contract_path: Path, tmp_dir: Path, print_format: PrintFormat) -> None:
|
|
|
11
11
|
contract_name = contract_path.stem
|
|
12
12
|
res = solc(contract_name, contract_path, tmp_dir)
|
|
13
13
|
if res.is_err():
|
|
14
|
-
mm_print.
|
|
14
|
+
mm_print.exit_with_error(res.unwrap_err())
|
|
15
15
|
|
|
16
16
|
bin_ = res.unwrap().bin
|
|
17
17
|
abi = res.unwrap().abi
|
mm_eth/cli/cmd/transfer_cmd.py
CHANGED
|
@@ -43,8 +43,8 @@ class Config(Web3CliConfig):
|
|
|
43
43
|
def from_addresses(self) -> list[str]:
|
|
44
44
|
return [r.from_address for r in self.transfers]
|
|
45
45
|
|
|
46
|
-
@model_validator(mode="after")
|
|
47
|
-
|
|
46
|
+
@model_validator(mode="after")
|
|
47
|
+
def final_validator(self) -> Self:
|
|
48
48
|
if not self.private_keys.contains_all_addresses(self.from_addresses):
|
|
49
49
|
raise ValueError("private keys are not set for all addresses")
|
|
50
50
|
|
|
@@ -66,13 +66,14 @@ class Config(Web3CliConfig):
|
|
|
66
66
|
if self.value_min_limit:
|
|
67
67
|
Validators.valid_eth_expression()(self.value_min_limit)
|
|
68
68
|
|
|
69
|
+
return self
|
|
70
|
+
|
|
71
|
+
async def async_init(self) -> None:
|
|
69
72
|
if self.token:
|
|
70
73
|
self.token_decimals = (await retry.erc20_decimals(5, self.nodes, self.proxies, token=self.token)).unwrap(
|
|
71
74
|
"can't get token decimals"
|
|
72
75
|
)
|
|
73
76
|
|
|
74
|
-
return self
|
|
75
|
-
|
|
76
77
|
|
|
77
78
|
class TransferCmdParams(BaseConfigParams):
|
|
78
79
|
print_balances: bool
|
|
@@ -84,6 +85,7 @@ class TransferCmdParams(BaseConfigParams):
|
|
|
84
85
|
|
|
85
86
|
async def run(params: TransferCmdParams) -> None:
|
|
86
87
|
config = await Config.read_toml_config_or_exit_async(params.config_path)
|
|
88
|
+
await config.async_init()
|
|
87
89
|
if params.print_config:
|
|
88
90
|
config.print_and_exit(exclude={"private_keys"})
|
|
89
91
|
|
mm_eth/rpc.py
CHANGED
|
@@ -35,7 +35,7 @@ async def _http_call(node: str, data: dict[str, object], timeout: float, proxy:
|
|
|
35
35
|
if res.is_err():
|
|
36
36
|
return res.to_result_err()
|
|
37
37
|
try:
|
|
38
|
-
parsed_body = res.
|
|
38
|
+
parsed_body = res.parse_json()
|
|
39
39
|
err = parsed_body.get("error", {}).get("message", "")
|
|
40
40
|
if err:
|
|
41
41
|
return res.to_result_err(f"service_error: {err}")
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
mm_eth/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
mm_eth/abi.py,sha256=
|
|
2
|
+
mm_eth/abi.py,sha256=ekyp47yJFCB7FByZ1cTG3DiEI8IT3nCjfXdV1ZAtQ0w,4753
|
|
3
3
|
mm_eth/account.py,sha256=WUaQq8AtHIL39hJN4-UkhDu7UM20j1xlMplCTKQzr1o,3041
|
|
4
4
|
mm_eth/anvil.py,sha256=f7zd5zZqcOTd1Sy4GdHAGTOjsQZzLI3E0ttT017KYLQ,1792
|
|
5
5
|
mm_eth/converters.py,sha256=smL3Bsky1pYEre2kPhsb4arXoQC_u80P5ilU9NRvr44,2043
|
|
@@ -7,27 +7,27 @@ mm_eth/deploy.py,sha256=SB3ruY808_5UnG8kHR34uVP66P3zOWZu0ImKD7UUv2s,691
|
|
|
7
7
|
mm_eth/erc20.py,sha256=Pxs_w95flqEUF4pJMoaHTfvud8x5Fb2UwU7iwMjdGCw,1143
|
|
8
8
|
mm_eth/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
9
|
mm_eth/retry.py,sha256=saRYV07Ca1laqT1nQP3_UmKvYXNWMURh8gyN2r1WrIs,5123
|
|
10
|
-
mm_eth/rpc.py,sha256=
|
|
10
|
+
mm_eth/rpc.py,sha256=HAdud9UcHHc7fEebLiaNqORRyDe6O8RPYt8SAZ14WJU,9912
|
|
11
11
|
mm_eth/solc.py,sha256=s_iaaslncVzzQsgUgcc04x8ZeCjCf9T9JdW1_yzUDxI,1353
|
|
12
12
|
mm_eth/tx.py,sha256=MSJf6zGRYlwCbJIXXLL2NONVpvF1_clWd_5CV5j4pTE,4095
|
|
13
13
|
mm_eth/utils.py,sha256=TLyapZZ1lp_kW3vdkHmgR8gUtIQ1aEy_0GScxB6v5IQ,659
|
|
14
14
|
mm_eth/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
15
15
|
mm_eth/cli/calcs.py,sha256=FwnYwRKDnBdXTYrjdWqilPd36W969ovziO8qkQoHOsw,477
|
|
16
16
|
mm_eth/cli/cli.py,sha256=aElAbK1FiABwMPTU-vysyFIyg6OkBtiir6Zj4LuNmx8,5600
|
|
17
|
-
mm_eth/cli/cli_utils.py,sha256=
|
|
17
|
+
mm_eth/cli/cli_utils.py,sha256=07dEJHGlZnx8nO2zxFuImjqtJrYXKDzLR9AsQNH6Y0s,1546
|
|
18
18
|
mm_eth/cli/rpc_helpers.py,sha256=nmr4CXVMGblGJxllaLd95gTV_VhauRhWUKmQZk5-Vmg,1643
|
|
19
19
|
mm_eth/cli/validators.py,sha256=0T5tQdqEd4fNaamVK8TifUBTCzqLkNdzTA4rZD98_H8,1649
|
|
20
20
|
mm_eth/cli/cmd/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
21
21
|
mm_eth/cli/cmd/balance_cmd.py,sha256=Qtn_4h_MDYh38HizkOx6auAv0_41GyCH3bWDmLXHfjQ,1963
|
|
22
|
-
mm_eth/cli/cmd/balances_cmd.py,sha256=
|
|
22
|
+
mm_eth/cli/cmd/balances_cmd.py,sha256=706WdAkB8EW_I54nUe4b_Yfw5cS_TJBsemz4hA1t5aI,4276
|
|
23
23
|
mm_eth/cli/cmd/deploy_cmd.py,sha256=ge-r_GbGc9r2osz-g7zOmqXkbMsFnjeyNPSoq72Ntpg,1479
|
|
24
24
|
mm_eth/cli/cmd/node_cmd.py,sha256=-BBKj9l-ZiPr6NZ12WQvuxQcXvyDBvcbReMMevN3fME,2574
|
|
25
|
-
mm_eth/cli/cmd/solc_cmd.py,sha256=
|
|
26
|
-
mm_eth/cli/cmd/transfer_cmd.py,sha256=
|
|
25
|
+
mm_eth/cli/cmd/solc_cmd.py,sha256=VyP_oaHuYOulcpWQLUgRRVYrZDH7FazzLdgbwrs32Jg,658
|
|
26
|
+
mm_eth/cli/cmd/transfer_cmd.py,sha256=mET3vCAvQ_-0uK_Ut2bZoQY4iYWhFh5muEsNlTHSkGE,17021
|
|
27
27
|
mm_eth/cli/cmd/wallet/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
28
28
|
mm_eth/cli/cmd/wallet/mnemonic_cmd.py,sha256=RQbNY3C4-5NvcPXorhO7YIYG8dU0u5gN5sEANmFE1iY,996
|
|
29
|
-
mm_eth/cli/cmd/wallet/private_key_cmd.py,sha256=
|
|
30
|
-
mm_eth-0.7.
|
|
31
|
-
mm_eth-0.7.
|
|
32
|
-
mm_eth-0.7.
|
|
33
|
-
mm_eth-0.7.
|
|
29
|
+
mm_eth/cli/cmd/wallet/private_key_cmd.py,sha256=UUwVLSryJJBdg1jFANOoRKZbaWesYKKhmqpmMsbm6-0,272
|
|
30
|
+
mm_eth-0.7.3.dist-info/METADATA,sha256=rCYzaLj-FVY2cx7eDaICwOGKj-wGj61xsQnJOlX2Sqo,161
|
|
31
|
+
mm_eth-0.7.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
32
|
+
mm_eth-0.7.3.dist-info/entry_points.txt,sha256=aGhpsozl8NIrkuUcX5fSgURCcDhr3ShUdeTSIrJq4oc,46
|
|
33
|
+
mm_eth-0.7.3.dist-info/RECORD,,
|
mm_eth-0.7.1.dist-info/METADATA
DELETED
|
File without changes
|
|
File without changes
|