Skip to content

Commit ca871b6

Browse files
committed
resolved conflicts and added get balance
1 parent 0a744f6 commit ca871b6

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/lighthouseweb3/__init__.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
deal_status,
88
get_uploads as getUploads,
99
download as _download,
10-
get_file_info as getFileInfo
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):

0 commit comments

Comments
 (0)