mirror of
https://github.com/basicswap/basicswap.git
synced 2025-01-08 19:59:33 +00:00
Add subfee option to wallets page.
This commit is contained in:
parent
521e465c2a
commit
c9954bef1a
2 changed files with 6 additions and 5 deletions
|
@ -802,9 +802,9 @@ class BasicSwap():
|
|||
ticker = 'rt' + ticker
|
||||
return ticker
|
||||
|
||||
def withdrawCoin(self, coin_type, value, addr_to):
|
||||
self.log.info('withdrawCoin %s %s to %s', value, self.getTicker(coin_type), addr_to)
|
||||
return self.callcoinrpc(coin_type, 'sendtoaddress', [addr_to, value])
|
||||
def withdrawCoin(self, coin_type, value, addr_to, subfee):
|
||||
self.log.info('withdrawCoin %s %s to %s %s', value, self.getTicker(coin_type), addr_to, ' subfee' if subfee else '')
|
||||
return self.callcoinrpc(coin_type, 'sendtoaddress', [addr_to, value, '', '', subfee])
|
||||
|
||||
def cacheNewAddressForCoin(self, coin_type):
|
||||
self.log.debug('cacheNewAddressForCoin %s', coin_type)
|
||||
|
|
|
@ -119,7 +119,8 @@ class HttpHandler(BaseHTTPRequestHandler):
|
|||
if bytes('withdraw_' + cid, 'utf-8') in form_data:
|
||||
value = form_data[bytes('amt_' + cid, 'utf-8')][0].decode('utf-8')
|
||||
address = form_data[bytes('to_' + cid, 'utf-8')][0].decode('utf-8')
|
||||
txid = swap_client.withdrawCoin(c, value, address)
|
||||
subfee = True if bytes('subfee_' + cid, 'utf-8') in form_data else False
|
||||
txid = swap_client.withdrawCoin(c, value, address, subfee)
|
||||
ticker = swap_client.getTicker(c)
|
||||
content += '<p>Withdrew {} {} to address {}<br/>In txid: {}</p>'.format(value, ticker, address, txid)
|
||||
|
||||
|
@ -134,7 +135,7 @@ class HttpHandler(BaseHTTPRequestHandler):
|
|||
+ '<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></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>' \
|
||||
+ '</table>'
|
||||
|
||||
content += '<input type="hidden" name="formid" value="' + os.urandom(8).hex() + '"></form>'
|
||||
|
|
Loading…
Reference in a new issue