feat: Allow multiple networks

This commit is contained in:
Nathan Woodburn 2025-01-30 23:32:37 +11:00
parent 52d9d45106
commit 2bb1fbc3a5
Signed by: nathanwoodburn
GPG Key ID: 203B000478AD0EF1

View File

@ -161,7 +161,7 @@ def startListingTransfer(params, authentication):
# node node_modules/shakedex/bin/shakedex transfer-lock domain -n main -w wallet -a key -p ./data --httphost host
process = subprocess.Popen(
["node", f"{path}/node_modules/shakedex/bin/shakedex", "transfer-lock", domain, "-n", "main", "-w", wallet, "-a", api_key, "-p", f"{userData}", "--httphost", host, "-P", passphrase],
["node", f"{path}/node_modules/shakedex/bin/shakedex", "transfer-lock", domain, "-n", account.HSD_NETWORK, "-w", wallet, "-a", api_key, "-p", f"{userData}", "--httphost", host, "-P", passphrase],
text=True,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT
@ -169,7 +169,9 @@ def startListingTransfer(params, authentication):
# Wait for the process to finish
stdout, stderr = process.communicate()
print(f"STDOUT: {stdout}")
print(f"STDERR: {stderr}")
if stderr is None:
stderr = stdout
if process.returncode != 0:
return {"status": f"Error: {stderr}", "txid": None}
@ -189,7 +191,7 @@ def finalizeListingTransfer(params, authentication):
host = "127.0.0.1"
process = subprocess.Popen(
["node", f"{path}/node_modules/shakedex/bin/shakedex", "finalize-lock", domain, "-n", "main", "-w", wallet, "-a", api_key, "-p", f"{userData}", "--httphost", host, "-P", passphrase],
["node", f"{path}/node_modules/shakedex/bin/shakedex", "finalize-lock", domain, "-n", account.HSD_NETWORK, "-w", wallet, "-a", api_key, "-p", f"{userData}", "--httphost", host, "-P", passphrase],
text=True,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT
@ -197,8 +199,10 @@ def finalizeListingTransfer(params, authentication):
# Wait for the process to finish
stdout, stderr = process.communicate()
print(f"STDOUT: {stdout}")
print(f"STDERR: {stderr}")
if stderr is None:
stderr = stdout
if process.returncode != 0:
return {"status": f"Error: {stderr}", "txid": None}