77 deal_status ,
88 get_uploads as getUploads ,
99 download as _download ,
10- get_api_key as getApiKey
10+ get_file_info as getFileInfo ,
11+ get_balance as getBalance
1112)
1213
1314
@@ -44,6 +45,17 @@ def uploadBlob(self, source: io.BufferedReader, filename: str, tag: str = ''):
4445 return d .uploadBlob (source , filename , self .token , tag )
4546 except Exception as e :
4647 raise e
48+
49+ def getBalance (self ):
50+ """
51+ Retrieve the balance information of a user from the Lighthouse.
52+ :param publicKey: str, The public key of the user.
53+ :return: dict[str, any], A dictionary containing the data usage and data limit details.
54+ """
55+ try :
56+ return getBalance .get_balance (self .token )
57+ except Exception as e :
58+ raise e
4759
4860 @staticmethod
4961 def downloadBlob (dist : io .BufferedWriter , cid : str , chunk_size = 1024 * 1024 * 10 ):
@@ -74,18 +86,16 @@ def getDealStatus(cid: str):
7486 return deal_status .get_deal_status (cid )
7587 except Exception as e :
7688 raise e
77-
78- @staticmethod
79- def getUploads (publicKey : str , pageNo : int = 1 ):
89+
90+ def getUploads (self , lastKey : str = None ):
8091 """
8192 Get uploads from the Lighthouse.
8293
83- :param publicKey: str, public key
84- :param pageNo: int, page number (default: 1)
94+ :param lastKey: To navigate to different pages of results
8595 :return: List[t.DealData], list of deal data
8696 """
8797 try :
88- return getUploads .get_uploads (publicKey , pageNo )
98+ return getUploads .get_uploads (self . token , lastKey )
8999 except Exception as e :
90100 raise e
91101
@@ -104,18 +114,15 @@ def download(cid: str):
104114 raise e
105115
106116 @staticmethod
107- def getApiKey ( publicKey : str , signedMessage : str ):
117+ def getFileInfo ( cid : str ):
108118 """
109- Generates and returns an API key for the given public key and signed message.
110-
111- :param publicKey: str, The public key associated with the user.
112- :param signedMessage: str, The message signed by the user's private key.
113- :return: dict, A dict with generated API key.
119+ Retrieves information about a file using its CID (Content Identifier).
120+ :param cid: str, Content Identifier for the data to be downloaded
121+ returns: dict, A dictionary containing file information.
114122 """
115123
116-
117124 try :
118- return getApiKey . get_api_key ( publicKey , signedMessage )
125+ return getFileInfo . get_file_info ( cid )
119126 except Exception as e :
120127 raise e
121128
0 commit comments