Add address parsing and initiate newtrade from cli
This commit is contained in:
parent
f9e40d7355
commit
0df6fcd04c
3
cli.py
3
cli.py
|
@ -81,4 +81,5 @@ if __name__ == '__main__':
|
|||
erase_trade()
|
||||
role = 'seller'
|
||||
htlcTrade = Trade()
|
||||
print("Creating new XCAT transaction...")
|
||||
print("Creating new XCAT trade...")
|
||||
seller_initiate(htlcTrade)
|
||||
|
|
|
@ -7,7 +7,8 @@ db = plyvel.DB('/tmp/testdb', create_if_missing=True)
|
|||
|
||||
trade = get_trade()
|
||||
## txid we retrieve by
|
||||
txid = trade['sell']['fund_tx']
|
||||
if trade and 'sell' in trade:
|
||||
txid = trade['sell']['fund_tx']
|
||||
|
||||
def create(hexstr):
|
||||
trade = hex2dict(hexstr)
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
from utils import *
|
||||
|
||||
def get_trade_amounts():
|
||||
print("in user input")
|
||||
amounts = {}
|
||||
sell_currency = input("Which currency would you like to trade out of (bitcoin or zcash)? ")
|
||||
if sell_currency == '':
|
||||
|
|
8
utils.py
8
utils.py
|
@ -66,8 +66,12 @@ def get_secret():
|
|||
return line.strip('\n')
|
||||
|
||||
def save_secret(secret):
|
||||
with open('secret.json', 'w') as outfile:
|
||||
outfile.write(secret)
|
||||
try:
|
||||
with open('secret.json', 'w') as outfile:
|
||||
outfile.write(secret)
|
||||
except IOError:
|
||||
with open('secret.json', 'w+') as outfile:
|
||||
outfile.write(secret)
|
||||
|
||||
def save(trade):
|
||||
print("Saving trade")
|
||||
|
|
Loading…
Reference in New Issue