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.
- {mm_sol-0.2.9 → mm_sol-0.3.0}/PKG-INFO +2 -2
- {mm_sol-0.2.9 → mm_sol-0.3.0}/pyproject.toml +2 -2
- {mm_sol-0.2.9 → mm_sol-0.3.0}/src/mm_sol/cli/cli.py +4 -3
- {mm_sol-0.2.9 → mm_sol-0.3.0}/src/mm_sol/cli/cmd/balances_cmd.py +3 -2
- {mm_sol-0.2.9 → mm_sol-0.3.0}/src/mm_sol/cli/cmd/example_cmd.py +1 -1
- {mm_sol-0.2.9 → mm_sol-0.3.0}/src/mm_sol/cli/cmd/transfer_sol_cmd.py +11 -4
- {mm_sol-0.2.9 → mm_sol-0.3.0}/src/mm_sol/cli/cmd/transfer_token_cmd.py +11 -4
- mm_sol-0.3.0/src/mm_sol/cli/examples/balances.toml +9 -0
- mm_sol-0.3.0/src/mm_sol/cli/examples/transfer-sol.toml +8 -0
- mm_sol-0.3.0/src/mm_sol/cli/examples/transfer-token.toml +9 -0
- {mm_sol-0.2.9 → mm_sol-0.3.0}/uv.lock +6 -6
- mm_sol-0.2.9/src/mm_sol/cli/examples/balances.yml +0 -11
- mm_sol-0.2.9/src/mm_sol/cli/examples/transfer-sol.yml +0 -9
- mm_sol-0.2.9/src/mm_sol/cli/examples/transfer-token.yml +0 -11
- {mm_sol-0.2.9 → mm_sol-0.3.0}/.env.example +0 -0
- {mm_sol-0.2.9 → mm_sol-0.3.0}/.gitignore +0 -0
- {mm_sol-0.2.9 → mm_sol-0.3.0}/README.txt +0 -0
- {mm_sol-0.2.9 → mm_sol-0.3.0}/dict.dic +0 -0
- {mm_sol-0.2.9 → mm_sol-0.3.0}/justfile +0 -0
- {mm_sol-0.2.9 → mm_sol-0.3.0}/src/mm_sol/__init__.py +0 -0
- {mm_sol-0.2.9 → mm_sol-0.3.0}/src/mm_sol/account.py +0 -0
- {mm_sol-0.2.9 → mm_sol-0.3.0}/src/mm_sol/balance.py +0 -0
- {mm_sol-0.2.9 → mm_sol-0.3.0}/src/mm_sol/block.py +0 -0
- {mm_sol-0.2.9 → mm_sol-0.3.0}/src/mm_sol/cli/__init__.py +0 -0
- {mm_sol-0.2.9 → mm_sol-0.3.0}/src/mm_sol/cli/calcs.py +0 -0
- {mm_sol-0.2.9 → mm_sol-0.3.0}/src/mm_sol/cli/cli_utils.py +0 -0
- {mm_sol-0.2.9 → mm_sol-0.3.0}/src/mm_sol/cli/cmd/__init__.py +0 -0
- {mm_sol-0.2.9 → mm_sol-0.3.0}/src/mm_sol/cli/cmd/balance_cmd.py +0 -0
- {mm_sol-0.2.9 → mm_sol-0.3.0}/src/mm_sol/cli/cmd/node_cmd.py +0 -0
- {mm_sol-0.2.9 → mm_sol-0.3.0}/src/mm_sol/cli/cmd/wallet/__init__.py +0 -0
- {mm_sol-0.2.9 → mm_sol-0.3.0}/src/mm_sol/cli/cmd/wallet/keypair_cmd.py +0 -0
- {mm_sol-0.2.9 → mm_sol-0.3.0}/src/mm_sol/cli/cmd/wallet/new_cmd.py +0 -0
- {mm_sol-0.2.9 → mm_sol-0.3.0}/src/mm_sol/cli/validators.py +0 -0
- {mm_sol-0.2.9 → mm_sol-0.3.0}/src/mm_sol/constants.py +0 -0
- {mm_sol-0.2.9 → mm_sol-0.3.0}/src/mm_sol/converters.py +0 -0
- {mm_sol-0.2.9 → mm_sol-0.3.0}/src/mm_sol/py.typed +0 -0
- {mm_sol-0.2.9 → mm_sol-0.3.0}/src/mm_sol/rpc.py +0 -0
- {mm_sol-0.2.9 → mm_sol-0.3.0}/src/mm_sol/solana_cli.py +0 -0
- {mm_sol-0.2.9 → mm_sol-0.3.0}/src/mm_sol/token.py +0 -0
- {mm_sol-0.2.9 → mm_sol-0.3.0}/src/mm_sol/transfer.py +0 -0
- {mm_sol-0.2.9 → mm_sol-0.3.0}/src/mm_sol/utils.py +0 -0
- {mm_sol-0.2.9 → mm_sol-0.3.0}/tests/__init__.py +0 -0
- {mm_sol-0.2.9 → mm_sol-0.3.0}/tests/cli/__init__.py +0 -0
- {mm_sol-0.2.9 → mm_sol-0.3.0}/tests/cli/cmd/__init__.py +0 -0
- {mm_sol-0.2.9 → mm_sol-0.3.0}/tests/cli/cmd/wallet/__init__.py +0 -0
- {mm_sol-0.2.9 → mm_sol-0.3.0}/tests/cli/cmd/wallet/test_keypair_cmd.py +0 -0
- {mm_sol-0.2.9 → mm_sol-0.3.0}/tests/cli/cmd/wallet/test_new_cmd.py +0 -0
- {mm_sol-0.2.9 → mm_sol-0.3.0}/tests/conftest.py +0 -0
- {mm_sol-0.2.9 → mm_sol-0.3.0}/tests/test_account.py +0 -0
- {mm_sol-0.2.9 → mm_sol-0.3.0}/tests/test_balance.py +0 -0
- {mm_sol-0.2.9 → mm_sol-0.3.0}/tests/test_client.py +0 -0
- {mm_sol-0.2.9 → mm_sol-0.3.0}/tests/test_converters.py +0 -0
- {mm_sol-0.2.9 → mm_sol-0.3.0}/tests/test_rpc.py +0 -0
- {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.
|
|
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
|
|
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,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:
|
|
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:
|
|
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:
|
|
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:
|
|
27
|
-
config = Config.
|
|
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}.
|
|
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:
|
|
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.
|
|
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:
|
|
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.
|
|
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.
|
|
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/
|
|
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.
|
|
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 = "
|
|
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
|
|
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/
|
|
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
|
|
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
|