feat: Add reveal

This commit is contained in:
2023-12-29 14:24:43 +11:00
parent 448f06ad36
commit fa75ea3570
3 changed files with 46 additions and 11 deletions

View File

@@ -221,14 +221,25 @@ def getRevealTX(reveal):
hash = prevout['hash']
index = prevout['index']
tx = hsd.getTxByHash(hash)
revealAddress = tx['outputs'][index]['address']
for input in tx['inputs']:
if input['coin']['address'] == revealAddress:
return input['prevout']['hash']
return False
return tx['inputs'][index]['prevout']['hash']
def revealAuction(account,domain):
account_name = check_account(account)
password = ":".join(account.split(":")[1:])
if account_name == False:
return {
"error": "Invalid account"
}
try:
response = hsw.sendREVEAL(account_name,password,domain)
return response
except Exception as e:
return {
"error": str(e)
}
def rescan_auction(account,domain):
# Get height of the start of the auction