feat: Add wallet status
All checks were successful
Build Docker / Build Image (push) Successful in 1m16s
All checks were successful
Build Docker / Build Image (push) Successful in 1m16s
This commit is contained in:
19
account.py
19
account.py
@@ -381,6 +381,25 @@ def getNodeSync():
|
||||
sync = round(sync, 2)
|
||||
return sync
|
||||
|
||||
def getWalletStatus():
|
||||
response = hsw.rpc_getWalletInfo()
|
||||
if 'error' in response and response['error'] != None:
|
||||
return "Error"
|
||||
|
||||
# return response
|
||||
walletHeight = response['result']['height']
|
||||
# Get the current block height
|
||||
nodeHeight = getBlockHeight()
|
||||
|
||||
if walletHeight < nodeHeight:
|
||||
return f"Scanning {walletHeight/nodeHeight*100:.2f}%"
|
||||
elif walletHeight == nodeHeight:
|
||||
return "Ready"
|
||||
else:
|
||||
return "Error wallet ahead of node"
|
||||
|
||||
|
||||
|
||||
def getBids(account, domain="NONE"):
|
||||
if domain == "NONE":
|
||||
return hsw.getWalletBids(account)
|
||||
|
||||
Reference in New Issue
Block a user