mirror of
https://github.com/basicswap/basicswap.git
synced 2025-01-09 12:19:29 +00:00
html: display estimated contract fee on the wallets page..
This commit is contained in:
parent
a1b3aa74a1
commit
95729275b6
3 changed files with 7 additions and 2 deletions
|
@ -77,7 +77,7 @@ chainparams = {
|
|||
'bip44': 1,
|
||||
'min_amount': 1000,
|
||||
'max_amount': 100000 * COIN,
|
||||
'name': 'testnet4',
|
||||
'name': 'testnet3',
|
||||
},
|
||||
'regtest': {
|
||||
'rpcport': 18443,
|
||||
|
|
|
@ -139,12 +139,16 @@ class HttpHandler(BaseHTTPRequestHandler):
|
|||
if 'error' in w:
|
||||
content += '<p>Error: {}</p>'.format(w['error'])
|
||||
|
||||
fee_rate = swap_client.getFeeRateForCoin(k)
|
||||
tx_vsize = swap_client.getContractSpendTxVSize(k)
|
||||
est_fee = (fee_rate * tx_vsize) / 1000
|
||||
content += '<table>' \
|
||||
+ '<tr><td>Balance:</td><td>' + w['balance'] + '</td></tr>' \
|
||||
+ '<tr><td>Blocks:</td><td>' + str(w['blocks']) + '</td></tr>' \
|
||||
+ '<tr><td>Synced:</td><td>' + str(w['synced']) + '</td></tr>' \
|
||||
+ '<tr><td><input type="submit" name="newaddr_' + cid + '" value="Deposit Address"></td><td>' + str(w['deposit_address']) + '</td></tr>' \
|
||||
+ '<tr><td><input type="submit" name="withdraw_' + cid + '" value="Withdraw"></td><td>Amount: <input type="text" name="amt_' + cid + '"></td><td>Address: <input type="text" name="to_' + cid + '"></td><td>Subtract fee: <input type="checkbox" name="subfee_' + cid + '"></td></tr>' \
|
||||
+ '<tr><td>Fee Rate:</td><td>' + format8(fee_rate * COIN) + '</td><td>Est Fee:</td><td>' + format8(est_fee * COIN) + '</td></tr>' \
|
||||
+ '</table>'
|
||||
|
||||
content += '<input type="hidden" name="formid" value="' + os.urandom(8).hex() + '"></form>'
|
||||
|
|
|
@ -373,7 +373,8 @@ def main():
|
|||
'rpcport': 19796 + port_offset,
|
||||
'datadir': os.path.join(data_dir, 'bitcoin'),
|
||||
'bindir': os.path.join(data_dir, 'bin', 'bitcoin'),
|
||||
'use_segwit': True
|
||||
'use_segwit': True,
|
||||
'blocks_confirmed': 1
|
||||
},
|
||||
'namecoin': {
|
||||
'connection_type': 'rpc' if 'namecoin' in with_coins else 'none',
|
||||
|
|
Loading…
Reference in a new issue