mm-sol 0.2.9__tar.gz → 0.3.0__tar.gz

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.
Files changed (54) hide show
  1. {mm_sol-0.2.9 → mm_sol-0.3.0}/PKG-INFO +2 -2
  2. {mm_sol-0.2.9 → mm_sol-0.3.0}/pyproject.toml +2 -2
  3. {mm_sol-0.2.9 → mm_sol-0.3.0}/src/mm_sol/cli/cli.py +4 -3
  4. {mm_sol-0.2.9 → mm_sol-0.3.0}/src/mm_sol/cli/cmd/balances_cmd.py +3 -2
  5. {mm_sol-0.2.9 → mm_sol-0.3.0}/src/mm_sol/cli/cmd/example_cmd.py +1 -1
  6. {mm_sol-0.2.9 → mm_sol-0.3.0}/src/mm_sol/cli/cmd/transfer_sol_cmd.py +11 -4
  7. {mm_sol-0.2.9 → mm_sol-0.3.0}/src/mm_sol/cli/cmd/transfer_token_cmd.py +11 -4
  8. mm_sol-0.3.0/src/mm_sol/cli/examples/balances.toml +9 -0
  9. mm_sol-0.3.0/src/mm_sol/cli/examples/transfer-sol.toml +8 -0
  10. mm_sol-0.3.0/src/mm_sol/cli/examples/transfer-token.toml +9 -0
  11. {mm_sol-0.2.9 → mm_sol-0.3.0}/uv.lock +6 -6
  12. mm_sol-0.2.9/src/mm_sol/cli/examples/balances.yml +0 -11
  13. mm_sol-0.2.9/src/mm_sol/cli/examples/transfer-sol.yml +0 -9
  14. mm_sol-0.2.9/src/mm_sol/cli/examples/transfer-token.yml +0 -11
  15. {mm_sol-0.2.9 → mm_sol-0.3.0}/.env.example +0 -0
  16. {mm_sol-0.2.9 → mm_sol-0.3.0}/.gitignore +0 -0
  17. {mm_sol-0.2.9 → mm_sol-0.3.0}/README.txt +0 -0
  18. {mm_sol-0.2.9 → mm_sol-0.3.0}/dict.dic +0 -0
  19. {mm_sol-0.2.9 → mm_sol-0.3.0}/justfile +0 -0
  20. {mm_sol-0.2.9 → mm_sol-0.3.0}/src/mm_sol/__init__.py +0 -0
  21. {mm_sol-0.2.9 → mm_sol-0.3.0}/src/mm_sol/account.py +0 -0
  22. {mm_sol-0.2.9 → mm_sol-0.3.0}/src/mm_sol/balance.py +0 -0
  23. {mm_sol-0.2.9 → mm_sol-0.3.0}/src/mm_sol/block.py +0 -0
  24. {mm_sol-0.2.9 → mm_sol-0.3.0}/src/mm_sol/cli/__init__.py +0 -0
  25. {mm_sol-0.2.9 → mm_sol-0.3.0}/src/mm_sol/cli/calcs.py +0 -0
  26. {mm_sol-0.2.9 → mm_sol-0.3.0}/src/mm_sol/cli/cli_utils.py +0 -0
  27. {mm_sol-0.2.9 → mm_sol-0.3.0}/src/mm_sol/cli/cmd/__init__.py +0 -0
  28. {mm_sol-0.2.9 → mm_sol-0.3.0}/src/mm_sol/cli/cmd/balance_cmd.py +0 -0
  29. {mm_sol-0.2.9 → mm_sol-0.3.0}/src/mm_sol/cli/cmd/node_cmd.py +0 -0
  30. {mm_sol-0.2.9 → mm_sol-0.3.0}/src/mm_sol/cli/cmd/wallet/__init__.py +0 -0
  31. {mm_sol-0.2.9 → mm_sol-0.3.0}/src/mm_sol/cli/cmd/wallet/keypair_cmd.py +0 -0
  32. {mm_sol-0.2.9 → mm_sol-0.3.0}/src/mm_sol/cli/cmd/wallet/new_cmd.py +0 -0
  33. {mm_sol-0.2.9 → mm_sol-0.3.0}/src/mm_sol/cli/validators.py +0 -0
  34. {mm_sol-0.2.9 → mm_sol-0.3.0}/src/mm_sol/constants.py +0 -0
  35. {mm_sol-0.2.9 → mm_sol-0.3.0}/src/mm_sol/converters.py +0 -0
  36. {mm_sol-0.2.9 → mm_sol-0.3.0}/src/mm_sol/py.typed +0 -0
  37. {mm_sol-0.2.9 → mm_sol-0.3.0}/src/mm_sol/rpc.py +0 -0
  38. {mm_sol-0.2.9 → mm_sol-0.3.0}/src/mm_sol/solana_cli.py +0 -0
  39. {mm_sol-0.2.9 → mm_sol-0.3.0}/src/mm_sol/token.py +0 -0
  40. {mm_sol-0.2.9 → mm_sol-0.3.0}/src/mm_sol/transfer.py +0 -0
  41. {mm_sol-0.2.9 → mm_sol-0.3.0}/src/mm_sol/utils.py +0 -0
  42. {mm_sol-0.2.9 → mm_sol-0.3.0}/tests/__init__.py +0 -0
  43. {mm_sol-0.2.9 → mm_sol-0.3.0}/tests/cli/__init__.py +0 -0
  44. {mm_sol-0.2.9 → mm_sol-0.3.0}/tests/cli/cmd/__init__.py +0 -0
  45. {mm_sol-0.2.9 → mm_sol-0.3.0}/tests/cli/cmd/wallet/__init__.py +0 -0
  46. {mm_sol-0.2.9 → mm_sol-0.3.0}/tests/cli/cmd/wallet/test_keypair_cmd.py +0 -0
  47. {mm_sol-0.2.9 → mm_sol-0.3.0}/tests/cli/cmd/wallet/test_new_cmd.py +0 -0
  48. {mm_sol-0.2.9 → mm_sol-0.3.0}/tests/conftest.py +0 -0
  49. {mm_sol-0.2.9 → mm_sol-0.3.0}/tests/test_account.py +0 -0
  50. {mm_sol-0.2.9 → mm_sol-0.3.0}/tests/test_balance.py +0 -0
  51. {mm_sol-0.2.9 → mm_sol-0.3.0}/tests/test_client.py +0 -0
  52. {mm_sol-0.2.9 → mm_sol-0.3.0}/tests/test_converters.py +0 -0
  53. {mm_sol-0.2.9 → mm_sol-0.3.0}/tests/test_rpc.py +0 -0
  54. {mm_sol-0.2.9 → mm_sol-0.3.0}/tests/test_token.py +0 -0
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mm-sol
3
- Version: 0.2.9
3
+ Version: 0.3.0
4
4
  Requires-Python: >=3.12
