hippius 0.2.2__py3-none-any.whl → 0.2.4__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.
- {hippius-0.2.2.dist-info → hippius-0.2.4.dist-info}/METADATA +213 -156
- hippius-0.2.4.dist-info/RECORD +16 -0
- hippius_sdk/__init__.py +10 -21
- hippius_sdk/cli.py +282 -2627
- hippius_sdk/cli_assets.py +10 -0
- hippius_sdk/cli_handlers.py +2773 -0
- hippius_sdk/cli_parser.py +607 -0
- hippius_sdk/cli_rich.py +247 -0
- hippius_sdk/client.py +70 -22
- hippius_sdk/config.py +109 -142
- hippius_sdk/ipfs.py +435 -58
- hippius_sdk/ipfs_core.py +22 -1
- hippius_sdk/substrate.py +234 -553
- hippius_sdk/utils.py +84 -2
- hippius-0.2.2.dist-info/RECORD +0 -12
- {hippius-0.2.2.dist-info → hippius-0.2.4.dist-info}/WHEEL +0 -0
- {hippius-0.2.2.dist-info → hippius-0.2.4.dist-info}/entry_points.txt +0 -0
hippius_sdk/ipfs_core.py
CHANGED
@@ -11,7 +11,9 @@ class AsyncIPFSClient:
|
|
11
11
|
"""
|
12
12
|
|
13
13
|
def __init__(
|
14
|
-
self,
|
14
|
+
self,
|
15
|
+
api_url: str = "http://localhost:5001",
|
16
|
+
gateway: str = "https://get.hippius.network",
|
15
17
|
):
|
16
18
|
# Handle multiaddr format
|
17
19
|
if api_url and api_url.startswith("/"):
|
@@ -119,6 +121,25 @@ class AsyncIPFSClient:
|
|
119
121
|
response.raise_for_status()
|
120
122
|
return response.json()
|
121
123
|
|
124
|
+
async def unpin(self, cid: str) -> Dict[str, Any]:
|
125
|
+
"""
|
126
|
+
Unpin content by CID.
|
127
|
+
|
128
|
+
Args:
|
129
|
+
cid: Content Identifier to unpin
|
130
|
+
|
131
|
+
Returns:
|
132
|
+
Response from the IPFS node
|
133
|
+
"""
|
134
|
+
pin_ls_url = f"{self.api_url}/api/v0/pin/ls?arg={cid}"
|
135
|
+
pin_ls_response = await self.client.post(pin_ls_url)
|
136
|
+
pin_ls_response.raise_for_status()
|
137
|
+
response = await self.client.post(f"{self.api_url}/api/v0/pin/rm?arg={cid}")
|
138
|
+
|
139
|
+
response.raise_for_status()
|
140
|
+
result = response.json()
|
141
|
+
return result
|
142
|
+
|
122
143
|
async def ls(self, cid: str) -> Dict[str, Any]:
|
123
144
|
"""
|
124
145
|
List objects linked to the specified CID.
|