mm-apt 0.3.2__py3-none-any.whl → 0.3.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_apt/ans.py
CHANGED
@@ -5,23 +5,23 @@ async def address_to_name(address: str, timeout: float = 5, proxy: 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
7
|
if res.is_err():
|
8
|
-
return res.
|
8
|
+
return res.to_err()
|
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(None)
|
12
12
|
if "name" in json_res:
|
13
|
-
return res.
|
14
|
-
return res.
|
13
|
+
return res.to_ok(json_res["name"])
|
14
|
+
return res.to_err("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
20
|
if res.is_err():
|
21
|
-
return res.
|
21
|
+
return res.to_err()
|
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(None)
|
25
25
|
if "name" in json_res:
|
26
|
-
return res.
|
27
|
-
return res.
|
26
|
+
return res.to_ok(json_res["name"])
|
27
|
+
return res.to_err("unknown_response")
|
mm_apt/balance.py
CHANGED
@@ -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(0)
|
11
|
+
return res.to_ok(int(json_res["data"]["coin"]["value"]))
|
12
12
|
except Exception as e:
|
13
|
-
return res.
|
13
|
+
return res.to_err(e)
|
@@ -0,0 +1,8 @@
|
|
1
|
+
mm_apt/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
+
mm_apt/ans.py,sha256=LP9lgOW6nIC2cIWhl6iQKKMKi6I7ni2FarJ1QISyNmo,1104
|
3
|
+
mm_apt/balance.py,sha256=5GHPwxFy550FjHSTGxL3N3GcQu68nGg6RkNdl5mLimY,583
|
4
|
+
mm_apt/coin.py,sha256=NuVFVxDcL3acXdZBLr79dbzT44bWHZP2gtLILWxTzdE,71
|
5
|
+
mm_apt/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
6
|
+
mm_apt-0.3.3.dist-info/METADATA,sha256=BzVa5pn2N-2NBOLnDw-hxZAkfrHXcoESz0BBBVzcE20,112
|
7
|
+
mm_apt-0.3.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
8
|
+
mm_apt-0.3.3.dist-info/RECORD,,
|
mm_apt-0.3.2.dist-info/RECORD
DELETED
@@ -1,8 +0,0 @@
|
|
1
|
-
mm_apt/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
-
mm_apt/ans.py,sha256=7QlD_w-n8Is1vmmy5pSGL4y6kTrmx_lw0qkmNkhBq0s,1160
|
3
|
-
mm_apt/balance.py,sha256=2PMtSDhr3ai5nCKe9nwJqES3o6fe1MZeys6rlJO-Vu0,604
|
4
|
-
mm_apt/coin.py,sha256=NuVFVxDcL3acXdZBLr79dbzT44bWHZP2gtLILWxTzdE,71
|
5
|
-
mm_apt/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
6
|
-
mm_apt-0.3.2.dist-info/METADATA,sha256=EZDgu-QadbQOHZz_LHCeMD3ht0RUioqPT6U67k7YuhU,112
|
7
|
-
mm_apt-0.3.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
8
|
-
mm_apt-0.3.2.dist-info/RECORD,,
|
File without changes
|