mm-sol 0.5.8__py3-none-any.whl → 0.5.9__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/rpc_async.py CHANGED
@@ -44,14 +44,14 @@ async def _ws_call(node: str, data: dict[str, object], timeout: float) -> DataRe
44
44
 
45
45
  err = response.get("error", {}).get("message", "")
46
46
  if err:
47
- return DataResult(err=f"service_error: {err}", data=response)
47
+ return DataResult.err(f"service_error: {err}", {"res": response})
48
48
  if "result" in response:
49
- return DataResult(ok=response["result"], data=response)
50
- return DataResult(err="unknown_response", data=response)
49
+ return DataResult.ok(response["result"], {"res": response})
50
+ return DataResult.err("unknown_response", {"res": response})
51
51
  except TimeoutError:
52
- return DataResult(err="timeout")
52
+ return DataResult.err("timeout")
53
53
  except Exception as err:
54
- return DataResult(err=f"exception: {err}")
54
+ return DataResult.exception(err)
55
55
 
56
56
 
57
57
  async def get_block_height(node: str, timeout: float = 10, proxy: str | None = None) -> DataResult[int]:
mm_sol/token_async.py CHANGED
@@ -26,15 +26,15 @@ async def get_token_balance(
26
26
 
27
27
  # Sometimes it not raise an error, but it returns this :(
28
28
  if isinstance(res, InvalidParamsMessage) and "could not find account" in res.message:
29
- return DataResult(ok=0, data=res.to_json())
30
- return DataResult(ok=int(res.value.amount), data=res.to_json())
31
- except RPCException as e:
32
- if "could not find account" in str(e):
33
- return DataResult(ok=0, data={"rpc_exception": str(e)})
34
- return DataResult(err="error", data={"rpc_exception": str(e)})
35
- except httpx.HTTPStatusError as e:
36
- return DataResult(err=f"http error: {e}")
37
- except SolanaRpcException as e:
38
- return DataResult(err=e.error_msg)
39
- except Exception as e:
40
- return DataResult(err="exception", data={"exception": str(e)})
29
+ return DataResult.ok(0, {"res": res.to_json()})
30
+ return DataResult.ok(int(res.value.amount), {"res": res.to_json()})
31
+ except RPCException as err:
32
+ if "could not find account" in str(err):
33
+ return DataResult.ok(0, {"rpc_exception": str(err)})
34
+ return DataResult.exception(err)
35
+ except httpx.HTTPStatusError as err:
36
+ return DataResult.err(f"http error: {err}")
37
+ except SolanaRpcException as err:
38
+ return DataResult.err(err.error_msg)
39
+ except Exception as err:
40
+ return DataResult.exception(err)
@@ -1,10 +1,10 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mm-sol
3
- Version: 0.5.8
3
+ Version: 0.5.9
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.13
7
+ Requires-Dist: mm-crypto-utils>=0.2.15
8
8
  Requires-Dist: mnemonic==0.21
9
9
  Requires-Dist: socksio>=1.0.0
10
10
  Requires-Dist: solana~=0.36.6
@@ -7,10 +7,10 @@ mm_sol/constants.py,sha256=WSpfz5_cq_8XbIrNFJGu9okwbfPTL00zsyR_k9-7O0o,29
7
7
  mm_sol/converters.py,sha256=rBxe3SIADZS8hG7TYl4FgjmvKH-ykaTmNbnWWQDiFZ4,1430
8
8
  mm_sol/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
9
  mm_sol/rpc.py,sha256=Tw7THbU0lShjTGNGe4-Mc6q1U5E2dgjY2LIfrMTSfeA,8057
10
- mm_sol/rpc_async.py,sha256=xdvlA9RB5ZZA0lnIRvyNHOHsuIpM7iuzkFF2vKEQCGE,2474
10
+ mm_sol/rpc_async.py,sha256=_cKqyd5oLArm9VWWuYNqq2PbkqEu7KrsH2r4IAEevGY,2476
11
11
  mm_sol/solana_cli.py,sha256=ig3OoTvmkrl7MFQSZjRHIraLSmtse0_9kn5Nsw8_zb0,8258
12
12
  mm_sol/token.py,sha256=O8z3UE3iZGYLWw8fnd9weYMcoQO0m88noqbRO_jntGg,1092
13
- mm_sol/token_async.py,sha256=5B9sRTyUMOCmt4oj2eAPLo8vqNbs3er89Klqsb-jQSY,1613
13
+ mm_sol/token_async.py,sha256=6IWlQOnyTWA2e3_bccxa10Y4BhbgQpXUAS1NrTyw67E,1572
14
14
  mm_sol/transfer.py,sha256=taf2NTLpo-bxISeaILARXEGLldUvqvP-agp5IDva7Hw,5825
15
15
  mm_sol/utils.py,sha256=oD06NsMSMhN6lqsM6mSgLTtiKwA1uAsen9WR82ofRTE,923
16
16
  mm_sol/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -29,7 +29,7 @@ mm_sol/cli/cmd/wallet/keypair_cmd.py,sha256=cRHVVTs9zNYmUozZ8ZlJoutn9V6r8I1AEHBr
29
29
  mm_sol/cli/cmd/wallet/mnemonic_cmd.py,sha256=IiON_fJT5AFfIr_E1LR6_iDYZ3c_jWCFc-wSYqk61V8,648
30
30
  mm_sol/cli/examples/balances.toml,sha256=333g2EkyYBDW7OWFGMIWVZGkdFQMMo0Ag-bg-BvS4Zg,349
31
31
  mm_sol/cli/examples/transfer.toml,sha256=kOCdmuwmhlOam4LVtlcYTKF0PoZYHWMlv9gWxNSXMOk,1624
32
- mm_sol-0.5.8.dist-info/METADATA,sha256=MmEwreyEm8-zYHxk_W74OAZK_K6dUiIUN9vE2CE7G3E,321
33
- mm_sol-0.5.8.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
34
- mm_sol-0.5.8.dist-info/entry_points.txt,sha256=MrYnosumy9nsITSAw5TiR3WXDwsdoF0YvUIlZ38TLLs,46
35
- mm_sol-0.5.8.dist-info/RECORD,,
32
+ mm_sol-0.5.9.dist-info/METADATA,sha256=rPkIVLM-UIwT_o9HLo8E_EqputbOZ44gfIGxw8_rstA,321
33
+ mm_sol-0.5.9.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
34
+ mm_sol-0.5.9.dist-info/entry_points.txt,sha256=MrYnosumy9nsITSAw5TiR3WXDwsdoF0YvUIlZ38TLLs,46
35
+ mm_sol-0.5.9.dist-info/RECORD,,
File without changes