scripts: Set offer min_bid_amount from offer template min_swap_amount value.

This commit is contained in:
tecnovert
2024-06-04 13:45:52 +02:00
parent 80852fd0ea
commit 3e4c3f10cf
4 changed files with 12 additions and 5 deletions

View File

@@ -228,6 +228,7 @@ def js_offers(self, url_split, post_string, is_json, sent=False) -> bytes:
'amount_from': ci_from.format_amount(o.amount_from),
'amount_to': ci_to.format_amount((o.amount_from * o.rate) // ci_from.COIN()),
'rate': ci_to.format_amount(o.rate),
'min_bid_amount': ci_from.format_amount(o.min_bid_amount),
}
if with_extra_info:
offer_data['amount_negotiable'] = o.amount_negotiable

View File

@@ -115,7 +115,7 @@ def parseOfferFormData(swap_client, form_data, page_data, options={}):
errors.append('Amount From')
try:
if 'amt_bid_min' not in page_data:
if have_data_entry(form_data, 'amt_bid_min') is False:
if options.get('add_min_bid_amt', False) is True:
parsed_data['amt_bid_min'] = ci_from.chainparams_network()['min_amount']
else: