11#!/usr/bin/env python3
22
33import os
4- from . functions import upload as d
5- from .functions import types as t
4+ from typing import List
5+ from .functions import upload as d , types as t , deal_status , get_uploads as getUploads
66
77
88class Lighthouse :
@@ -15,10 +15,39 @@ def __init__(self, token: str = ""):
1515
1616 def upload (self , source : str ) -> t .Upload :
1717 """
18- Upload a file or directory to the lighthouse network
19- @params {source}: str, path to file or directory
18+ Upload a file or directory to the Lighthouse.
19+
20+ :param source: str, path to file or directory
21+ :return: t.Upload, the upload result
2022 """
2123 try :
2224 return d .upload (source , self .token )
2325 except Exception as e :
2426 raise e
27+
28+ @staticmethod
29+ def getDealStatus (cid : str ) -> List [t .DealData ]:
30+ """
31+ Get deal status from the Lighthouse.
32+
33+ :param cid: str, content identifier
34+ :return: List[t.DealData], list of deal data
35+ """
36+ try :
37+ return deal_status .get_deal_status (cid )
38+ except Exception as e :
39+ raise e
40+
41+ @staticmethod
42+ def getUploads (publicKey : str , pageNo : int = 1 ) -> List [t .DealData ]:
43+ """
44+ Get uploads from the Lighthouse.
45+
46+ :param publicKey: str, public key
47+ :param pageNo: int, page number (default: 1)
48+ :return: List[t.DealData], list of deal data
49+ """
50+ try :
51+ return getUploads .get_uploads (publicKey , pageNo )
52+ except Exception as e :
53+ raise e
0 commit comments