hippius 0.2.26__py3-none-any.whl → 0.2.28__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: hippius
3
- Version: 0.2.26
3
+ Version: 0.2.28
4
4
  Summary: Python SDK and CLI for Hippius blockchain storage
5
5
  Home-page: https://github.com/thenervelab/hippius-sdk
6
6
  Author: Dubs
@@ -1,4 +1,4 @@
1
- hippius_sdk/__init__.py,sha256=ygfnOeNCKSKoBHinG89dBAK07unIL6ak4rWiAoWONgE,1474
1
+ hippius_sdk/__init__.py,sha256=y4o5XC1sCI_zU0_aq-O6VBKmZs5XtjvD5fDMS0BF29A,1474
2
2
  hippius_sdk/cli.py,sha256=aqKOYSBSWt7UhcpFt7wf9yIPJ3bznpsJ6ehOnuZ4usI,18235
3
3
  hippius_sdk/cli_assets.py,sha256=V3MX63QTiex6mCp0VDXQJ7cagm5v1s4xtsu8c1O4G_k,371
4
4
  hippius_sdk/cli_handlers.py,sha256=TQNE9os87gRzRKLEO-SIwhFnBtEFMiaSESv-Bu7omfo,128909
@@ -15,9 +15,9 @@ hippius_sdk/errors.py,sha256=LScJJmawVAx7aRzqqQguYSkf9iazSjEQEBNlD_GXZ6Y,1589
15
15
  hippius_sdk/ipfs.py,sha256=8OLkBkNV7zEKqrtokAwrvD842qXt8qgFMIc03h_sdN0,94610
16
16
  hippius_sdk/ipfs_core.py,sha256=eOOgLoyP9mvwndnCjldnTc7z94ImYCXY3nm7JU3e_Mo,12676
17
17
  hippius_sdk/key_storage.py,sha256=oxfRRQXu8XVncUjhKJJ8rsc81JAkaj9MqZEwQa96idc,9474
18
- hippius_sdk/substrate.py,sha256=S1Sd3TLRY4BR7zbYOPzO98rielHfCf-wEglVbUQg09A,49708
18
+ hippius_sdk/substrate.py,sha256=mYt_dTN6aGVXbpbMSDpiXYyqBLkun_WxnwFzZCrp0_o,50276
19
19
  hippius_sdk/utils.py,sha256=rJ611yvwKSyiBpYU3w-SuyQxoghMGU-ePuslrPv5H5g,7388
20
- hippius-0.2.26.dist-info/METADATA,sha256=iXpVVM8lf_VMvvtTZY4_hevJWIg2-xpea4yt46wzLAY,30088
21
- hippius-0.2.26.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
22
- hippius-0.2.26.dist-info/entry_points.txt,sha256=bFAZjW3vndretf9-8s587jA2ebMVI7puhn_lVs8jPc8,149
23
- hippius-0.2.26.dist-info/RECORD,,
20
+ hippius-0.2.28.dist-info/METADATA,sha256=OocFzt-f085N3F0kbXXkRJ79TLLr7QQ9lZHTkuSec8g,30088
21
+ hippius-0.2.28.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
22
+ hippius-0.2.28.dist-info/entry_points.txt,sha256=bFAZjW3vndretf9-8s587jA2ebMVI7puhn_lVs8jPc8,149
23
+ hippius-0.2.28.dist-info/RECORD,,
hippius_sdk/__init__.py CHANGED
@@ -26,7 +26,7 @@ from hippius_sdk.config import (
26
26
  from hippius_sdk.ipfs import IPFSClient, S3PublishResult, S3DownloadResult
27
27
  from hippius_sdk.utils import format_cid, format_size, hex_to_ipfs_cid
28
28
 
29
- __version__ = "0.2.26"
29
+ __version__ = "0.2.28"
30
30
  __all__ = [
31
31
  "HippiusClient",
32
32
  "IPFSClient",
hippius_sdk/substrate.py CHANGED
@@ -1255,18 +1255,17 @@ class SubstrateClient:
1255
1255
  f"Failed to cancel storage request: {str(e)}"
1256
1256
  )
1257
1257
 
1258
-
1259
1258
  def query_sub_account(self, account_id: str, seed_phrase: str) -> str | None:
1260
1259
  try:
1261
1260
  if not self._substrate:
1262
1261
  self.connect(seed_phrase)
1263
1262
  # Initialize connection to the Substrate node
1264
1263
  result = self._substrate.query(
1265
- module="SubAccount",
1266
- storage_function="SubAccount",
1267
- params=[account_id]
1264
+ module="SubAccount", storage_function="SubAccount", params=[account_id]
1268
1265
  )
1269
1266
 
1267
+ print(f"Got SubAccount result {result=}")
1268
+
1270
1269
  # Check if the result exists and return the value
1271
1270
  if result and result.value:
1272
1271
  return result.value
@@ -1276,12 +1275,10 @@ class SubstrateClient:
1276
1275
  print(f"Error querying SubAccount: {e}")
1277
1276
  return None
1278
1277
 
1279
-
1280
1278
  def is_main_account(self, account_id: str, seed_phrase: str) -> bool:
1281
1279
  sub_account = self.query_sub_account(account_id, seed_phrase=seed_phrase)
1282
1280
  return sub_account is None
1283
1281
 
1284
-
1285
1282
  def query_free_credits(self, account_id: str, seed_phrase) -> int:
1286
1283
  try:
1287
1284
  if not self._substrate:
@@ -1289,10 +1286,9 @@ class SubstrateClient:
1289
1286
 
1290
1287
  # Query the FreeCredits storage map
1291
1288
  result = self._substrate.query(
1292
- module="Credits",
1293
- storage_function="FreeCredits",
1294
- params=[account_id]
1289
+ module="Credits", storage_function="FreeCredits", params=[account_id]
1295
1290
  )
1291
+ print(f"Got FreeCredits result {result=}")
1296
1292
 
1297
1293
  # Return the u128 value (converted to int for Python compatibility)
1298
1294
  return int(result.value) if result and result.value is not None else 0
@@ -1303,3 +1299,19 @@ class SubstrateClient:
1303
1299
  except Exception as e:
1304
1300
  print(f"Error querying FreeCredits: {e}")
1305
1301
  return 0
1302
+
1303
+ def get_account_roles(self, account_id: str, seed_phrase) -> int:
1304
+ try:
1305
+ if not self._substrate:
1306
+ self.connect(seed_phrase)
1307
+
1308
+ result = self._substrate.query(
1309
+ module="SubAccount",
1310
+ storage_function="SubAccountRole",
1311
+ params=[account_id],
1312
+ )
1313
+ print(f"Got SubAccountRole result {result=}")
1314
+
1315
+ return result.value
1316
+ except Exception as e:
1317
+ print(f"Error querying SubAccountRole: {e}")