fix: Paths and fix xpub check

This commit is contained in:
Nathan Woodburn 2025-01-29 12:50:15 +11:00
parent 8abcf48ee3
commit 52e248dfb3
Signed by: nathanwoodburn
GPG Key ID: 203B000478AD0EF1

View File

@ -70,7 +70,7 @@ functions = {
def initialize():
# Check if hns-address is installed
if not os.path.exists("hns-address"):
if not os.path.exists(hnsAddressPath):
# Try to install hns-address
try:
print("Cloning hns-address...")
@ -81,7 +81,7 @@ def initialize():
return -1
# Check if npm install was successful
if not os.path.exists("hns-address/node_modules"):
if not os.path.exists(f"{hnsAddressPath}/node_modules"):
try:
print("Installing hns-address dependencies...")
result = subprocess.run(["npm", "install"], cwd=hnsAddressPath, capture_output=True, text=True)
@ -107,7 +107,7 @@ def generate(params, authentication):
if (startIndex == None):
startIndex = 0
if (xpub == None):
if (xpub == ""):
xpub = account.getxPub(authentication)
if (xpub == None):
return {"result": "No xpub found"}
@ -126,9 +126,8 @@ def validate(params, authentication):
xpub = params["xpub"]
address = params["address"]
if (xpub == None):
if (xpub == ""):
xpub = account.getxPub(authentication)
print(f"xpub: {xpub}")
if (xpub == None):
return {"result": "No xpub found"}