Dynamic fee selection.

Display xmr offer fees.
Display bid events.
html create offer uses correct coin amount scales.
This commit is contained in:
tecnovert
2020-12-08 20:23:00 +02:00
parent 2346858145
commit 3c4c2c528f
7 changed files with 93 additions and 23 deletions

View File

@@ -25,17 +25,17 @@ from .basicswap import (
PAGE_LIMIT = 50
def validateAmountString(amount):
def validateAmountString(amount, ci):
if type(amount) != str:
return
ar = amount.split('.')
if len(ar) > 1 and len(ar[1]) > 8:
if len(ar) > 1 and len(ar[1]) > ci.exp():
raise ValueError('Too many decimal places in amount {}'.format(amount))
def inputAmount(amount_str):
validateAmountString(amount_str)
return make_int(amount_str)
def inputAmount(amount_str, ci):
validateAmountString(amount_str, ci)
return make_int(amount_str, ci.exp())
def setCoinFilter(form_data, field_name):
@@ -169,4 +169,7 @@ def describeBid(swap_client, bid, offer, edit_bid, show_txns):
data['initiate_tx_spend'] = getTxSpendHex(bid, TxTypes.ITX)
data['participate_tx_spend'] = getTxSpendHex(bid, TxTypes.PTX)
if offer.swap_type == SwapTypes.XMR_SWAP:
data['events'] = swap_client.list_bid_events(bid.bid_id)
return data