feat: Test running transfer lock
This commit is contained in:
parent
47939cac3d
commit
c00603c020
56
firesales.py
56
firesales.py
@ -28,6 +28,27 @@ functions = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"startListingTransfer": {
|
||||||
|
"name": "Start Listing Transfer",
|
||||||
|
"description": "Start listing transfer. You will need to wait 2 days to send the finalize before listing",
|
||||||
|
"type":"default",
|
||||||
|
"params": {
|
||||||
|
"domain": {
|
||||||
|
"type": "text",
|
||||||
|
"name": "Domain to list"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"returns": {
|
||||||
|
"status": {
|
||||||
|
"type": "text",
|
||||||
|
"name": "Status"
|
||||||
|
},
|
||||||
|
"txid": {
|
||||||
|
"type": "tx",
|
||||||
|
"name": "Transaction ID"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"list": {
|
"list": {
|
||||||
"name": "List",
|
"name": "List",
|
||||||
"description": "List a new domain",
|
"description": "List a new domain",
|
||||||
@ -106,6 +127,41 @@ def init(params, authentication):
|
|||||||
return {"status": "Success"}
|
return {"status": "Success"}
|
||||||
|
|
||||||
|
|
||||||
|
def startListingTransfer(params, authentication):
|
||||||
|
domain = params["domain"]
|
||||||
|
# Generate command
|
||||||
|
wallet = authentication.split(":")[0]
|
||||||
|
passphrase = authentication.split(":")[1]
|
||||||
|
api_key = os.getenv("hsd_api")
|
||||||
|
host = os.getenv("hsd_ip")
|
||||||
|
if host is None:
|
||||||
|
host = "127.0.0.1"
|
||||||
|
|
||||||
|
# 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"{path}/data", "--httphost", host],
|
||||||
|
stdin=subprocess.PIPE,
|
||||||
|
stdout=subprocess.PIPE,
|
||||||
|
stderr=subprocess.PIPE,
|
||||||
|
text=True
|
||||||
|
)
|
||||||
|
|
||||||
|
process.stdin.write('\n') # For yes prompt
|
||||||
|
process.stdin.flush()
|
||||||
|
process.stdin.write(passphrase + '\n') # For passphrase
|
||||||
|
process.stdin.flush()
|
||||||
|
|
||||||
|
stdout, stderr = process.communicate()
|
||||||
|
print(stdout)
|
||||||
|
print(stderr)
|
||||||
|
|
||||||
|
if process.returncode != 0:
|
||||||
|
return {"status": "Error: " + stderr}
|
||||||
|
|
||||||
|
txhash = stdout.split(" hash ")[1].split("\n")[0]
|
||||||
|
|
||||||
|
return {"status": "Success", "txid": txhash}
|
||||||
|
|
||||||
def list(params, authentication):
|
def list(params, authentication):
|
||||||
domain = params["domain"]
|
domain = params["domain"]
|
||||||
price = params["price"]
|
price = params["price"]
|
||||||
|
Loading…
Reference in New Issue
Block a user