fix: Hide expired domains
All checks were successful
Build Docker / Build Image (push) Successful in 43s
All checks were successful
Build Docker / Build Image (push) Successful in 43s
This commit is contained in:
parent
f695d53f8d
commit
da9354cb23
17
account.py
17
account.py
@ -15,6 +15,9 @@ ip = os.getenv("hsd_ip")
|
||||
if ip is None:
|
||||
ip = "localhost"
|
||||
|
||||
show_expired = os.getenv("show_expired")
|
||||
if show_expired is None:
|
||||
show_expired = False
|
||||
|
||||
hsd = api.hsd(APIKEY,ip)
|
||||
hsw = api.hsw(APIKEY,ip)
|
||||
@ -179,8 +182,22 @@ def getDomains(account,own=True):
|
||||
else:
|
||||
response = requests.get(f"http://x:{APIKEY}@{ip}:12039/wallet/{account}/name")
|
||||
info = response.json()
|
||||
|
||||
if show_expired:
|
||||
return info
|
||||
|
||||
# Remove any expired domains
|
||||
domains = []
|
||||
for domain in info:
|
||||
if 'stats' in domain:
|
||||
if 'daysUntilExpire' in domain['stats']:
|
||||
if domain['stats']['daysUntilExpire'] < 0:
|
||||
continue
|
||||
domains.append(domain)
|
||||
|
||||
|
||||
return domains
|
||||
|
||||
def getTransactions(account):
|
||||
# Get the transactions
|
||||
info = hsw.getWalletTxHistory(account)
|
||||
|
@ -1,3 +1,4 @@
|
||||
hsd_api=123480615465636893475aCwyaae6s45
|
||||
hsd_ip=localhost
|
||||
theme=black
|
||||
show_expired=false
|
Loading…
Reference in New Issue
Block a user