6 Commits

Author SHA1 Message Date
525b068f14 feat: Pull updates from main
All checks were successful
Build Docker / Build Image (push) Successful in 1m16s
Merges updates from #1
2025-07-12 16:44:38 +10:00
6b69f933c3 feat: Do some more optimization from AI
Double check this all works
2025-07-12 16:35:56 +10:00
6271cf810e feat: Try some more optimizations 2025-07-12 16:35:07 +10:00
61d9f209b7 feat: Optimize some of the auction routes 2025-07-12 16:35:07 +10:00
b2db24c08e feat: Add red warning on auction page for potential outbids 2025-07-12 16:35:07 +10:00
7dda41bda7 feat: Add api route for possible outbidded domains 2025-07-12 16:34:42 +10:00
5 changed files with 353 additions and 103 deletions

Binary file not shown.

View File

@@ -7,6 +7,7 @@ import re
import domainLookup
import json
import time
import concurrent.futures
dotenv.load_dotenv()
@@ -611,11 +612,35 @@ def getWalletStatus():
return "Error wallet ahead of node"
# Add a simple cache for bid data
_bid_cache = {}
_bid_cache_time = {}
_cache_duration = 300 # Increased cache duration to 5 minutes for bids
# Add domain info cache
_domain_info_cache = {}
_domain_info_time = {}
_domain_info_duration = 600 # Cache domain info for 10 minutes
# Add wallet authentication cache
_wallet_auth_cache = {}
_wallet_auth_time = {}
_wallet_auth_duration = 300 # Increased to 5 minutes for wallet auth
def getBids(account, domain="NONE"):
cache_key = f"{account}:{domain}"
current_time = time.time()
# Return cached data if available and fresh
if cache_key in _bid_cache and current_time - _bid_cache_time.get(cache_key, 0) < _cache_duration:
return _bid_cache[cache_key]
try:
if domain == "NONE":
response = hsw.getWalletBids(account)
else:
response = hsw.getWalletBidsByName(domain, account)
# Add backup for bids with no value
bids = []
for bid in response:
@@ -626,30 +651,163 @@ def getBids(account, domain="NONE"):
if 'height' not in bid:
bid['height'] = 0
bids.append(bid)
return bids
# Cache the results
_bid_cache[cache_key] = bids
_bid_cache_time[cache_key] = current_time
return bids
except Exception as e:
print(f"Error fetching bids: {str(e)}")
return []
def _fetch_domain_info(domain):
"""Helper function to fetch domain info with caching"""
current_time = time.time()
# Check cache first
if (domain in _domain_info_cache and
current_time - _domain_info_time.get(domain, 0) < _domain_info_duration):
return _domain_info_cache[domain]
# Fetch domain info
domain_info = getDomain(domain)
# Store in cache
_domain_info_cache[domain] = domain_info
_domain_info_time[domain] = current_time
return domain_info
def _fetch_domain_batch(domains, max_workers=10):
"""Fetch multiple domains in parallel"""
results = {}
with concurrent.futures.ThreadPoolExecutor(max_workers=max_workers) as executor:
# Create a mapping of futures to domains
future_to_domain = {executor.submit(_fetch_domain_info, domain): domain for domain in domains}
# Process as they complete
for future in concurrent.futures.as_completed(future_to_domain):
domain = future_to_domain[future]
try:
results[domain] = future.result()
except Exception as e:
print(f"Error fetching domain {domain}: {str(e)}")
results[domain] = {"error": str(e)}
return results
def getPossibleOutbids(account):
# Get all bids
bids = getBids(account)
if not bids or 'error' in bids:
return []
# Get current height
current_height = getBlockHeight()
# Sort out bids older than 720 blocks and extract domain names
filtered_bids = []
domains_to_check = set()
for bid in bids:
if (current_height - bid['height']) <= 720:
filtered_bids.append(bid)
domains_to_check.add(bid['name'])
if not domains_to_check:
return []
# Fetch all domain info in parallel
domain_info_map = _fetch_domain_batch(domains_to_check)
# Pre-filter domains in bidding state
bidding_domains = {
domain: info for domain, info in domain_info_map.items()
if ('info' in info and 'state' in info['info'] and
info['info']['state'] == "BIDDING")
}
# Process the results
possible_outbids = []
processed_domains = set()
# Group bids by domain name for efficient processing
bids_by_domain = {}
for bid in filtered_bids:
domain = bid['name']
if domain not in bids_by_domain:
bids_by_domain[domain] = []
bids_by_domain[domain].append(bid)
# Analyze each domain in bidding state
for domain, info in bidding_domains.items():
if domain in processed_domains or domain not in bids_by_domain:
continue
processed_domains.add(domain)
# Get all bids for this domain in one call
domain_bids = getBids(account, domain)
# Find the highest bid we've made
our_highest_bid = max(
(bid['value'] for bid in domain_bids if bid.get("own", False)),
default=0
)
# Quick check if any unrevealed bids could outbid us
if any(
bid["lockup"] > our_highest_bid
for bid in domain_bids
if not bid.get("own", False) and bid.get('value', 0) == -1000000
):
possible_outbids.append(domain)
return possible_outbids
def getReveals(account, domain):
return hsw.getWalletRevealsByName(domain, account)
def getPendingReveals(account):
bids = getBids(account)
domains = getDomains(account, False)
pending = []
for domain in domains:
if domain['state'] == "REVEAL":
reveals = getReveals(account, domain['name'])
for bid in bids:
if bid['name'] == domain['name']:
state_found = False
for reveal in reveals:
if reveal['own'] == True:
if bid['value'] == reveal['value']:
state_found = True
# Only get domains in REVEAL state to reduce API calls
domains = [d for d in getDomains(account, False) if d['state'] == "REVEAL"]
if not state_found:
if not domains: # Early return if no domains in REVEAL state
return []
pending = []
# Create a dictionary for O(1) lookups
domain_names = {domain['name']: domain for domain in domains}
# Group bids by name to batch process reveals
bids_by_name = {}
for bid in bids:
if bid['name'] in domain_names:
if bid['name'] not in bids_by_name:
bids_by_name[bid['name']] = []
bids_by_name[bid['name']].append(bid)
# Fetch reveals for each domain once
reveals_by_name = {}
for domain_name in bids_by_name:
reveals_by_name[domain_name] = getReveals(account, domain_name)
# Check each bid against the reveals
for domain_name, domain_bids in bids_by_name.items():
domain_reveals = reveals_by_name[domain_name]
for bid in domain_bids:
# Check if this bid has been revealed
bid_revealed = any(
reveal['own'] == True and bid['value'] == reveal['value']
for reveal in domain_reveals
)
if not bid_revealed:
pending.append(bid)
return pending
@@ -662,20 +820,27 @@ def getPendingRedeems(account, password):
pending = []
try:
# Collect all nameHashes first
name_hashes = []
for output in tx['result']['outputs']:
if output['covenant']['type'] != 5:
continue
if output['covenant']['action'] != "REDEEM":
continue
nameHash = output['covenant']['items'][0]
# Try to get the name from hash
name = hsd.rpc_getNameByHash(nameHash)
name_hashes.append(output['covenant']['items'][0])
# Batch processing name hashes
name_lookup = {}
for name_hash in name_hashes:
name = hsd.rpc_getNameByHash(name_hash)
if name['error']:
pending.append(nameHash)
pending.append(name_hash)
else:
pending.append(name['result'])
except:
print("Failed to parse redeems")
name_lookup[name_hash] = name['result']
except Exception as e:
print(f"Failed to parse redeems: {str(e)}")
return pending
@@ -683,13 +848,22 @@ def getPendingRedeems(account, password):
def getPendingRegisters(account):
bids = getBids(account)
domains = getDomains(account, False)
# Create dictionaries for O(1) lookups
bids_by_name = {}
for bid in bids:
if bid['name'] not in bids_by_name:
bids_by_name[bid['name']] = []
bids_by_name[bid['name']].append(bid)
pending = []
for domain in domains:
if domain['state'] == "CLOSED" and domain['registered'] == False:
for bid in bids:
if bid['name'] == domain['name']:
if domain['name'] in bids_by_name:
for bid in bids_by_name[domain['name']]:
if bid['value'] == domain['highest']:
pending.append(bid)
return pending
@@ -700,20 +874,26 @@ def getPendingFinalizes(account, password):
pending = []
try:
# Collect all nameHashes first
name_hashes = []
for output in tx['outputs']:
if output['covenant']['type'] != 10:
continue
if output['covenant']['action'] != "FINALIZE":
continue
nameHash = output['covenant']['items'][0]
# Try to get the name from hash
name = hsd.rpc_getNameByHash(nameHash)
name_hashes.append(output['covenant']['items'][0])
# Batch lookup for name hashes
for name_hash in name_hashes:
name = hsd.rpc_getNameByHash(name_hash)
if name['error']:
pending.append(nameHash)
pending.append(name_hash)
else:
pending.append(name['result'])
except:
print("Failed to parse finalizes")
except Exception as e:
print(f"Failed to parse finalizes: {str(e)}")
return pending
@@ -1056,19 +1236,51 @@ def revoke(account, domain):
}
def sendBatch(account, batch):
account_name = check_account(account)
password = ":".join(account.split(":")[1:])
def _prepare_wallet_for_batch(account_name, password):
"""Helper function to prepare wallet for batch operations with caching"""
cache_key = f"{account_name}:{password}"
current_time = time.time()
if account_name == False:
return {
"error": {
"message": "Invalid account"
}
}
# Return cached authentication if available and fresh
if (cache_key in _wallet_auth_cache and
current_time - _wallet_auth_time.get(cache_key, 0) < _wallet_auth_duration):
return _wallet_auth_cache[cache_key]
# Select and unlock wallet
result = {'success': False, 'error': None}
# Try to select the wallet
select_response = hsw.rpc_selectWallet(account_name)
if select_response['error'] is not None:
result['error'] = {"message": select_response['error']['message']}
return result
# Try to unlock the wallet
unlock_response = hsw.rpc_walletPassphrase(password, 30) # Increased timeout to reduce future unlocks
if (unlock_response['error'] is not None and
unlock_response['error']['message'] != "Wallet is not encrypted."):
result['error'] = {"message": unlock_response['error']['message']}
return result
# Authentication successful
result['success'] = True
# Cache the authentication result
_wallet_auth_cache[cache_key] = result
_wallet_auth_time[cache_key] = current_time
return result
def _execute_batch_operation(account_name, batch, operation_type="sendbatch"):
"""Execute a batch operation with the specified wallet"""
# Make the batch request
try:
response = hsw.rpc_selectWallet(account_name)
response = requests.post(
get_wallet_api_url(),
json={"method": operation_type, "params": [batch]},
timeout=30 # Add timeout to prevent hanging
).json()
if response['error'] is not None:
return {
"error": {
@@ -1090,31 +1302,42 @@ def sendBatch(account, batch):
if response['error'] is not None:
return response
if 'result' not in response:
return {
"error": {
"message": "No result"
}
}
return {"error": {"message": "No result"}}
return response['result']
except Exception as e:
return {
"error": {
"message": str(e)
}
}
return {"error": {"message": str(e)}}
def sendBatch(account, batch):
account_name = check_account(account)
if account_name == False:
return {"error": {"message": "Invalid account"}}
password = ":".join(account.split(":")[1:])
# Prepare the wallet (this uses caching)
auth_result = _prepare_wallet_for_batch(account_name, password)
if not auth_result['success']:
return auth_result['error']
# Execute the batch operation
return _execute_batch_operation(account_name, batch, "sendbatch")
def createBatch(account, batch):
account_name = check_account(account)
if account_name == False:
return {"error": {"message": "Invalid account"}}
password = ":".join(account.split(":")[1:])
if account_name == False:
return {
"error": {
"message": "Invalid account"
}
}
# Prepare the wallet (this uses caching)
auth_result = _prepare_wallet_for_batch(account_name, password)
if not auth_result['success']:
return auth_result['error']
# Execute the batch operation
return _execute_batch_operation(account_name, batch, "createbatch")
try:
response = hsw.rpc_selectWallet(account_name)

70
main.py
View File

@@ -56,6 +56,14 @@ def blocks_to_time(blocks: int) -> str:
# Add a cache for transactions with a timeout
tx_cache = {}
TX_CACHE_TIMEOUT = 60*5 # Cache timeout in seconds
# Add a cache for outbids with a timeout
outbids_cache = {}
OUTBIDS_CACHE_TIMEOUT = 60*2 # Cache timeout in seconds
@app.route('/')
def index():
# Check if the user is logged in
@@ -94,10 +102,6 @@ def reverseDirection(direction: str):
#region Transactions
# Add a cache for transactions with a timeout
tx_cache = {}
TX_CACHE_TIMEOUT = 60*5 # Cache timeout in seconds
@app.route('/tx')
def transactions():
# Check if the user is logged in
@@ -318,8 +322,12 @@ def auctions():
sort_time = direction
sort_time_next = reverseDirection(direction)
# Check if bids list is empty to avoid IndexError
if not bids:
domains = sorted(domains, key=lambda k: k['height'],reverse=reverse)
sortbyDomain = True
# If older HSD version sort by domain height
if bids[0]['height'] == 0:
elif bids[0]['height'] == 0:
domains = sorted(domains, key=lambda k: k['height'],reverse=reverse)
sortbyDomain = True
else:
@@ -330,7 +338,27 @@ def auctions():
sort_domain = direction
sort_domain_next = reverseDirection(direction)
bidsHtml = render.bidDomains(bids,domains,sortbyDomain)
# Check if outbids set to true
outbids = request.args.get("outbids")
if outbids is not None and outbids.lower() == "true":
# Check cache before making expensive call
cache_key = f"outbids_{account}"
current_time = time.time()
if cache_key in outbids_cache and (current_time - outbids_cache[cache_key]['time'] < OUTBIDS_CACHE_TIMEOUT):
outbids = outbids_cache[cache_key]['data']
else:
# Get outbid domains
outbids = account_module.getPossibleOutbids(account)
# Store in cache
outbids_cache[cache_key] = {
'data': outbids,
'time': current_time
}
else:
outbids = []
bidsHtml = render.bidDomains(bids,domains,sortbyDomain,outbids)
plugins = ""
message = ''
if 'message' in request.args:
@@ -358,11 +386,12 @@ def revealAllBids():
return redirect("/logout")
response = account_module.revealAll(request.cookies.get("account"))
if 'error' in response:
if response['error'] != None:
if response['error']['message'] == "Nothing to do.":
# Simplified error handling
if 'error' in response and response['error']:
error_msg = response['error'].get('message', str(response['error']))
if error_msg == "Nothing to do.":
return redirect("/auctions?message=No reveals pending")
return redirect("/auctions?message=" + response['error']['message'])
return redirect("/auctions?message=" + error_msg)
return redirect("/success?tx=" + response['result']['hash'])
@@ -501,10 +530,7 @@ def search():
dns = account_module.getDNS(search_term)
own_domains = account_module.getDomains(account)
own_domains = [x['name'] for x in own_domains]
own_domains = [x.lower() for x in own_domains]
if search_term in own_domains:
if account_module.isOwnDomain(account, search_term):
owner = "You"
dns = render.dns(dns)
@@ -699,10 +725,7 @@ def editPage(domain: str):
domain = domain.lower()
own_domains = account_module.getDomains(account)
own_domains = [x['name'] for x in own_domains]
own_domains = [x.lower() for x in own_domains]
if domain not in own_domains:
if not account_module.isOwnDomain(account, domain):
return redirect("/search?q=" + domain)
@@ -944,10 +967,7 @@ def auction(domain):
expires = domainInfo['info']['stats']['daysUntilExpire']
next = f"Expires in ~{expires} days"
own_domains = account_module.getDomains(account)
own_domains = [x['name'] for x in own_domains]
own_domains = [x.lower() for x in own_domains]
if search_term in own_domains:
if account_module.isOwnDomain(account,domain):
next_action = f'<a href="/manage/{domain}">Manage</a>'
elif state == "REVOKED":
next = "Available Now"
@@ -1673,6 +1693,12 @@ def api_wallet(function):
return send_file('templates/assets/img/HNS.png')
if function == "possibleOutbids":
return jsonify({"result": account_module.getPossibleOutbids(account)})
return jsonify({"error": "Invalid function", "result": "Invalid function"}), 400
@app.route('/api/v1/wallet/<function>/mobile', methods=["GET"])

View File

@@ -336,9 +336,8 @@ def bids(bids,reveals):
return html
def bidDomains(bids,domains, sortbyDomains=False):
def bidDomains(bids,domains, sortbyDomains=False, outbids=[]):
html = ''
if not sortbyDomains:
for bid in bids:
for domain in domains:
@@ -353,12 +352,14 @@ def bidDomains(bids,domains, sortbyDomains=False):
else:
bidDisplay = f'<b>{bidValue:,.2f}</b> HNS'
html += "<tr>"
if domain['name'] in outbids:
html += f"<td style='background-color: red;'><a class='text-decoration-none' style='color: var(--bs-table-color-state, var(--bs-table-color-type, var(--bs-table-color)));' href='/auction/{domain['name']}'>{renderDomain(domain['name'])}</a></td>"
else:
html += f"<td><a class='text-decoration-none' style='color: var(--bs-table-color-state, var(--bs-table-color-type, var(--bs-table-color)));' href='/auction/{domain['name']}'>{renderDomain(domain['name'])}</a></td>"
html += f"<td>{domain['state']}</td>"
html += f"<td style='white-space: nowrap;'>{bidDisplay}</td>"
html += f"<td class='hide-mobile'>{domain['height']:,}</td>"
html += f"<td class='hide-mobile'>{bid['height']:,}</td>"
html += "</tr>"
else:
for domain in domains:
@@ -374,7 +375,7 @@ def bidDomains(bids,domains, sortbyDomains=False):
html += f"<td><a class='text-decoration-none' style='color: var(--bs-table-color-state, var(--bs-table-color-type, var(--bs-table-color)));' href='/auction/{domain['name']}'>{renderDomain(domain['name'])}</a></td>"
html += f"<td>{domain['state']}</td>"
html += f"<td>{bidDisplay}</td>"
html += f"<td class='hide-mobile'>{domain['height']:,}</td>"
html += f"<td class='hide-mobile'>{bid['height']:,}</td>"
html += "</tr>"
return html

View File

@@ -1 +1 @@
function createCard(e,n,t){if(document.getElementById(t)&&document.getElementById(t).remove(),n<=0)return;const a=document.createElement("div");a.classList.add("col-md-6","col-xl-3","mb-4"),a.id=t,html=`\n <div class="card shadow border-start-warning py-2">\n <div class="card-body">\n <div class="row align-items-center no-gutters">\n <div class="col me-2">\n <div class="text-uppercase text-warning fw-bold text-xs mb-1"><span>${e}</span></div>\n <div class="text-dark fw-bold h5 mb-0"><span id="${e}">${n}</span></div>\n </div>\n <div class="col"><a class="btn btn-primary" role="button" href="/all/${t.toLowerCase()}">${t} All</a></div>\n <div class="col-auto"><svg class="fa-2x text-gray-300" xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="1em" viewBox="0 0 24 24" width="1em" fill="currentColor">\n <g>\n <rect fill="none" height="24" width="24"></rect>\n </g>\n <g>\n <path d="M12,2C6.48,2,2,6.48,2,12c0,5.52,4.48,10,10,10s10-4.48,10-10C22,6.48,17.52,2,12,2z M7,13.5c-0.83,0-1.5-0.67-1.5-1.5 c0-0.83,0.67-1.5,1.5-1.5s1.5,0.67,1.5,1.5C8.5,12.83,7.83,13.5,7,13.5z M12,13.5c-0.83,0-1.5-0.67-1.5-1.5 c0-0.83,0.67-1.5,1.5-1.5s1.5,0.67,1.5,1.5C13.5,12.83,12.83,13.5,12,13.5z M17,13.5c-0.83,0-1.5-0.67-1.5-1.5 c0-0.83,0.67-1.5,1.5-1.5s1.5,0.67,1.5,1.5C18.5,12.83,17.83,13.5,17,13.5z"></path>\n </g>\n </svg></div>\n </div>\n </div>`,a.innerHTML=html,document.getElementById("actions-row").appendChild(a)}async function updateActions(){const e={Finalize:"Pending Finalizes",Register:"Pending Register",Redeem:"Pending Redeem",Reveal:"Pending Reveal"};for(const n in e){const t=await request(`wallet/pending${n}`);"Error"!=t&&createCard(e[n],t.length,n)}}window.addEventListener("load",(async()=>{updateActions()})),setInterval((async function(){updateActions()}),2e4);
function createCard(e,n,t){if(document.getElementById(t)&&document.getElementById(t).remove(),n<=0)return;const s=document.createElement("div");s.classList.add("col-md-6","col-xl-3","mb-4"),s.id=t,html=`\n <div class="card shadow border-start-warning py-2">\n <div class="card-body">\n <div class="row align-items-center no-gutters">\n <div class="col me-2">\n <div class="text-uppercase text-warning fw-bold text-xs mb-1"><span>${e}</span></div>\n <div class="text-dark fw-bold h5 mb-0"><span id="${e}">${n}</span></div>\n </div>\n <div class="col"><a class="btn btn-primary" role="button" href="/all/${t.toLowerCase()}">${t} All</a></div>\n <div class="col-auto"><svg class="fa-2x text-gray-300" xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="1em" viewBox="0 0 24 24" width="1em" fill="currentColor">\n <g>\n <rect fill="none" height="24" width="24"></rect>\n </g>\n <g>\n <path d="M12,2C6.48,2,2,6.48,2,12c0,5.52,4.48,10,10,10s10-4.48,10-10C22,6.48,17.52,2,12,2z M7,13.5c-0.83,0-1.5-0.67-1.5-1.5 c0-0.83,0.67-1.5,1.5-1.5s1.5,0.67,1.5,1.5C8.5,12.83,7.83,13.5,7,13.5z M12,13.5c-0.83,0-1.5-0.67-1.5-1.5 c0-0.83,0.67-1.5,1.5-1.5s1.5,0.67,1.5,1.5C13.5,12.83,12.83,13.5,12,13.5z M17,13.5c-0.83,0-1.5-0.67-1.5-1.5 c0-0.83,0.67-1.5,1.5-1.5s1.5,0.67,1.5,1.5C18.5,12.83,17.83,13.5,17,13.5z"></path>\n </g>\n </svg></div>\n </div>\n </div>`,s.innerHTML=html,document.getElementById("actions-row").appendChild(s)}async function updateActions(){const e={Finalize:"Pending Finalizes",Register:"Pending Register",Redeem:"Pending Redeem",Reveal:"Pending Reveal"},n=Object.keys(e).map((e=>request(`wallet/pending${e}`).then((n=>({id:e,result:n}))))),t=await Promise.all(n);for(const{id:n,result:s}of t)"Error"!==s&&createCard(e[n],s.length,n);const s=await request("wallet/possibleOutbids");if("Error"===s)return;const d=document.getElementById("outbids");if(d&&d.remove(),s.length<=0)return;const i=document.createElement("div");i.classList.add("col-md-6","col-xl-3","mb-4"),i.id="outbids",i.innerHTML=`\n <div class="card shadow border-start-warning py-2">\n <div class="card-body">\n <div class="row align-items-center no-gutters">\n <div class="col me-2">\n <div class="text-uppercase text-warning fw-bold text-xs mb-1"><span>Names with possible outbids</span></div>\n <div class="text-dark fw-bold h5 mb-0"><span id="outbids-count">${s.length}</span></div>\n </div>\n <div class="col"><a class="btn btn-primary" role="button" href="/auctions?outbids=true">Show All</a></div>\n <div class="col-auto">\n <svg class="fa-2x text-gray-300" xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="1em" viewBox="0 0 24 24" width="1em" fill="currentColor">\n <g><rect fill="none" height="24" width="24"></rect></g>\n <g>\n <path d="M12,2C6.48,2,2,6.48,2,12c0,5.52,4.48,10,10,10s10-4.48,10-10C22,6.48,17.52,2,12,2z M7,13.5c-0.83,0-1.5-0.67-1.5-1.5 c0-0.83,0.67-1.5,1.5-1.5s1.5,0.67,1.5,1.5C8.5,12.83,7.83,13.5,7,13.5z M12,13.5c-0.83,0-1.5-0.67-1.5-1.5 c0-0.83,0.67-1.5,1.5-1.5s1.5,0.67,1.5,1.5C13.5,12.83,12.83,13.5,12,13.5z M17,13.5c-0.83,0-1.5-0.67-1.5-1.5 c0-0.83,0.67-1.5,1.5-1.5s1.5,0.67,1.5,1.5C18.5,12.83,17.83,13.5,17,13.5z"></path>\n </g>\n </svg>\n </div>\n </div>\n </div>\n </div>\n `,document.getElementById("actions-row").appendChild(i)}window.addEventListener("load",(async()=>{updateActions()})),setInterval((async function(){updateActions()}),2e4);