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_sdk/ipfs_core.py CHANGED
@@ -11,7 +11,9 @@ class AsyncIPFSClient:
11
11
  """
12
12
 
13
13
  def __init__(
14
- self, api_url: str = "http://localhost:5001", gateway: str = "https://ipfs.io"
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.