2019-07-26 20:15:53 +00:00
{% include 'header.html' %}
< h3 > Offer {{ offer_id }}< / h3 >
{% if refresh %}
2022-06-16 21:29:57 +00:00
< p > < a href = /offer/{{ offer_id } } > Page Refresh: {{ refresh }} second< / a > < / p >
{% else %}
< p > < a href = /offer/{{ offer_id } } > refresh< / a > < / p >
2019-07-26 20:15:53 +00:00
{% endif %}
{% for m in messages %}
< p > {{ m }}< / p >
{% endfor %}
2022-07-31 21:40:58 +00:00
{% for m in err_messages %}
< p class = "error_msg" > Error: {{ m }}< / p >
{% endfor %}
2019-07-26 20:15:53 +00:00
{% if sent_bid_id %}
< p > < a href = "/bid/{{ sent_bid_id }}" > Sent Bid {{ sent_bid_id }}< / a > < / p >
{% endif %}
< table >
< tr > < td > Offer State< / td > < td > {{ data.state }}< / td > < / tr >
< tr > < td > Coin From< / td > < td > {{ data.coin_from }}< / td > < / tr >
< tr > < td > Coin To< / td > < td > {{ data.coin_to }}< / td > < / tr >
< tr > < td > Amount From< / td > < td > {{ data.amt_from }} {{ data.tla_from }}< / td > < / tr >
< tr > < td > Amount To< / td > < td > {{ data.amt_to }} {{ data.tla_to }}< / td > < / tr >
2022-07-31 21:40:58 +00:00
< tr > < td > Minimum Bid Amount< / td > < td > {{ data.amt_bid_min }} {{ data.tla_from }}< / td > < / tr >
2021-11-15 08:48:43 +00:00
< tr > < td > Rate< / td > < td > {{ data.rate }}< / td > < / tr >
2022-06-15 22:19:06 +00:00
< tr > < td title = "Total coin-from value of completed bids, that this node is involved in" > Amount Swapped< / td > < td > {{ data.amt_swapped }} {{ data.tla_from }}< / td > < / tr >
< tr > < td title = "If bids can be sent with a different amount" > Amount Variable< / td > < td > {{ data.amount_negotiable }}< / td > < / tr >
< tr > < td title = "If bids can be sent with a different amount" > Rate Variable< / td > < td > {{ data.rate_negotiable }}< / td > < / tr >
2019-07-26 20:15:53 +00:00
< tr > < td > Script Lock Type< / td > < td > {{ data.lock_type }}< / td > < / tr >
2021-12-15 13:41:43 +00:00
< tr > < td > Script Lock Value< / td > < td > {{ data.lock_value }} {{ data.lock_value_hr }}< / td > < / tr >
2021-12-05 23:06:34 +00:00
{% if data.addr_to == "Public" %}
2021-10-20 17:47:49 +00:00
< tr > < td > Address To< / td > < td > {{ data.addr_to }}< / td > < / tr >
2021-12-05 23:06:34 +00:00
{% else %}
< tr > < td > Address To< / td > < td > < a class = "monospace" href = "/identity/{{ data.addr_to }}" > {{ data.addr_to }}< / a > {{ data.addr_to_label }}< / td > < / tr >
{% endif %}
< tr > < td > Address From< / td > < td > < a class = "monospace" href = "/identity/{{ data.addr_from }}" > {{ data.addr_from }}< / a > {{ data.addr_from_label }}< / td > < / tr >
2019-07-26 20:15:53 +00:00
< tr > < td > Created At< / td > < td > {{ data.created_at | formatts }}< / td > < / tr >
< tr > < td > Expired At< / td > < td > {{ data.expired_at | formatts }}< / td > < / tr >
< tr > < td > Sent< / td > < td > {{ data.sent }}< / td > < / tr >
2020-12-11 07:11:35 +00:00
< tr > < td > Revoked< / td > < td > {{ data.was_revoked }}< / td > < / tr >
2019-07-26 20:15:53 +00:00
{% if data.sent == 'True' %}
2022-05-31 22:38:50 +00:00
< tr > < td > Auto Accept Strategy< / td >
< td >
{% if data.automation_strat_id == -1 %}
None
{% else %}
< a class = "monospace" href = "/automationstrategy/{{ data.automation_strat_id }}" > {{ data.automation_strat_label }}< / a >
{% endif %}
< / td > < / tr >
2019-07-26 20:15:53 +00:00
{% endif %}
2020-12-08 18:23:00 +00:00
{% if data.xmr_type == true %}
< tr > < td > Chain A offer fee rate< / td > < td > {{ data.a_fee_rate }}< / td > < / tr >
2020-12-16 21:19:39 +00:00
< tr > < td > Chain A local fee rate< / td > < td > {{ data.a_fee_rate_verify }}, fee source: {{ data.a_fee_rate_verify_src }} {% if data.a_fee_warn == true %} WARNING {% endif %}< / td > < / tr >
2020-12-08 18:23:00 +00:00
{% endif %}
2019-07-26 20:15:53 +00:00
< / table >
2019-07-28 19:57:20 +00:00
< form method = "post" >
{% if data.show_bid_form %}
< br / > < h4 > New Bid< / h4 >
2021-11-22 20:24:48 +00:00
< p > You will send < span id = "bid_amt_to" > {{ data.amt_to }}< / span > {{ data.tla_to }} and receive < span id = "bid_amt_from" > {{ data.amt_from }}< / span > {{ data.tla_from }}
2021-01-19 23:28:29 +00:00
{% if data.xmr_type == true %}
(excluding {{ data.amt_from_lock_spend_tx_fee }} {{ data.tla_from }} in tx fees).
{% else %}
(excluding a tx fee).
{% endif %}
< / p >
2019-07-28 19:57:20 +00:00
< table >
< tr > < td > Send From Address< / td > < td >
< select name = "addr_from" >
{% for a in addrs %}
2021-12-05 23:06:34 +00:00
< option value = "{{ a[0] }}" { % if data . nb_addr_from = =a[0] % } selected { % endif % } > {{ a[0] }} {{ a[1] }}< / option >
2019-07-28 19:57:20 +00:00
{% endfor %}
2021-02-15 13:34:47 +00:00
< option value = "-1" { % if data . nb_addr_from = ="-1" % } selected { % endif % } > -- New Address --< / option >
2019-07-28 19:57:20 +00:00
< / select >
< / td > < / tr >
2021-11-21 20:59:39 +00:00
{% if data.amount_negotiable == true %}
2021-11-22 20:24:48 +00:00
< tr > < td > Amount< / td > < td > < input type = "text" id = "bid_amount" name = "bid_amount" value = "{{ data.bid_amount }}" onchange = "updateBidParams('amount');" > < / td > < / tr >
2021-11-21 20:59:39 +00:00
{% endif %}
{% if data.rate_negotiable == true %}
2021-11-22 20:24:48 +00:00
< tr > < td > Rate< / td > < td > < input type = "text" id = "bid_rate" name = "bid_rate" value = "{{ data.bid_rate }}" onchange = "updateBidParams('rate');" > < / td > < / tr >
2021-11-21 20:59:39 +00:00
{% endif %}
< tr > < td > Minutes valid< / td > < td > < input type = "number" name = "validmins" min = "10" max = "1440" value = "{{ data.nb_validmins }}" > < / td > < / tr >
2021-11-26 22:05:04 +00:00
{% if data.debug_ui == true %}
< tr > < td > Debug Option< / td > < td > < select name = "debugind" >
< option { % if data . debug_ind = ="-1" % } selected { % endif % } value = "-1" > -- None --< / option >
{% for a in data.debug_options %}
< option { % if data . debug_ind = =a[0] % } selected { % endif % } value = "{{ a[0] }}" > {{ a[1] }}< / option >
{% endfor %}
< / select > < / td > < / tr >
{% endif %}
2021-11-22 20:24:48 +00:00
< tr > < td >
< input type = "submit" name = "sendbid" value = "Send Bid" >
< input type = "submit" name = "cancel" value = "Cancel" >
< input name = "check_rates" type = "button" value = "Lookup Rates" onclick = 'lookup_rates();' >
< / td > < / tr >
2019-07-28 19:57:20 +00:00
< / table >
{% else %}
< input type = "submit" name = "newbid" value = "New Bid" >
2020-12-16 21:19:39 +00:00
{% if data.sent == 'True' and data.was_revoked != true %}
2021-11-01 15:33:51 +00:00
< input name = "revoke_offer" type = "submit" value = "Revoke Offer" onclick = "return confirmPopup();" >
2020-12-11 07:11:35 +00:00
{% endif %}
2021-11-22 20:24:48 +00:00
< input name = "check_rates" type = "button" value = "Lookup Rates" onclick = 'lookup_rates();' >
2020-12-17 13:52:39 +00:00
{% endif %}
2021-11-22 20:24:48 +00:00
< input type = "hidden" id = "coin_from" value = "{{ data.coin_from_ind }}" >
< input type = "hidden" id = "coin_to" value = "{{ data.coin_to_ind }}" >
< input type = "hidden" id = "amt_var" value = "{{ data.amount_negotiable }}" >
< input type = "hidden" id = "rate_var" value = "{{ data.rate_negotiable }}" >
< input type = "hidden" id = "amount_from" value = "{{ data.amt_from }}" >
< input type = "hidden" id = "offer_rate" value = "{{ data.rate }}" >
2019-07-28 19:57:20 +00:00
< input type = "hidden" name = "formid" value = "{{ form_id }}" >
< / form >
2021-11-22 20:24:48 +00:00
< p id = "rates_display" > < / p >
2019-07-26 20:15:53 +00:00
< h4 > Bids< / h4 >
< table >
2021-11-14 23:26:43 +00:00
< tr > < th > Bid ID< / th > < th > Bid Amount< / th > < th > Bid Rate< / th > < th > Bid Status< / th > < th > Identity From< / th > < / tr >
2019-07-26 20:15:53 +00:00
{% for b in bids %}
2021-11-14 23:26:43 +00:00
< tr > < td > < a class = "monospace" href = /bid/{{ b [ 0 ] } } > {{ b[0] }}< / a > < / td > < td > {{ b[1] }}< / td > < td > {{ b[3] }}< / td > < td > {{ b[2] }}< / td > < td > < a class = "monospace" href = /identity/{{ b [ 4 ] } } > {{ b[4] }}< / a > < / td > < / tr >
2019-07-26 20:15:53 +00:00
{% endfor %}
< / table >
< p > < a href = "/" > home< / a > < / p >
2020-12-11 07:11:35 +00:00
< script >
2021-11-22 20:24:48 +00:00
const xhr_rates = new XMLHttpRequest();
xhr_rates.onload = () => {
if (xhr_rates.status == 200) {
const obj = JSON.parse(xhr_rates.response);
inner_html = '< h4 > Rates< / h4 > < pre > < code > ' + JSON.stringify(obj, null, ' ') + '< / code > < / pre > ';
document.getElementById('rates_display').innerHTML = inner_html;
}
}
function lookup_rates() {
const coin_from = document.getElementById('coin_from').value;
const coin_to = document.getElementById('coin_to').value;
if (coin_from == '-1' || coin_to == '-1') {
alert('Coins from and to must be set first.');
return;
}
inner_html = '< h4 > Rates< / h4 > < p > Updating...< / p > ';
document.getElementById('rates_display').innerHTML = inner_html;
xhr_rates.open('POST', '/json/rates');
xhr_rates.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
xhr_rates.send('coin_from='+coin_from+'&coin_to='+coin_to);
}
const xhr_bid_params = new XMLHttpRequest();
xhr_bid_params.onload = () => {
if (xhr_bid_params.status == 200) {
const obj = JSON.parse(xhr_bid_params.response);
document.getElementById('bid_amt_to').innerHTML = obj['amount_to'];
}
}
function updateBidParams(value_changed) {
const coin_from = document.getElementById('coin_from').value;
const coin_to = document.getElementById('coin_to').value;
const amt_var = document.getElementById('amt_var').value;
const rate_var = document.getElementById('rate_var').value;
let amt_from = '';
let rate = '';
2022-07-28 22:47:32 +00:00
if (amt_var == 'True') {
2021-11-22 20:24:48 +00:00
amt_from = document.getElementById('bid_amount').value;
} else {
amt_from = document.getElementById('amount_from').value;
}
2022-07-28 22:47:32 +00:00
if (rate_var == 'True') {
2021-11-22 20:24:48 +00:00
rate = document.getElementById('bid_rate').value;
} else {
rate = document.getElementById('offer_rate').value;
}
if (value_changed == 'amount') {
document.getElementById('bid_amt_from').innerHTML = amt_from;
}
xhr_bid_params.open('POST', '/json/rate');
xhr_bid_params.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
xhr_bid_params.send('coin_from='+coin_from+'&coin_to='+coin_to+'&rate='+rate+'&amt_from='+amt_from);
}
2020-12-11 07:11:35 +00:00
function confirmPopup() {
2021-11-01 15:33:51 +00:00
return confirm("Are you sure?");
2020-12-11 07:11:35 +00:00
}
2021-11-22 20:24:48 +00:00
2020-12-11 07:11:35 +00:00
< / script >
2019-07-26 20:15:53 +00:00
< / body > < / html >