hippius 0.2.26__tar.gz → 0.2.27__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.
Files changed (22) hide show
  1. {hippius-0.2.26 → hippius-0.2.27}/PKG-INFO +1 -1
  2. {hippius-0.2.26 → hippius-0.2.27}/hippius_sdk/__init__.py +1 -1
  3. {hippius-0.2.26 → hippius-0.2.27}/hippius_sdk/substrate.py +16 -9
  4. {hippius-0.2.26 → hippius-0.2.27}/pyproject.toml +1 -1
  5. {hippius-0.2.26 → hippius-0.2.27}/README.md +0 -0
  6. {hippius-0.2.26 → hippius-0.2.27}/hippius_sdk/cli.py +0 -0
  7. {hippius-0.2.26 → hippius-0.2.27}/hippius_sdk/cli_assets.py +0 -0
  8. {hippius-0.2.26 → hippius-0.2.27}/hippius_sdk/cli_handlers.py +0 -0
  9. {hippius-0.2.26 → hippius-0.2.27}/hippius_sdk/cli_parser.py +0 -0
  10. {hippius-0.2.26 → hippius-0.2.27}/hippius_sdk/cli_rich.py +0 -0
  11. {hippius-0.2.26 → hippius-0.2.27}/hippius_sdk/client.py +0 -0
  12. {hippius-0.2.26 → hippius-0.2.27}/hippius_sdk/config.py +0 -0
  13. {hippius-0.2.26 → hippius-0.2.27}/hippius_sdk/db/README.md +0 -0
  14. {hippius-0.2.26 → hippius-0.2.27}/hippius_sdk/db/env.db.template +0 -0
  15. {hippius-0.2.26 → hippius-0.2.27}/hippius_sdk/db/migrations/20241201000001_create_key_storage_tables.sql +0 -0
  16. {hippius-0.2.26 → hippius-0.2.27}/hippius_sdk/db/setup_database.sh +0 -0
  17. {hippius-0.2.26 → hippius-0.2.27}/hippius_sdk/db_utils.py +0 -0
  18. {hippius-0.2.26 → hippius-0.2.27}/hippius_sdk/errors.py +0 -0
  19. {hippius-0.2.26 → hippius-0.2.27}/hippius_sdk/ipfs.py +0 -0
  20. {hippius-0.2.26 → hippius-0.2.27}/hippius_sdk/ipfs_core.py +0 -0
  21. {hippius-0.2.26 → hippius-0.2.27}/hippius_sdk/key_storage.py +0 -0
  22. {hippius-0.2.26 → hippius-0.2.27}/hippius_sdk/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: hippius
3
- Version: 0.2.26
3
+ Version: 0.2.27
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
@@ -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.27"
30
30
  __all__ = [
31
31
  "HippiusClient",
32
32
  "IPFSClient",
@@ -1255,16 +1255,13 @@ 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
 
1270
1267
  # Check if the result exists and return the value
@@ -1276,12 +1273,10 @@ class SubstrateClient:
1276
1273
  print(f"Error querying SubAccount: {e}")
1277
1274
  return None
1278
1275
 
1279
-
1280
1276
  def is_main_account(self, account_id: str, seed_phrase: str) -> bool:
1281
1277
  sub_account = self.query_sub_account(account_id, seed_phrase=seed_phrase)
1282
1278
  return sub_account is None
1283
1279
 
1284
-
1285
1280
  def query_free_credits(self, account_id: str, seed_phrase) -> int:
1286
1281
  try:
1287
1282
  if not self._substrate:
@@ -1289,9 +1284,7 @@ class SubstrateClient:
1289
1284
 
1290
1285
  # Query the FreeCredits storage map
1291
1286
  result = self._substrate.query(
1292
- module="Credits",
1293
- storage_function="FreeCredits",
1294
- params=[account_id]
1287
+ module="Credits", storage_function="FreeCredits", params=[account_id]
1295
1288
  )
1296
1289
 
1297
1290
  # Return the u128 value (converted to int for Python compatibility)
@@ -1303,3 +1296,17 @@ class SubstrateClient:
1303
1296
  except Exception as e:
1304
1297
  print(f"Error querying FreeCredits: {e}")
1305
1298
  return 0
1299
+
1300
+ def get_account_roles(self, account_id: str, seed_phrase) -> int:
1301
+ try:
1302
+ if not self._substrate:
1303
+ self.connect(seed_phrase)
1304
+
1305
+ result = self._substrate.query(
1306
+ module="SubAccount",
1307
+ storage_function="SubAccountRole",
1308
+ params=[account_id],
1309
+ )
1310
+ return result.value
1311
+ except Exception as e:
1312
+ print(f"Error querying SubAccountRole: {e}")
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "hippius"
3
- version = "0.2.26"
3
+ version = "0.2.27"
4
4
  description = "Python SDK and CLI for Hippius blockchain storage"
5
5
  authors = ["Dubs <dubs@dubs.rs>"]
6
6
  readme = "README.md"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes