feat: Added auctions page

This commit is contained in:
2024-02-13 11:18:16 +11:00
parent f525c0f1fd
commit ecf6ac522a
29 changed files with 3097 additions and 30 deletions

View File

@@ -13,6 +13,8 @@ def domains(domains, mobile=False):
expires = domain['stats']
if 'daysUntilExpire' in expires:
expires = expires['daysUntilExpire']
else:
expires = "No expiration date"
paid = domain['value']
paid = paid / 1000000
@@ -172,6 +174,51 @@ def bids(bids,reveals):
return html
def bidDomains(bids,domains, sortState=False):
html = ''
if not sortState:
for bid in bids:
for domain in domains:
if bid['name'] == domain['name']:
lockup = bid['lockup']
lockup = lockup / 1000000
lockup = round(lockup, 2)
bidValue = bid['value'] / 1000000
bidValue = round(bidValue, 2)
blind = lockup - bidValue
bidValue = "{:,}".format(bidValue)
blind = "{:,}".format(blind)
bidDisplay = f'<b>{bidValue} HNS</b> + {blind} HNS blind'
html += "<tr>"
html += f"<td>{domain['name']}</td>"
html += f"<td>{domain['state']}</td>"
html += f"<td>{bidDisplay}</td>"
html += "</tr>"
else:
for domain in domains:
for bid in bids:
if bid['name'] == domain['name']:
lockup = bid['lockup']
lockup = lockup / 1000000
lockup = round(lockup, 2)
bidValue = bid['value'] / 1000000
bidValue = round(bidValue, 2)
blind = lockup - bidValue
bidValue = "{:,}".format(bidValue)
blind = "{:,}".format(blind)
bidDisplay = f'<b>{bidValue} HNS</b> + {blind} HNS blind'
html += "<tr>"
html += f"<td>{domain['name']}</td>"
html += f"<td>{domain['state']}</td>"
html += f"<td>{bidDisplay}</td>"
html += "</tr>"
return html
def wallets(wallets):
html = ''
for wallet in wallets: