feat: Add some basic auction functions

This commit is contained in:
2023-12-29 12:42:07 +11:00
parent 6aeb02cdd2
commit 9e02fd7774
5 changed files with 411 additions and 3 deletions

View File

@@ -134,3 +134,23 @@ def timestamp_to_readable_time(timestamp):
dt_object = datetime.datetime.fromtimestamp(timestamp)
readable_time = dt_object.strftime("%H:%M:%S %d %b %Y")
return readable_time
def bids(data):
html = ''
for bid in data:
lockup = bid['lockup']
lockup = lockup / 1000000
lockup = round(lockup, 2)
html += "<tr>"
html += f"<td>{lockup} HNS</td>"
# TODO If revealed
html += f"<td>Hidden until reveal</td>"
html += f"<td>Hidden until reveal</td>"
if bid['own']:
html += "<td>You</td>"
else:
html += "<td>Unknown</td>"
html += "</tr>"
return html