mm-eth 0.2.4__py3-none-any.whl → 0.2.5__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/account.py CHANGED
@@ -39,9 +39,7 @@ def generate_accounts( # nosec
39
39
  for i in range(limit):
40
40
  path = f"{path_prefix}/{i}"
41
41
  acc = Account.from_mnemonic(mnemonic=mnemonic, account_path=path, passphrase=passphrase)
42
- private_key = acc.key.hex().lower()
43
- if not private_key.startswith("0x"):
44
- private_key = f"0x{private_key}"
42
+ private_key = acc.key.to_0x_hex().lower()
45
43
  result.append(NewAccount(path, acc.address, private_key))
46
44
  return result
47
45
 
mm_eth/cli/cli_utils.py CHANGED
@@ -11,7 +11,7 @@ from mm_eth.account import is_private_key
11
11
 
12
12
 
13
13
  def get_version() -> str:
14
- return importlib.metadata.version("mm-eth-cli")
14
+ return importlib.metadata.version("mm-eth")
15
15
 
16
16
 
17
17
  def public_rpc_url(url: str | None) -> str:
@@ -23,6 +23,10 @@ def public_rpc_url(url: str | None) -> str:
23
23
  match url.lower():
24
24
  case "opbnb" | "204":
25
25
  return "https://opbnb-mainnet-rpc.bnbchain.org"
26
+ case "base" | "8453":
27
+ return "https://mainnet.base.org"
28
+ case "base-sepolia" | "84532":
29
+ return "https://sepolia.base.org"
26
30
  case _:
27
31
  return url
28
32
 
mm_eth/erc20.py CHANGED
@@ -1,8 +1,8 @@
1
1
  from __future__ import annotations
2
2
 
3
3
  import string
4
+ from collections.abc import Sequence
4
5
  from dataclasses import dataclass
5
- from typing import TYPE_CHECKING
6
6
 
7
7
  import eth_abi
8
8
  import eth_utils
@@ -11,15 +11,11 @@ from eth_utils import to_checksum_address, to_hex
11
11
  from mm_std import Err, Ok, Result
12
12
 
13
13
  from mm_eth import rpc
14
+ from mm_eth.rpc import Log
14
15
  from mm_eth.tx import SignedTx, sign_legacy_tx, sign_tx
16
+ from mm_eth.types import Nodes, Proxies
15
17
  from mm_eth.utils import hex_str_to_int, hex_to_bytes, log_topic_to_address
16
18
 
17
- if TYPE_CHECKING:
18
- from collections.abc import Sequence
19
-
20
- from mm_eth.rpc import Log
21
- from mm_eth.types import Nodes, Proxies
22
-
23
19
  TRANSFER_METHOD = "0xa9059cbb"
24
20
  TRANSFER_TOPIC = HexStr("0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef")
25
21
 
mm_eth/rpc.py CHANGED
@@ -2,19 +2,16 @@ from __future__ import annotations
2
2
 
3
3
  import json
4
4
  from dataclasses import dataclass
5
- from typing import TYPE_CHECKING, Any, Literal, cast
5
+ from typing import Any, Literal, cast
6
6
 
7
7
  import websocket
8
8
  from mm_std import Err, Ok, Result, hr, random_choice
9
9
  from pydantic import BaseModel
10
+ from web3.types import BlockIdentifier
10
11
 
12
+ from mm_eth.types import Nodes, Proxies
11
13
  from mm_eth.utils import hex_str_to_int, random_node, random_proxy
12
14
 
13
- if TYPE_CHECKING:
14
- from web3.types import BlockIdentifier
15
-
16
- from mm_eth.types import Nodes, Proxies
17
-
18
15
 
19
16
  @dataclass
20
17
  class TxReceipt:
mm_eth/tx.py CHANGED
@@ -3,6 +3,7 @@ from __future__ import annotations
3
3
  from typing import Any
4
4
 
5
5
  import rlp
6
+ from eth_account import Account
6
7
  from eth_utils import keccak, to_hex
7
8
  from pydantic import BaseModel
8
9
  from rlp.sedes import Binary, big_endian_int, binary
@@ -133,8 +134,8 @@ def sign_tx(
133
134
  if to:
134
135
  tx["to"] = Web3.to_checksum_address(to)
135
136
 
136
- signed = w3.eth.account.sign_transaction(tx, private_key)
137
- return SignedTx(tx_hash=signed.hash.hex(), raw_tx=signed.raw_transaction.hex())
137
+ signed = Account.sign_transaction(tx, private_key)
138
+ return SignedTx(tx_hash=signed.hash.to_0x_hex(), raw_tx=signed.raw_transaction.to_0x_hex())
138
139
 
139
140
 
140
141
  def decode_raw_tx(raw_tx: str) -> DecodedRawTx:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mm-eth
3
- Version: 0.2.4
3
+ Version: 0.2.5
4
4
  Requires-Python: >=3.12
5
5
  Requires-Dist: loguru~=0.7.3
6
6
  Requires-Dist: mm-std~=0.1.12
@@ -1,22 +1,22 @@
1
1
  mm_eth/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  mm_eth/abi.py,sha256=Qf-QOsR9QexyQM9XWKNeTMkRarIL3XQJbaDbJ8ifMrw,4856
3
- mm_eth/account.py,sha256=IsajQ7156-CxqRFt2ntv_3nJKwi6tCZz0TmtjUCgmIg,2038
3
+ mm_eth/account.py,sha256=iqAlSpqnSvZvj3cdosmpmheuObHOpedE8wNYWxXdkV4,1954
4
4
  mm_eth/anvil.py,sha256=98RCfI7dEpxFBTV6UErYvubWVP3n0ctUFn1--4kZ84U,1603
5
5
  mm_eth/deploy.py,sha256=SB3ruY808_5UnG8kHR34uVP66P3zOWZu0ImKD7UUv2s,691
6
6
  mm_eth/ens.py,sha256=WMxqC1v3zwDDuLH_oWekm22qrNYxCNcvZumQMT7SYds,623
7
- mm_eth/erc20.py,sha256=m0_yYzPYgOBx0oh4V330XGjRQBjMd5XlWhRL5qChvQE,6866
7
+ mm_eth/erc20.py,sha256=2IV7Ha_jDFTUh_rMncibl4CMdCZhq_rU4LzYOwBpiVQ,6801
8
8
  mm_eth/ethernodes.py,sha256=9y_poTmFUj6cnWaT9mtfc6S9lAfVXTwLGRqxMQ8hT0Y,3080
9
9
  mm_eth/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
- mm_eth/rpc.py,sha256=F0jBzYw4wkh9LKwynXrzyhA08r5JTGrYAbwTH6C2Z7w,13872
10
+ mm_eth/rpc.py,sha256=u84VWM--tLEzfNtfW0jCzDnkd54KDbFmegN1IFwsw0g,13829
11
11
  mm_eth/solc.py,sha256=dYRvT8PjZlLDZhNsc_-0790Eug_ZwU2G-iBfIdGj6wQ,1071
12
- mm_eth/tx.py,sha256=J5Wky8rmV6NlMFmAYF4997PscRYlUdkYFpEldH3BCNg,4014
12
+ mm_eth/tx.py,sha256=efSoMCoWkenbGdHo1_LX66_Edz1HvED5-J_i3wrHwMw,4051
13
13
  mm_eth/types.py,sha256=vXXP5Dc72BpHv5tsyws0KDZebG1W1-5HH0UjL7N2Mgc,113
14
14
  mm_eth/utils.py,sha256=NICgROKU5ZTrkY6nlSDLHjbbpYYswLoofyc3ozPdwBs,7804
15
15
  mm_eth/vault.py,sha256=h8NyiOQh5YFskh1lZA3KyvnJUnxl9769ME2ChplG0CM,1477
16
16
  mm_eth/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
17
  mm_eth/cli/calcs.py,sha256=yDx3VgFmCLRYWpZVqyk_-mXIgTVFDPKGTktx-7H2XDw,4426
18
18
  mm_eth/cli/cli.py,sha256=FfEgosWXa9gIGRuwSbPILvaDQ2Crh9hqTU50CqatvgY,8956
19
- mm_eth/cli/cli_utils.py,sha256=jkw2hDzR2hrYKmY8egR4RicLHe4RFjC7yhShtA0HzhQ,3682
19
+ mm_eth/cli/cli_utils.py,sha256=DMSb6bS0OKVDWyYVB8kdsD5H9KOIyUWdR6KK1f_2e9U,3839
20
20
  mm_eth/cli/print_helpers.py,sha256=yOiOFjTKloumwf07AqNIHQswUo8t0yuT9bpeGBGl60Q,1470
21
21
  mm_eth/cli/rpc_helpers.py,sha256=tAJBUHwpH0jPvg0Hrm-cwpOrpp9GUb91e4ZdwixNUQg,4723
22
22
  mm_eth/cli/validators.py,sha256=CWOXorI2HGajhLvQ354d2cCl5S3JC7tKUxWmmVn6j4Y,2417
@@ -41,7 +41,7 @@ mm_eth/cli/config_examples/balances.yml,sha256=fpXJfoOSqOrkoWpqO7-HrTTb5OBs9PM-P
41
41
  mm_eth/cli/config_examples/call_contract.yml,sha256=E0XuWuBnbhyTYfxNqaoxH6Cy7UCYqMLDwoEu_4OSV3M,233
42
42
  mm_eth/cli/config_examples/transfer_erc20.yml,sha256=mCUpUfqzZjTvst8kqd3EGzJY0S7cr48ySqS6yZhzLdI,1324
43
43
  mm_eth/cli/config_examples/transfer_eth.yml,sha256=i4hh3-LTcpl7JsrSuuM6gDi23B5ZnCeEnaYazQO3bzQ,1181
44
- mm_eth-0.2.4.dist-info/METADATA,sha256=XnqJ7NqhVE7Ck7We-qN96VS8DCLPjMfxlSR3MpvGZMs,228
45
- mm_eth-0.2.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
46
- mm_eth-0.2.4.dist-info/entry_points.txt,sha256=aGhpsozl8NIrkuUcX5fSgURCcDhr3ShUdeTSIrJq4oc,46
47
- mm_eth-0.2.4.dist-info/RECORD,,
44
+ mm_eth-0.2.5.dist-info/METADATA,sha256=Mr7RQIAKsxfuTeNonQ-cNMoQhKebpPp0dkRsPZ54zyE,228
45
+ mm_eth-0.2.5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
46
+ mm_eth-0.2.5.dist-info/entry_points.txt,sha256=aGhpsozl8NIrkuUcX5fSgURCcDhr3ShUdeTSIrJq4oc,46
47
+ mm_eth-0.2.5.dist-info/RECORD,,
File without changes