You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

234 lines
8.2 KiB

- var fontawesomeInputName = "sign-in-alt";
- var fontawesomeOutputName = "sign-out-alt";
- var totalIOValues = utils.getTxTotalInputOutputValues(tx, txInputs, blockHeight);
script.
function showAllTxOutputs(link, txid) {
var hiddenRows = document.querySelectorAll("[data-txid='" + txid + "']");
hiddenRows.forEach(function(hiddenRow) {
hiddenRow.classList.remove("d-none");
});
link.classList.add("d-none");
}
div.row.text-monospace
div.col-lg-6
if (txInputs)
- var extraInputCount = 0;
each txVin, txVinIndex in tx.vin
if (!txVin.coinbase)
- var vout = null;
if (txInputs && txInputs[txVinIndex])
- var txInput = txInputs[txVinIndex];
- var vout = txInput;
if (txVin.coinbase || vout)
div.clearfix
div.tx-io-label
a(data-toggle="tooltip", title=("Input #" + txVinIndex.toLocaleString()), style="white-space: nowrap;")
span.font-weight-bold >
small.d-inline.d-md-none Input
if (tx.vin.length > 999)
small.word-wrap ##{txVinIndex}
else
span ##{txVinIndex.toLocaleString()}
if (tx.vin.length > 0)
small.d-inline.d-md-none.font-weight-light.text-muted / #{(tx.vin.length - 1).toLocaleString()}
div.tx-io-content
div.clearfix
div.tx-io-desc
if (txVin.coinbase)
small.data-tag.bg-primary.mr-2 coinbase
span Newly minted coins
else
div.word-wrap
small.data-tag.bg-dark.mr-2
span(title=`Input Type: ${utils.outputTypeName(vout.scriptPubKey.type)}`, data-toggle="tooltip") #{utils.outputTypeAbbreviation(vout.scriptPubKey.type)}
a(href=("/tx/" + txInput.txid + "#output-" + txVin.vout)) #{utils.ellipsize(txInput.txid, 26)}
span ##{txVin.vout}
if (vout && vout.scriptPubKey && vout.scriptPubKey.addresses)
div.word-wrap
small.text-muted
span.mr-1 (addr:
a(href=("/address/" + vout.scriptPubKey.addresses[0]), class=(txIOHighlightAddress == vout.scriptPubKey.addresses[0] ? "font-weight-bold" : null)) #{vout.scriptPubKey.addresses[0]}
if (global.specialAddresses[vout.scriptPubKey.addresses[0]])
- var specialAddressInfo = global.specialAddresses[vout.scriptPubKey.addresses[0]];
if (specialAddressInfo.type == "minerPayout")
span
a(data-toggle="tooltip", title=("Miner payout address: " + specialAddressInfo.minerInfo.name))
i.fas.fa-certificate.text-primary
span )
if (false)
small
span.border-dotted(title="Transaction output", data-toggle="tooltip") txo
span.mr-1 :
a(href=("/tx/" + txInput.txid + "#output-" + txVin.vout)) #{utils.ellipsize(txInput.txid, 20)}[#{txVin.vout}]
else
div.tx-io-value
if (txVin.coinbase)
- var currencyValue = coinConfig.blockRewardFunction(blockHeight, global.activeBlockchain);
include ./value-display.pug
else
if (vout && vout.value)
- var currencyValue = vout.value;
include ./value-display.pug
hr
else
- extraInputCount = extraInputCount + 1;
if (extraInputCount > 0)
div.clearfix
div.tx-io-label
a(data-toggle="tooltip", title=("Input #" + (tx.vin.length - extraInputCount + 1).toLocaleString() + " - " + tx.vin.length.toLocaleString()), style="white-space: nowrap;")
span.font-weight-bold >
span.d-inline.d-md-none Input
span #…
div.tx-io-content
div.clearfix
div.tx-io-desc
span.text-reset #{extraInputCount.toLocaleString()} more input
if (extraInputCount > 1)
span s
br
small.text-muted (see
a(href=("/tx/" + tx.txid)) transaction page
span for details)
div.tx-io-value
- var currencyValue = new Decimal(totalIOValues.output).minus(new Decimal(totalIOValues.input));
include ./value-display.pug
hr
div.row.mb-5.mb-lg-0
div.col
div.font-weight-bold.text-left.text-md-right
span.d-block.d-md-none Total Input:
- var currencyValue = totalIOValues.input;
include ./value-display.pug
div.col-lg-6
- var maxRegularRowCount = (txIOHighlightAddress != null ? config.site.addressPage.txOutputMaxDefaultDisplay : 10000000);
- var regularRowCount = 0;
- var hiddenRowCount = 0;
each vout, voutIndex in tx.vout
- var highlightRow = false;
if (txIOHighlightAddress != null && vout.scriptPubKey && vout.scriptPubKey.addresses && vout.scriptPubKey.addresses[0] == txIOHighlightAddress)
- highlightRow = true;
if (!highlightRow)
- regularRowCount++;
- var hiddenRow = false;
if (!highlightRow && regularRowCount > maxRegularRowCount)
- hiddenRow = true;
- hiddenRowCount++;
div(data-txid=tx.txid, class=(hiddenRow ? "d-none" : ""))
div.clearfix
div.tx-io-label
a(data-toggle="tooltip", title=("Output #" + voutIndex.toLocaleString()), style="white-space: nowrap;")
span.font-weight-bold <
small.d-inline.d-md-none Output
if (tx.vout.length > 999)
small.word-wrap ##{voutIndex}
else
span ##{voutIndex.toLocaleString()}
if (tx.vout.length > 0)
small.d-inline.d-md-none.font-weight-light.text-muted / #{(tx.vout.length - 1).toLocaleString()}
div.tx-io-content
div.clearfix
div.tx-io-desc
if (vout.scriptPubKey)
if (vout.scriptPubKey.addresses)
if (true)
div.mb-tiny
small.data-tag.bg-dark
span(title=`Output Type: ${utils.outputTypeName(vout.scriptPubKey.type)}`, data-toggle="tooltip") #{utils.outputTypeAbbreviation(vout.scriptPubKey.type)}
each addr in vout.scriptPubKey.addresses
a(id=("output-" + voutIndex), href=("/address/" + addr))
span.text-monospace.word-wrap(class=(highlightRow ? "font-weight-bold" : "")) #{addr}
if (global.specialAddresses[addr])
- var specialAddressInfo = global.specialAddresses[addr];
if (specialAddressInfo.type == "minerPayout")
span
a(data-toggle="tooltip", title=("Miner payout address: " + specialAddressInfo.minerInfo.name))
i.fas.fa-certificate.text-primary
br
else if (vout.scriptPubKey.hex && vout.scriptPubKey.hex.startsWith('6a24aa21a9ed'))
div.mb-tiny
small.data-tag.bg-primary OP_RETURN
small.text-muted (SegWit committment -
a(href="https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki#commitment-structure", data-toggle="tooltip", title="View developer docs", target="_blank") about
span )
else if (vout.scriptPubKey.asm && vout.scriptPubKey.asm.startsWith('OP_RETURN '))
div.mb-tiny
small.data-tag.bg-primary OP_RETURN
small #{utils.hex2ascii(vout.scriptPubKey.asm.substring("OP_RETURN ".length))}
else
div.mb-tiny
small.data-tag.bg-dark
span(title=`Output Type: ${utils.outputTypeName(vout.scriptPubKey.type)}`, data-toggle="tooltip") #{utils.outputTypeAbbreviation(vout.scriptPubKey.type)}
span
small.font-weight-bold asm:
small #{vout.scriptPubKey.asm}
br
small.font-weight-bold hex:
small #{vout.scriptPubKey.hex}
div.tx-io-value
if (utxos)
if (utxos[voutIndex])
i.fas.fa-lock.text-success.mr-2(title="Unspent output." data-toggle="tooltip")
else if (utxos[voutIndex] == null)
i.fas.fa-lock-open.text-secondary.mr-2(title="Spent output." data-toggle="tooltip")
- var currencyValue = vout.value;
include ./value-display.pug
hr
if (hiddenRowCount > 0)
a(href="javascript:void(0)", onclick=("showAllTxOutputs(this, '" + tx.txid + "');")) Show all #{tx.vout.length.toLocaleString()} outputs
div.row.mb-0.mb-lg-0
div.col
div.font-weight-bold.text-left.text-md-right
span.d-block.d-md-none Total Output:
- var currencyValue = totalIOValues.output;
include ./value-display.pug