5
5
  Requires-Dist: base58~=2.1.1
6
6
  Requires-Dist: jinja2>=3.1.5
7
- Requires-Dist: mm-crypto-utils>=0.0.19
7
+ Requires-Dist: mm-crypto-utils~=0.1.1
8
8
  Requires-Dist: solana~=0.36.3
9
9
  Requires-Dist: typer>=0.15.1
@@ -1,10 +1,10 @@
1
1
  [project]
2
2
  name = "mm-sol"
3
- version = "0.2.9"
3
+ version = "0.3.0"
4
4
  description = ""
5
5
  requires-python = ">=3.12"
6
6
  dependencies = [
7
- "mm-crypto-utils>=0.0.19",
7
+ "mm-crypto-utils~=0.1.1",
8
8
  "solana~=0.36.3",
9
9
  "base58~=2.1.1",
10
10
  "typer>=0.15.1",
@@ -1,4 +1,5 @@
1
1
  from enum import Enum
2
+ from pathlib import Path
2
3
  from typing import Annotated
3
4
 
4
5
  import typer
@@ -50,14 +51,14 @@ def balance_command(
50
51
 
51
52
  @app.command(name="balances", help="Print SOL and token balances for accounts")
52
53
  def balances_command(
53
- config_path: str, print_config: Annotated[bool, typer.Option("--config", "-c", help="Print config and exit")] = False
54
+ config_path: Path, print_config: Annotated[bool, typer.Option("--config", "-c", help="Print config and exit")] = False
54
55
  ) -> None:
55
56
  balances_cmd.run(config_path, print_config)
56
57
 
57
58
 
58
59
  @app.command(name="transfer-sol", help="Transfer SOL from one or many accounts")
59
60
  def transfer_sol_command(
60
- config_path: str,
61
+ config_path: Path,
61
62
  print_balances: bool = typer.Option(False, "--balances", "-b", help="Print balances and exit"),
62
63
  print_config: bool = typer.Option(False, "--config", "-c", help="Print config and exit"),
63
64
  emulate: bool = typer.Option(False, "--emulate", "-e", help="Emulate transaction posting"),
@@ -76,7 +77,7 @@ def transfer_sol_command(
76
77
 
77
78
  @app.command(name="transfer-token", help="Transfer token from one or many accounts")
78
79
  def transfer_token_command(
79
- config_path: str,
80
+ config_path: Path,
80
81
  print_balances: bool = typer.Option(False, "--balances", "-b", help="Print balances and exit"),
81
82
  print_config: bool = typer.Option(False, "--config", "-c", help="Print config and exit"),
82
83
  emulate: bool = typer.Option(False, "--emulate", "-e", help="Emulate transaction posting"),
@@ -1,5 +1,6 @@
1
1
  import random
2
2
  from decimal import Decimal
3
+ from pathlib import Path
3
4
  from typing import Annotated, Any
4
5
 
5
6
  from mm_crypto_utils import ConfigValidators
@@ -23,8 +24,8 @@ class Config(BaseConfig):
23
24
  return random.choice(self.nodes)
24
25
 
25
26
 
26
- def run(config_path: str, print_config: bool) -> None:
27
- config = Config.read_config_or_exit(config_path)
27
+ def run(config_path: Path, print_config: bool) -> None:
28
+ config = Config.read_toml_config_or_exit(config_path)
28
29
  if print_config:
29
30
  config.print_and_exit()
30
31
 
@@ -4,5 +4,5 @@ from mm_std import print_plain
4
4
 
5
5
 
6
6
  def run(module: str) -> None:
7
- example_file = Path(Path(__file__).parent.absolute(), "../examples", f"{module}.yml")
7
+ example_file = Path(Path(__file__).parent.absolute(), "../examples", f"{module}.toml")
8
8
  print_plain(example_file.read_text())
@@ -1,13 +1,13 @@
1
1
  import sys
2
2
  import time
3
3
  from pathlib import Path
4
- from typing import Annotated
4
+ from typing import Annotated, Self
5
5
 
6
6
  import mm_crypto_utils
7
7
  from loguru import logger
8
8
  from mm_crypto_utils import AddressToPrivate, TxRoute
9
9
  from mm_std import BaseConfig, Err, utc_now
10
- from pydantic import AfterValidator, BeforeValidator
10
+ from pydantic import AfterValidator, BeforeValidator, model_validator
11
11
 
12
12
  from mm_sol import transfer
13
13
  from mm_sol.cli import calcs, cli_utils
@@ -33,9 +33,16 @@ class Config(BaseConfig):
33
33
  def from_addresses(self) -> list[str]:
34
34
  return [r.from_address for r in self.routes]
35
35
 
36
+ @model_validator(mode="after")
37
+ def final_validator(self) -> Self:
38
+ if not self.private_keys.contains_all_addresses(self.from_addresses):
39
+ raise ValueError("private keys are not set for all addresses")
40
+
41
+ return self
42
+
36
43
 
37
44
  def run(
38
- config_path: str,
45
+ config_path: Path,
39
46
  *,
40
47
  print_balances: bool,
41
48
  print_config: bool,
@@ -43,7 +50,7 @@ def run(
43
50
  no_confirmation: bool,
44
51
  emulate: bool,
45
52
  ) -> None:
46
- config = Config.read_config_or_exit(config_path)
53
+ config = Config.read_toml_config_or_exit(config_path)
47
54
 
48
55
  if print_config:
49
56
  config.print_and_exit({"private_keys"})
@@ -1,14 +1,14 @@
1
1
  import sys
2
2
  import time
3
3
  from pathlib import Path
4
- from typing import Annotated
4
+ from typing import Annotated, Self
5
5
 
6
6
  import mm_crypto_utils
7
7
  import typer
8
8
  from loguru import logger
9
9
  from mm_crypto_utils import AddressToPrivate, TxRoute
10
10
  from mm_std import BaseConfig, Err, fatal, utc_now
11
- from pydantic import AfterValidator, BeforeValidator
11
+ from pydantic import AfterValidator, BeforeValidator, model_validator
12
12
 
13
13
  from mm_sol import transfer
14
14
  from mm_sol.cli import calcs, cli_utils
@@ -35,9 +35,16 @@ class Config(BaseConfig):
35
35
  def from_addresses(self) -> list[str]:
36
36
  return [r.from_address for r in self.routes]
37
37
 
38
+ @model_validator(mode="after")
39
+ def final_validator(self) -> Self:
40
+ if not self.private_keys.contains_all_addresses(self.from_addresses):
41
+ raise ValueError("private keys are not set for all addresses")
42
+
43
+ return self
44
+
38
45
 
39
46
  def run(
40
- config_path: str,
47
+ config_path: Path,
41
48
  *,
42
49
  print_balances: bool,
43
50
  print_config: bool,
@@ -45,7 +52,7 @@ def run(
45
52
  no_confirmation: bool,
46
53
  emulate: bool,
47
54
  ) -> None:
48
- config = Config.read_config_or_exit(config_path)
55
+ config = Config.read_toml_config_or_exit(config_path)
49
56
 
50
57
  if print_config:
51
58
  config.print_and_exit({"private_keys"})
@@ -0,0 +1,9 @@
1
+ accounts = """
2
+ 5BJ9ViMj4gi2BBX3wbCEJ4p4vpVWKpG6ja2aQP2ACBUv
3
+ HbSAUDjzpr44fWzf9Ynj3V1jq3wBsgg88N88P4vzeGPX
4
+ """
5
+ tokens = """
6
+ 7XtmNSHJDHTZdx2K1S8D529kHsBbt3Civxt6vUHrGxBR
7
+ 65FKbLPtrssmc8aVn9DEBY8VTGB85vsgadrmaW9H4nEB
8
+ """
9
+ nodes = "https://api.mainnet-beta.solana.com"
@@ -0,0 +1,8 @@
1
+ routes = """
2
+ Bd8CxCTLez2ckVTqEJjuZkWjYFSRbo8fA1qYbd7yFVP9 Eaft9xXzfgbRqsHd65WspoaxTtH7pkznM9YA8tsDKGwj
3
+ Fc2TRJVCpFZpRz56mFnQETctib1zwFnwHcS7HoQSgUzZ EVJctTWikt29rUXBf49tyQdK87x837HtvpCwqeSjp1Ur
4
+ """
5
+ private_keys = "file: ./path/to/privates.txt"
6
+ value = "0.012 sol"
7
+ proxies = "url: https://site.com/api/get-proxies"
8
+ nodes = "https://api.devnet.solana.com"
@@ -0,0 +1,9 @@
1
+ routes = """
2
+ Bd8CxCTLez2ckVTqEJjuZkWjYFSRbo8fA1qYbd7yFVP9 Eaft9xXzfgbRqsHd65WspoaxTtH7pkznM9YA8tsDKGwj
3
+ Fc2TRJVCpFZpRz56mFnQETctib1zwFnwHcS7HoQSgUzZ EVJctTWikt29rUXBf49tyQdK87x837HtvpCwqeSjp1Ur
4
+ """
5
+ token = "6VBTMLgv256c7scudNf8T5GoTJcEE8WfgcJhxbGYPQ8G"
6
+ private_keys = "file: ./path/to/privates.txt"
7
+ value = "0.012 t"
8
+ proxies = "https://site.com/api/get-proxies"
9
+ nodes = "https://api.devnet.solana.com"
@@ -481,19 +481,19 @@ wheels = [
481
481
 
482
482
  [[package]]
483
483
  name = "mm-crypto-utils"
484
- version = "0.0.19"
484
+ version = "0.1.1"
485
485
  source = { registry = "https://pypi.org/simple" }
486
486
  dependencies = [
487
487
  { name = "loguru" },
488
488
  { name = "mm-std" },
489
489
  ]
490
490
  wheels = [
491
- { url = "https://files.pythonhosted.org/packages/49/0b/408f661aba09bfc3625652a6cf2ba516874aaaa4f6c9eaaeca450cf70004/mm_crypto_utils-0.0.19-py3-none-any.whl", hash = "sha256:b51184a53aa78cb70253c3c2e0ad56a98a214a854ffb74a4130a4401cd025538", size = 6992 },
491
+ { url = "https://files.pythonhosted.org/packages/0f/e2/9cb771e5af1d555b1fe34a9b8f301b8ae62f2ec3a53b2599232dcb5af221/mm_crypto_utils-0.1.1-py3-none-any.whl", hash = "sha256:5f743d4e2f100e05c932d3a1819115dd37212dece8ed444025263daa0ea88402", size = 7327 },
492
492
  ]
493
493
 
494
494
  [[package]]
495
495
  name = "mm-sol"
496
- version = "0.2.9"
496
+ version = "0.3.0"
497
497
  source = { editable = "." }
498
498
  dependencies = [
499
499
  { name = "base58" },
@@ -518,7 +518,7 @@ dev = [
518
518
  requires-dist = [
519
519
  { name = "base58", specifier = "~=2.1.1" },
520
520
  { name = "jinja2", specifier = ">=3.1.5" },
521
- { name = "mm-crypto-utils", specifier = ">=0.0.19" },
521
+ { name = "mm-crypto-utils", specifier = "~=0.1.1" },
522
522
  { name = "solana", specifier = "~=0.36.3" },
523
523
  { name = "typer", specifier = ">=0.15.1" },
524
524
  ]
@@ -536,7 +536,7 @@ dev = [
536
536
 
537
537
  [[package]]
538
538
  name = "mm-std"
539
- version = "0.1.15"
539
+ version = "0.2.1"
540
540
  source = { registry = "https://pypi.org/simple" }
541
541
  dependencies = [
542
542
  { name = "cryptography" },
@@ -548,7 +548,7 @@ dependencies = [
548
548
  { name = "rich" },
549
549
  ]
550
550
  wheels = [
551
- { url = "https://files.pythonhosted.org/packages/ee/b7/6c713eb013fd2d0b2d5dca0f96b1ecb25f464f43f00f172f0c8314c4e82a/mm_std-0.1.15-py3-none-any.whl", hash = "sha256:2138cd0606f85fa3b56172218b19dfdcfb192600a762bcb0b50e13dba3cf75fe", size = 14850 },
551
+ { url = "https://files.pythonhosted.org/packages/f3/ef/cb423cc357cc116313fcd97e9d0ff673234f5f1725f4a73929ced27b1d00/mm_std-0.2.1-py3-none-any.whl", hash = "sha256:71fa84f2fa897901c925614327123e8d0bc6ae61ff7873479dc9a53889442237", size = 14620 },
552
552
  ]
553
553
 
554
554
  [[package]]
@@ -1,11 +0,0 @@
1
- accounts: |
2
- 5BJ9ViMj4gi2BBX3wbCEJ4p4vpVWKpG6ja2aQP2ACBUv
3
- HbSAUDjzpr44fWzf9Ynj3V1jq3wBsgg88N88P4vzeGPX
4
-
5
- tokens: |
6
- 7XtmNSHJDHTZdx2K1S8D529kHsBbt3Civxt6vUHrGxBR
7
- 65FKbLPtrssmc8aVn9DEBY8VTGB85vsgadrmaW9H4nEB
8
-
9
- nodes: |
10
- https://api.mainnet-beta.solana.com
11
- # https://rpc.ankr.com/solana
@@ -1,9 +0,0 @@
1
- routes: |
2
- Bd8CxCTLez2ckVTqEJjuZkWjYFSRbo8fA1qYbd7yFVP9 Eaft9xXzfgbRqsHd65WspoaxTtH7pkznM9YA8tsDKGwj
3
- Fc2TRJVCpFZpRz56mFnQETctib1zwFnwHcS7HoQSgUzZ EVJctTWikt29rUXBf49tyQdK87x837HtvpCwqeSjp1Ur
4
- private_keys: "file: ./path/to/privates.txt"
5
- value: 0.012 sol
6
-
7
- proxies: "url: https://site.com/api/get-proxies"
8
- nodes: |
9
- https://api.devnet.solana.com
@@ -1,11 +0,0 @@
1
- routes: |
2
- Bd8CxCTLez2ckVTqEJjuZkWjYFSRbo8fA1qYbd7yFVP9 Eaft9xXzfgbRqsHd65WspoaxTtH7pkznM9YA8tsDKGwj
3
- Fc2TRJVCpFZpRz56mFnQETctib1zwFnwHcS7HoQSgUzZ EVJctTWikt29rUXBf49tyQdK87x837HtvpCwqeSjp1Ur
4
- token: 6VBTMLgv256c7scudNf8T5GoTJcEE8WfgcJhxbGYPQ8G
5
-
6
- private_keys_file: ./path/to/privates.txt
7
- value: 0.012 t
8
-
9
- proxies_url: https://site.com/api/get-proxies
10
- nodes: |
11
- https://api.devnet.solana.com
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes