Add findtrade by txid

This commit is contained in:
Jay Graber 2017-07-24 13:40:10 -07:00
parent 572de939b4
commit 6861e73472
2 changed files with 9 additions and 3 deletions

6
cli.py
View File

@ -47,6 +47,7 @@ if __name__ == '__main__':
checktrades - check for actions to be taken on existing trades
importtrade "hexstr" - import an existing trade from a hex string
exporttrade - export the data of an existing xcat trade as a hex string
findtrade - find a trade by the txid of the currency being traded out of
'''))
parser.add_argument("command", action="store", help="list commands")
@ -86,3 +87,8 @@ if __name__ == '__main__':
elif command == "daemon":
#TODO: implement
print("Run as daemon process")
elif command == "findtrade":
print("Finding trade")
txid = args.argument[0]
trade = db.get(txid)
print(x2s(b2x(trade)))

View File

@ -37,7 +37,7 @@ def print_entries():
print('sell: ', j['sell'])
# print_entries()
txid = '1171aeda64eff388b3568fa4675d0ca78852911109bbe42e0ef11ad6bf1b159e'
entry = db.get(b(txid))
print(entry)
# txid = '1171aeda64eff388b3568fa4675d0ca78852911109bbe42e0ef11ad6bf1b159e'
# entry = db.get(b(txid))
# print(entry)
# print(it.next())