mm-sol 0.5.5__py3-none-any.whl → 0.5.7__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_sol/account.py CHANGED
@@ -51,7 +51,7 @@ def derive_accounts(mnemonic: str, passphrase: str, derivation_path: str, limit:
51
51
  index=i,
52
52
  path=path,
53
53
  address=str(keypair.pubkey()),
54
- private_key=base58.b58encode(bytes(keypair.to_bytes_array())).decode("utf-8"),
54
+ private_key=base58.b58encode(bytes(keypair.to_bytes())).decode("utf-8"),
55
55
  )
56
56
  )
57
57
 
@@ -61,8 +61,8 @@ def derive_accounts(mnemonic: str, passphrase: str, derivation_path: str, limit:
61
61
  def generate_account() -> NewAccount:
62
62
  keypair = Keypair()
63
63
  public_key = str(keypair.pubkey())
64
- private_key_base58 = base58.b58encode(bytes(keypair.to_bytes_array())).decode("utf-8")
65
- private_key_arr = list(keypair.to_bytes_array())
64
+ private_key_base58 = base58.b58encode(bytes(keypair.to_bytes())).decode("utf-8")
65
+ private_key_arr = list(keypair.to_bytes())
66
66
  return NewAccount(public_key=public_key, private_key_base58=private_key_base58, private_key_arr=private_key_arr)
67
67
 
68
68
 
@@ -93,12 +93,12 @@ def get_public_key(private_key: str) -> str:
93
93
 
94
94
  def get_private_key_base58(private_key: str) -> str:
95
95
  keypair = get_keypair(private_key)
96
- return base58.b58encode(bytes(keypair.to_bytes_array())).decode("utf-8")
96
+ return base58.b58encode(bytes(keypair.to_bytes())).decode("utf-8")
97
97
 
98
98
 
99
99
  def get_private_key_arr(private_key: str) -> list[int]:
100
100
  keypair = get_keypair(private_key)
101
- return list(x for x in keypair.to_bytes_array()) # noqa: C400
101
+ return list(x for x in keypair.to_bytes()) # noqa: C400
102
102
 
103
103
 
104
104
  def get_private_key_arr_str(private_key: str) -> str:
mm_sol/async_rpc.py CHANGED
@@ -1,6 +1,6 @@
1
1
  from typing import Any
2
2
 
3
- from mm_std import Result, ahr
3
+ from mm_std import Result, hra
4
4
 
5
5
 
6
6
  async def rpc_call(
@@ -19,7 +19,7 @@ async def rpc_call(
19
19
 
20
20
 
21
21
  async def _http_call(node: str, data: dict[str, object], timeout: float, proxy: str | None) -> Result[Any]:
22
- res = await ahr(node, method="POST", proxy=proxy, timeout=timeout, params=data, json_params=True)
22
+ res = await hra(node, method="POST", proxy=proxy, timeout=timeout, params=data, json_params=True)
23
23
  try:
24
24
  if res.is_error():
25
25
  return res.to_err_result()
mm_sol/balance.py CHANGED
@@ -63,10 +63,8 @@ def get_token_balance(
63
63
  return Ok(0)
64
64
  return Ok(int(res.value.amount), data=res.to_json())
65
65
  except RPCException as e:
66
- if len(e.args) > 1:
67
- s = e.args[0]
68
- if isinstance(s, InvalidParamsMessage) and "could not find account" in s.message:
69
- return Ok(0)
66
+ if "could not find account" in str(e):
67
+ return Ok(0)
70
68
  return Err(e)
71
69
  except httpx.HTTPStatusError as e:
72
70
  return Err(f"http error: {e}")
@@ -98,11 +96,10 @@ async def get_token_balance_async(
98
96
  return Ok(0)
99
97
  return Ok(int(res.value.amount), data=res.to_json())
100
98
  except RPCException as e:
101
- if len(e.args) > 1:
102
- s = e.args[0]
103
- if isinstance(s, InvalidParamsMessage) and "could not find account" in s.message:
104
- return Ok(0)
99
+ if "could not find account" in str(e):
100
+ return Ok(0)
105
101
  return Err(e)
102
+
106
103
  except httpx.HTTPStatusError as e:
107
104
  return Err(f"http error: {e}")
108
105
  except SolanaRpcException as e:
@@ -1,11 +1,12 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mm-sol
3
- Version: 0.5.5
3
+ Version: 0.5.7
4
4
  Requires-Python: >=3.12
5
5
  Requires-Dist: base58~=2.1.1
6
6
  Requires-Dist: jinja2>=3.1.6
7
- Requires-Dist: mm-crypto-utils>=0.2.9
7
+ Requires-Dist: mm-crypto-utils>=0.2.10
8
8
  Requires-Dist: mnemonic==0.21
9
9
  Requires-Dist: socksio>=1.0.0
10
10
  Requires-Dist: solana~=0.36.6
11
+ Requires-Dist: solders~=0.26.0
11
12
  Requires-Dist: typer>=0.15.2
@@ -1,7 +1,7 @@
1
1
  mm_sol/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- mm_sol/account.py,sha256=0pjvNxwhpmDHoXY3oTY2fNlQHoWPmlS77r8JcP8lAy4,4545
3
- mm_sol/async_rpc.py,sha256=VpAovAgtDT-5OmwGyT8b-Ky_EtrGPKENKxZGGnw3_D8,1406
4
- mm_sol/balance.py,sha256=cMn9y0StOUwQM3Je4so6AoFCy3lS0JpaiEk-TnUp0Q4,5321
2
+ mm_sol/account.py,sha256=9aDP5si-QJfSF8fz8K6geGUGh9GL83YJNkdU1qd4Xu8,4515
3
+ mm_sol/async_rpc.py,sha256=3_pEu4ywBjA_ej6cX5q4WJcN1oaPDeIAFa5xNceFCGw,1406
4
+ mm_sol/balance.py,sha256=5sSIQbipNUeB_Hn7piwrYt-PuSEf4ZKB8puUmC986iY,5112
5
5
  mm_sol/block.py,sha256=4Lc4TANgpGvPflVumC9MR-3vIl1dedGyci3cgzczuds,1794
6
6
  mm_sol/constants.py,sha256=WSpfz5_cq_8XbIrNFJGu9okwbfPTL00zsyR_k9-7O0o,29
7
7
  mm_sol/converters.py,sha256=rBxe3SIADZS8hG7TYl4FgjmvKH-ykaTmNbnWWQDiFZ4,1430
@@ -27,7 +27,7 @@ mm_sol/cli/cmd/wallet/keypair_cmd.py,sha256=cRHVVTs9zNYmUozZ8ZlJoutn9V6r8I1AEHBr
27
27
  mm_sol/cli/cmd/wallet/mnemonic_cmd.py,sha256=IiON_fJT5AFfIr_E1LR6_iDYZ3c_jWCFc-wSYqk61V8,648
28
28
  mm_sol/cli/examples/balances.toml,sha256=333g2EkyYBDW7OWFGMIWVZGkdFQMMo0Ag-bg-BvS4Zg,349
29
29
  mm_sol/cli/examples/transfer.toml,sha256=kOCdmuwmhlOam4LVtlcYTKF0PoZYHWMlv9gWxNSXMOk,1624
30
- mm_sol-0.5.5.dist-info/METADATA,sha256=90sfCL0vDIivEZTDRLHZGgu9leQSarrcyLQq3Th-yxo,289
31
- mm_sol-0.5.5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
32
- mm_sol-0.5.5.dist-info/entry_points.txt,sha256=MrYnosumy9nsITSAw5TiR3WXDwsdoF0YvUIlZ38TLLs,46
33
- mm_sol-0.5.5.dist-info/RECORD,,
30
+ mm_sol-0.5.7.dist-info/METADATA,sha256=MJOqW-BVrNMi3RavsdDHLv3_HwlGqH_7pYJQvNv1O6o,321
31
+ mm_sol-0.5.7.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
32
+ mm_sol-0.5.7.dist-info/entry_points.txt,sha256=MrYnosumy9nsITSAw5TiR3WXDwsdoF0YvUIlZ38TLLs,46
33
+ mm_sol-0.5.7.dist-info/RECORD,,
File without changes