mm-apt 0.3.1__tar.gz → 0.3.2__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_apt-0.3.1 → mm_apt-0.3.2}/PKG-INFO +2 -2
- {mm_apt-0.3.1 → mm_apt-0.3.2}/pyproject.toml +5 -4
- {mm_apt-0.3.1 → mm_apt-0.3.2}/src/mm_apt/ans.py +10 -10
- {mm_apt-0.3.1 → mm_apt-0.3.2}/src/mm_apt/balance.py +3 -3
- {mm_apt-0.3.1 → mm_apt-0.3.2}/tests/test_ans.py +2 -2
- {mm_apt-0.3.1 → mm_apt-0.3.2}/uv.lock +33 -32
- {mm_apt-0.3.1 → mm_apt-0.3.2}/.env.example +0 -0
- {mm_apt-0.3.1 → mm_apt-0.3.2}/.gitignore +0 -0
- {mm_apt-0.3.1 → mm_apt-0.3.2}/README.txt +0 -0
- {mm_apt-0.3.1 → mm_apt-0.3.2}/dict.dic +0 -0
- {mm_apt-0.3.1 → mm_apt-0.3.2}/justfile +0 -0
- {mm_apt-0.3.1 → mm_apt-0.3.2}/src/mm_apt/__init__.py +0 -0
- {mm_apt-0.3.1 → mm_apt-0.3.2}/src/mm_apt/coin.py +0 -0
- {mm_apt-0.3.1 → mm_apt-0.3.2}/src/mm_apt/py.typed +0 -0
- {mm_apt-0.3.1 → mm_apt-0.3.2}/tests/__init__.py +0 -0
- {mm_apt-0.3.1 → mm_apt-0.3.2}/tests/conftest.py +0 -0
- {mm_apt-0.3.1 → mm_apt-0.3.2}/tests/test_balance.py +0 -0
@@ -1,10 +1,10 @@
|
|
1
1
|
[project]
|
2
2
|
name = "mm-apt"
|
3
|
-
version = "0.3.
|
3
|
+
version = "0.3.2"
|
4
4
|
description = ""
|
5
5
|
requires-python = ">=3.12"
|
6
6
|
dependencies = [
|
7
|
-
"mm-crypto-utils>=0.3.
|
7
|
+
"mm-crypto-utils>=0.3.4",
|
8
8
|
]
|
9
9
|
|
10
10
|
[build-system]
|
@@ -15,11 +15,11 @@ build-backend = "hatchling.build"
|
|
15
15
|
dev-dependencies = [
|
16
16
|
"pytest~=8.3.5",
|
17
17
|
"pytest-xdist~=3.6.1",
|
18
|
-
"ruff~=0.11.
|
18
|
+
"ruff~=0.11.6",
|
19
19
|
"pip-audit~=2.9.0",
|
20
20
|
"bandit~=1.8.3",
|
21
21
|
"mypy~=1.15.0",
|
22
|
-
"pytest-asyncio
|
22
|
+
"pytest-asyncio~=0.26.0",
|
23
23
|
]
|
24
24
|
|
25
25
|
[tool.mypy]
|
@@ -69,4 +69,5 @@ exclude_dirs = ["tests"]
|
|
69
69
|
skips = ["B311"]
|
70
70
|
|
71
71
|
[tool.pytest.ini_options]
|
72
|
+
asyncio_mode = "auto"
|
72
73
|
asyncio_default_fixture_loop_scope = "function"
|
@@ -4,24 +4,24 @@ from mm_std import Result, http_request
|
|
4
4
|
async def address_to_name(address: str, timeout: float = 5, proxy: str | None = None) -> Result[str | None]:
|
5
5
|
url = f"https://www.aptosnames.com/api/mainnet/v1/name/{address}"
|
6
6
|
res = await http_request(url, proxy=proxy, timeout=timeout)
|
7
|
-
if res.
|
8
|
-
return res.
|
7
|
+
if res.is_err():
|
8
|
+
return res.to_err_result()
|
9
9
|
json_res = res.parse_json_body()
|
10
10
|
if res.status_code == 200 and json_res == {}:
|
11
|
-
return res.
|
11
|
+
return res.to_ok_result(None)
|
12
12
|
if "name" in json_res:
|
13
|
-
return res.
|
14
|
-
return res.
|
13
|
+
return res.to_ok_result(json_res["name"])
|
14
|
+
return res.to_err_result("unknown_response")
|
15
15
|
|
16
16
|
|
17
17
|
async def address_to_primary_name(address: str, timeout: float = 5, proxy: str | None = None) -> Result[str | None]:
|
18
18
|
url = f"https://www.aptosnames.com/api/mainnet/v1/primary-name/{address}"
|
19
19
|
res = await http_request(url, proxy=proxy, timeout=timeout)
|
20
|
-
if res.
|
21
|
-
return res.
|
20
|
+
if res.is_err():
|
21
|
+
return res.to_err_result()
|
22
22
|
json_res = res.parse_json_body()
|
23
23
|
if res.status_code == 200 and json_res == {}:
|
24
|
-
return res.
|
24
|
+
return res.to_ok_result(None)
|
25
25
|
if "name" in json_res:
|
26
|
-
return res.
|
27
|
-
return res.
|
26
|
+
return res.to_ok_result(json_res["name"])
|
27
|
+
return res.to_err_result("unknown_response")
|
@@ -7,7 +7,7 @@ async def get_balance(node: str, account: str, coin_type: str, timeout: float =
|
|
7
7
|
try:
|
8
8
|
json_res = res.parse_json_body()
|
9
9
|
if json_res.get("error_code") == "resource_not_found":
|
10
|
-
return res.
|
11
|
-
return res.
|
10
|
+
return res.to_ok_result(0)
|
11
|
+
return res.to_ok_result(int(json_res["data"]["coin"]["value"]))
|
12
12
|
except Exception as e:
|
13
|
-
return res.
|
13
|
+
return res.to_err_result(e)
|
@@ -15,7 +15,7 @@ async def test_address_to_primary_name():
|
|
15
15
|
|
16
16
|
async def test_address_to_name_async():
|
17
17
|
address = "0x68e6982c788b50e3caccc834a4764763381d7201be996914e1310139a35854ed"
|
18
|
-
assert (await ans.address_to_name(address)).
|
18
|
+
assert (await ans.address_to_name(address)).unwrap() == "vitalik"
|
19
19
|
|
20
20
|
address = "0xabfabdec0732564bd906fb94e467410a131c6e6040f7bca860458e2026e3b14e"
|
21
|
-
assert (await ans.address_to_primary_name(address)).
|
21
|
+
assert (await ans.address_to_primary_name(address)).unwrap() is None
|
@@ -413,7 +413,7 @@ wheels = [
|
|
413
413
|
|
414
414
|
[[package]]
|
415
415
|
name = "mm-apt"
|
416
|
-
version = "0.3.
|
416
|
+
version = "0.3.2"
|
417
417
|
source = { editable = "." }
|
418
418
|
dependencies = [
|
419
419
|
{ name = "mm-crypto-utils" },
|
@@ -431,7 +431,7 @@ dev = [
|
|
431
431
|
]
|
432
432
|
|
433
433
|
[package.metadata]
|
434
|
-
requires-dist = [{ name = "mm-crypto-utils", specifier = ">=0.3.
|
434
|
+
requires-dist = [{ name = "mm-crypto-utils", specifier = ">=0.3.4" }]
|
435
435
|
|
436
436
|
[package.metadata.requires-dev]
|
437
437
|
dev = [
|
@@ -439,26 +439,26 @@ dev = [
|
|
439
439
|
{ name = "mypy", specifier = "~=1.15.0" },
|
440
440
|
{ name = "pip-audit", specifier = "~=2.9.0" },
|
441
441
|
{ name = "pytest", specifier = "~=8.3.5" },
|
442
|
-
{ name = "pytest-asyncio", specifier = "
|
442
|
+
{ name = "pytest-asyncio", specifier = "~=0.26.0" },
|
443
443
|
{ name = "pytest-xdist", specifier = "~=3.6.1" },
|
444
|
-
{ name = "ruff", specifier = "~=0.11.
|
444
|
+
{ name = "ruff", specifier = "~=0.11.6" },
|
445
445
|
]
|
446
446
|
|
447
447
|
[[package]]
|
448
448
|
name = "mm-crypto-utils"
|
449
|
-
version = "0.3.
|
449
|
+
version = "0.3.4"
|
450
450
|
source = { registry = "https://pypi.org/simple" }
|
451
451
|
dependencies = [
|
452
452
|
{ name = "loguru" },
|
453
453
|
{ name = "mm-std" },
|
454
454
|
]
|
455
455
|
wheels = [
|
456
|
-
{ url = "https://files.pythonhosted.org/packages/
|
456
|
+
{ url = "https://files.pythonhosted.org/packages/e8/53/d89b21605698bfe087b8768d808c61ebac9d299694bf4a11bd84460691b3/mm_crypto_utils-0.3.4-py3-none-any.whl", hash = "sha256:964f81c53406ca58b0627dfd13c5743f1d919a94580b1683025bd40518983dd9", size = 10075 },
|
457
457
|
]
|
458
458
|
|
459
459
|
[[package]]
|
460
460
|
name = "mm-std"
|
461
|
-
version = "0.4.
|
461
|
+
version = "0.4.6"
|
462
462
|
source = { registry = "https://pypi.org/simple" }
|
463
463
|
dependencies = [
|
464
464
|
{ name = "aiohttp" },
|
@@ -474,7 +474,7 @@ dependencies = [
|
|
474
474
|
{ name = "tomlkit" },
|
475
475
|
]
|
476
476
|
wheels = [
|
477
|
-
{ url = "https://files.pythonhosted.org/packages/
|
477
|
+
{ url = "https://files.pythonhosted.org/packages/df/7c/bf7484f886905fd0c045b3ef617eac97cf4128e85191cc232df41c44b218/mm_std-0.4.6-py3-none-any.whl", hash = "sha256:f9f74ed75bda4569d8ed3fbb61b7f0add9668e800e93724cf84b61b599b77a68", size = 23821 },
|
478
478
|
]
|
479
479
|
|
480
480
|
[[package]]
|
@@ -840,15 +840,16 @@ wheels = [
|
|
840
840
|
|
841
841
|
[[package]]
|
842
842
|
name = "pydantic-settings"
|
843
|
-
version = "2.
|
843
|
+
version = "2.9.1"
|
844
844
|
source = { registry = "https://pypi.org/simple" }
|
845
845
|
dependencies = [
|
846
846
|
{ name = "pydantic" },
|
847
847
|
{ name = "python-dotenv" },
|
848
|
+
{ name = "typing-inspection" },
|
848
849
|
]
|
849
|
-
sdist = { url = "https://files.pythonhosted.org/packages/
|
850
|
+
sdist = { url = "https://files.pythonhosted.org/packages/67/1d/42628a2c33e93f8e9acbde0d5d735fa0850f3e6a2f8cb1eb6c40b9a732ac/pydantic_settings-2.9.1.tar.gz", hash = "sha256:c509bf79d27563add44e8446233359004ed85066cd096d8b510f715e6ef5d268", size = 163234 }
|
850
851
|
wheels = [
|
851
|
-
{ url = "https://files.pythonhosted.org/packages/
|
852
|
+
{ url = "https://files.pythonhosted.org/packages/b6/5f/d6d641b490fd3ec2c4c13b4244d68deea3a1b970a97be64f34fb5504ff72/pydantic_settings-2.9.1-py3-none-any.whl", hash = "sha256:59b4f431b1defb26fe620c71a7d3968a710d719f5f4cdbbdb7926edeb770f6ef", size = 44356 },
|
852
853
|
]
|
853
854
|
|
854
855
|
[[package]]
|
@@ -1009,27 +1010,27 @@ wheels = [
|
|
1009
1010
|
|
1010
1011
|
[[package]]
|
1011
1012
|
name = "ruff"
|
1012
|
-
version = "0.11.
|
1013
|
-
source = { registry = "https://pypi.org/simple" }
|
1014
|
-
sdist = { url = "https://files.pythonhosted.org/packages/
|
1015
|
-
wheels = [
|
1016
|
-
{ url = "https://files.pythonhosted.org/packages/
|
1017
|
-
{ url = "https://files.pythonhosted.org/packages/
|
1018
|
-
{ url = "https://files.pythonhosted.org/packages/
|
1019
|
-
{ url = "https://files.pythonhosted.org/packages/
|
1020
|
-
{ url = "https://files.pythonhosted.org/packages/
|
1021
|
-
{ url = "https://files.pythonhosted.org/packages/
|
1022
|
-
{ url = "https://files.pythonhosted.org/packages/
|
1023
|
-
{ url = "https://files.pythonhosted.org/packages/
|
1024
|
-
{ url = "https://files.pythonhosted.org/packages/
|
1025
|
-
{ url = "https://files.pythonhosted.org/packages/
|
1026
|
-
{ url = "https://files.pythonhosted.org/packages/
|
1027
|
-
{ url = "https://files.pythonhosted.org/packages/
|
1028
|
-
{ url = "https://files.pythonhosted.org/packages/
|
1029
|
-
{ url = "https://files.pythonhosted.org/packages/
|
1030
|
-
{ url = "https://files.pythonhosted.org/packages/
|
1031
|
-
{ url = "https://files.pythonhosted.org/packages/
|
1032
|
-
{ url = "https://files.pythonhosted.org/packages/
|
1013
|
+
version = "0.11.6"
|
1014
|
+
source = { registry = "https://pypi.org/simple" }
|
1015
|
+
sdist = { url = "https://files.pythonhosted.org/packages/d9/11/bcef6784c7e5d200b8a1f5c2ddf53e5da0efec37e6e5a44d163fb97e04ba/ruff-0.11.6.tar.gz", hash = "sha256:bec8bcc3ac228a45ccc811e45f7eb61b950dbf4cf31a67fa89352574b01c7d79", size = 4010053 }
|
1016
|
+
wheels = [
|
1017
|
+
{ url = "https://files.pythonhosted.org/packages/6e/1f/8848b625100ebcc8740c8bac5b5dd8ba97dd4ee210970e98832092c1635b/ruff-0.11.6-py3-none-linux_armv6l.whl", hash = "sha256:d84dcbe74cf9356d1bdb4a78cf74fd47c740bf7bdeb7529068f69b08272239a1", size = 10248105 },
|
1018
|
+
{ url = "https://files.pythonhosted.org/packages/e0/47/c44036e70c6cc11e6ee24399c2a1e1f1e99be5152bd7dff0190e4b325b76/ruff-0.11.6-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:9bc583628e1096148011a5d51ff3c836f51899e61112e03e5f2b1573a9b726de", size = 11001494 },
|
1019
|
+
{ url = "https://files.pythonhosted.org/packages/ed/5b/170444061650202d84d316e8f112de02d092bff71fafe060d3542f5bc5df/ruff-0.11.6-py3-none-macosx_11_0_arm64.whl", hash = "sha256:f2959049faeb5ba5e3b378709e9d1bf0cab06528b306b9dd6ebd2a312127964a", size = 10352151 },
|
1020
|
+
{ url = "https://files.pythonhosted.org/packages/ff/91/f02839fb3787c678e112c8865f2c3e87cfe1744dcc96ff9fc56cfb97dda2/ruff-0.11.6-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:63c5d4e30d9d0de7fedbfb3e9e20d134b73a30c1e74b596f40f0629d5c28a193", size = 10541951 },
|
1021
|
+
{ url = "https://files.pythonhosted.org/packages/9e/f3/c09933306096ff7a08abede3cc2534d6fcf5529ccd26504c16bf363989b5/ruff-0.11.6-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:26a4b9a4e1439f7d0a091c6763a100cef8fbdc10d68593df6f3cfa5abdd9246e", size = 10079195 },
|
1022
|
+
{ url = "https://files.pythonhosted.org/packages/e0/0d/a87f8933fccbc0d8c653cfbf44bedda69c9582ba09210a309c066794e2ee/ruff-0.11.6-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b5edf270223dd622218256569636dc3e708c2cb989242262fe378609eccf1308", size = 11698918 },
|
1023
|
+
{ url = "https://files.pythonhosted.org/packages/52/7d/8eac0bd083ea8a0b55b7e4628428203441ca68cd55e0b67c135a4bc6e309/ruff-0.11.6-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:f55844e818206a9dd31ff27f91385afb538067e2dc0beb05f82c293ab84f7d55", size = 12319426 },
|
1024
|
+
{ url = "https://files.pythonhosted.org/packages/c2/dc/d0c17d875662d0c86fadcf4ca014ab2001f867621b793d5d7eef01b9dcce/ruff-0.11.6-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1d8f782286c5ff562e4e00344f954b9320026d8e3fae2ba9e6948443fafd9ffc", size = 11791012 },
|
1025
|
+
{ url = "https://files.pythonhosted.org/packages/f9/f3/81a1aea17f1065449a72509fc7ccc3659cf93148b136ff2a8291c4bc3ef1/ruff-0.11.6-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:01c63ba219514271cee955cd0adc26a4083df1956d57847978383b0e50ffd7d2", size = 13949947 },
|
1026
|
+
{ url = "https://files.pythonhosted.org/packages/61/9f/a3e34de425a668284e7024ee6fd41f452f6fa9d817f1f3495b46e5e3a407/ruff-0.11.6-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:15adac20ef2ca296dd3d8e2bedc6202ea6de81c091a74661c3666e5c4c223ff6", size = 11471753 },
|
1027
|
+
{ url = "https://files.pythonhosted.org/packages/df/c5/4a57a86d12542c0f6e2744f262257b2aa5a3783098ec14e40f3e4b3a354a/ruff-0.11.6-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:4dd6b09e98144ad7aec026f5588e493c65057d1b387dd937d7787baa531d9bc2", size = 10417121 },
|
1028
|
+
{ url = "https://files.pythonhosted.org/packages/58/3f/a3b4346dff07ef5b862e2ba06d98fcbf71f66f04cf01d375e871382b5e4b/ruff-0.11.6-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:45b2e1d6c0eed89c248d024ea95074d0e09988d8e7b1dad8d3ab9a67017a5b03", size = 10073829 },
|
1029
|
+
{ url = "https://files.pythonhosted.org/packages/93/cc/7ed02e0b86a649216b845b3ac66ed55d8aa86f5898c5f1691797f408fcb9/ruff-0.11.6-py3-none-musllinux_1_2_i686.whl", hash = "sha256:bd40de4115b2ec4850302f1a1d8067f42e70b4990b68838ccb9ccd9f110c5e8b", size = 11076108 },
|
1030
|
+
{ url = "https://files.pythonhosted.org/packages/39/5e/5b09840fef0eff1a6fa1dea6296c07d09c17cb6fb94ed5593aa591b50460/ruff-0.11.6-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:77cda2dfbac1ab73aef5e514c4cbfc4ec1fbef4b84a44c736cc26f61b3814cd9", size = 11512366 },
|
1031
|
+
{ url = "https://files.pythonhosted.org/packages/6f/4c/1cd5a84a412d3626335ae69f5f9de2bb554eea0faf46deb1f0cb48534042/ruff-0.11.6-py3-none-win32.whl", hash = "sha256:5151a871554be3036cd6e51d0ec6eef56334d74dfe1702de717a995ee3d5b287", size = 10485900 },
|
1032
|
+
{ url = "https://files.pythonhosted.org/packages/42/46/8997872bc44d43df986491c18d4418f1caff03bc47b7f381261d62c23442/ruff-0.11.6-py3-none-win_amd64.whl", hash = "sha256:cce85721d09c51f3b782c331b0abd07e9d7d5f775840379c640606d3159cae0e", size = 11558592 },
|
1033
|
+
{ url = "https://files.pythonhosted.org/packages/d7/6a/65fecd51a9ca19e1477c3879a7fda24f8904174d1275b419422ac00f6eee/ruff-0.11.6-py3-none-win_arm64.whl", hash = "sha256:3567ba0d07fb170b1b48d944715e3294b77f5b7679e8ba258199a250383ccb79", size = 10682766 },
|
1033
1034
|
]
|
1034
1035
|
|
1035
1036
|
[[package]]
|
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
|