extends layout block headContent title Transaction #{txid} style. .field { word-wrap: break-word; } block content if (result && result.getrawtransaction) h1(class="h3 word-wrap") Transaction br small(class="monospace") #{txid} hr ul(class='nav nav-tabs mb-3') li(class="nav-item") a(data-toggle="tab", href="#tab-details", class="nav-link active", role="tab") Details li(class="nav-item") a(data-toggle="tab", href="#tab-scripts", class="nav-link", role="tab") Scripts li(class="nav-item") a(data-toggle="tab", href="#tab-raw", class="nav-link", role="tab") Raw - DecimalRounded = Decimal.clone({ precision: 4, rounding: 2 }) - var totalInputValue = new Decimal(0); if (result.getrawtransaction.vin[0].coinbase) - totalInputValue = totalInputValue.plus(new Decimal(coinConfig.blockRewardFunction(result.getblock.height))); each txInput, txInputIndex in result.txInputs if (txInput) - var vout = txInput.vout[result.getrawtransaction.vin[txInputIndex].vout]; if (vout.value) - totalInputValue = totalInputValue.plus(new Decimal(vout.value)); - var totalOutputValue = new Decimal(0); each vout, voutIndex in result.getrawtransaction.vout - totalOutputValue = totalOutputValue.plus(new Decimal(vout.value)); div(class="tab-content") div(id="tab-details", class="tab-pane active", role="tabpanel") if (global.specialTransactions && global.specialTransactions[txid]) div(class="alert alert-primary", style="padding-bottom: 0;") div(class="float-left", style="width: 50px; height: 50px; font-size: 18px;") i(class="fas fa-certificate fa-2x", style="margin-top: 10px;") h4(class="alert-heading h5") #{coinConfig.name} Fun // special transaction info - var stInfo = global.specialTransactions[txid]; if (stInfo.alertBodyHtml) p span !{stInfo.alertBodyHtml} if (stInfo.referenceUrl && stInfo.referenceUrl.trim().length > 0 && stInfo.alertBodyHtml.indexOf(stInfo.referenceUrl) == -1) span a(href=stInfo.referenceUrl) Read more else p span #{stInfo.summary} if (stInfo.referenceUrl && stInfo.referenceUrl.trim().length > 0) span a(href=stInfo.referenceUrl) Read more div(class="card mb-3") div(class="card-header") span(class="h6") Summary div(class="card-body") table(class="table details-table mb-0") tr td(class="properties-header") Included in Block td(class="monospace word-wrap") if (result.getblock) a(href=("/block/" + result.getrawtransaction.blockhash)) #{result.getrawtransaction.blockhash} if (result.getblock.height) br span(class="text-muted") (#{result.getblock.height.toLocaleString()}) else span N/A span(class="text-muted") (unconfirmed) tr td(class="properties-header") Timestamp if (result.getrawtransaction.time) td(class="monospace") #{moment.utc(new Date(result.getrawtransaction["time"] * 1000)).format("Y-MM-DD HH:mm:ss")} utc - var timeAgo = moment.duration(moment.utc(new Date()).diff(moment.utc(new Date(parseInt(result.getrawtransaction["time"]) * 1000)))); br span(class="text-muted") (#{timeAgo.format()}) else td(class="monospace") N/A span(class="text-muted") (unconfirmed) //tr // th(class="table-active properties-header") Transaction ID // td #{txid} tr td(class="properties-header") Version td(class="monospace") #{result.getrawtransaction.version} tr td(class="properties-header") Size td(class="monospace") span #{result.getrawtransaction.size.toLocaleString()} bytes if (result.getrawtransaction.vsize != result.getrawtransaction.size) span ( a(href="https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki#Transaction_size_calculations") virtual size span : #{result.getrawtransaction.vsize.toLocaleString()} bytes) if (result.getrawtransaction.locktime > 0) tr td(class="properties-header") Locktime td(class="monospace") if (result.getrawtransaction.locktime < 500000000) span Spendable in block a(href=("/block-height/" + result.getrawtransaction.locktime)) #{result.getrawtransaction.locktime} span or later a(href="https://bitcoin.org/en/developer-guide#locktime-and-sequence-number", data-toggle="tooltip", title="More info about locktime", target="_blank") i(class="fas fa-info-circle") else span Spendable after #{moment.utc(new Date(result.getrawtransaction.locktime * 1000)).format("Y-MM-DD HH:mm:ss")} (utc) a(href="https://bitcoin.org/en/developer-guide#locktime-and-sequence-number", data-toggle="tooltip", title="More info about locktime", target="_blank") i(class="fas fa-info-circle") tr td(class="properties-header") Confirmations td(class="monospace") if (!result.getrawtransaction.confirmations || result.getrawtransaction.confirmations == 0) strong(class="text-danger") 0 (unconfirmed) else if (result.getrawtransaction.confirmations < 6) strong(class="text-warning") #{result.getrawtransaction.confirmations} else strong(class="text-success") #{result.getrawtransaction.confirmations.toLocaleString()} if (result.getrawtransaction.vin[0].coinbase) tr td(class="properties-header") Fees Collected td - var currencyValue = new Decimal(totalOutputValue).minus(totalInputValue); include includes/value-display.pug - var blockRewardMax = coinConfig.blockRewardFunction(result.getblock.height); if (totalOutputValue < blockRewardMax) tr td(class="properties-header") Fees Destroyed td(class="text-danger") - var currencyValue = new Decimal(blockRewardMax).minus(totalOutputValue); include includes/value-display.pug a(class="ml-2", data-toggle="tooltip", title="The miner of this block failed to collect this value. As a result, it is lost.") i(class="fas fa-info-circle") else tr td(class="properties-header") Fee Paid td(class="monospace") strong - var currencyValue = new Decimal(totalInputValue).minus(totalOutputValue); include includes/value-display.pug br span(class="text-muted") (#{utils.formatCurrencyAmount(totalInputValue, currencyFormatType)} - #{utils.formatCurrencyAmount(totalOutputValue, currencyFormatType)}) br span ~#{utils.addThousandsSeparators(new DecimalRounded(totalInputValue).minus(totalOutputValue).dividedBy(result.getrawtransaction.size).times(100000000))} sat/B if (result.getrawtransaction.vin[0].coinbase) div(class="card mb-3") div(class="card-header") h2(class="h6 mb-0") Coinbase div(class="card-body") h6 Hex div(style="background-color: #f0f0f0; padding: 5px 10px;", class="mb-3") span(class="monospace word-wrap") #{result.getrawtransaction.vin[0].coinbase} h6 Decoded div(style="background-color: #f0f0f0; padding: 5px 10px;", class="mb-3") span(class="monospace word-wrap") #{utils.hex2ascii(result.getrawtransaction.vin[0].coinbase)} - var fontawesomeInputName = "arrow-down"; - var fontawesomeOutputName = "arrow-up"; div(class="card mb-3") div(class="card-header") h2(class="h6 mb-0") span #{result.getrawtransaction.vin.length.toLocaleString()} if (result.getrawtransaction.vin.length == 1) span Input else span Inputs span , span #{result.getrawtransaction.vout.length.toLocaleString()} if (result.getrawtransaction.vout.length == 1) span Output else span Outputs div(class="card-body") div(class="row") div(class="col-md-6") if (result.txInputs) table(class="table mb-0") if (result.getrawtransaction.vin[0].coinbase) tr th a(data-toggle="tooltip", title="Input #1") i(class=("fas fa-" + fontawesomeInputName + " mr-2")) span 1 td(class="border-top-0") span(class="tag monospace") coinbase span(class="monospace") Newly minted coins td(class="border-top-0") - var currencyValue = coinConfig.blockRewardFunction(result.getblock.height); include includes/value-display.pug each txInput, txInputIndex in result.txInputs if (txInput) - var vout = txInput.vout[result.getrawtransaction.vin[txInputIndex].vout]; tr th a(data-toggle="tooltip", title=("Input #" + (txInputIndex + 1))) i(class=("fas fa-" + fontawesomeInputName + " mr-2")) span #{(txInputIndex + 1)} //pre // code #{JSON.stringify(txInput)} td(class=(txInputIndex == 0 ? "border-top-0" : false)) if (vout.scriptPubKey && vout.scriptPubKey.addresses) div(class="monospace", style="word-break: break-word;") a(href=("/address/" + vout.scriptPubKey.addresses[0])) #{vout.scriptPubKey.addresses[0]} span(class="small monospace") via a(href=("/tx/" + txInput.txid + "#output-" + result.getrawtransaction.vin[txInputIndex].vout), class="monospace") #{txInput.txid.substring(0, 20)}...[#{result.getrawtransaction.vin[txInputIndex].vout}] td(class=(txInputIndex == 0 ? "border-top-0" : false)) if (vout.value) - var currencyValue = vout.value; include includes/value-display.pug tr th td td strong - var currencyValue = totalInputValue; include includes/value-display.pug div(class="col-md-6") table(class="table mb-0") tbody each vout, voutIndex in result.getrawtransaction.vout tr th a(data-toggle="tooltip", title=("Output #" + (voutIndex + 1))) i(class=("fas fa-" + fontawesomeOutputName + " mr-2")) span #{(voutIndex + 1)} td(class=(voutIndex == 0 ? "border-top-0" : false)) if (vout.scriptPubKey) if (vout.scriptPubKey.addresses) a(id=("output-" + voutIndex), href=("/address/" + vout.scriptPubKey.addresses[0])) div(class="monospace", style="word-break: break-word;") #{vout.scriptPubKey.addresses[0]} else if (vout.scriptPubKey.hex && vout.scriptPubKey.hex.startsWith('6a24aa21a9ed')) span(class="monospace") Segregated Witness committment a(href="https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki#commitment-structure", data-toggle="tooltip", title="View developer docs", target="_blank") i(class="fas fa-info-circle") else if (vout.scriptPubKey.asm && vout.scriptPubKey.asm.startsWith('OP_RETURN ')) span(class="monospace") OP_RETURN: span(class="monospace text-muted") #{utils.hex2ascii(vout.scriptPubKey.asm.substring("OP_RETURN ".length))} else span(class="monospace text-danger") Unable to decode output: br span(class="monospace") type=#{vout.scriptPubKey.type}, asm=#{vout.scriptPubKey.asm} td(class=(voutIndex == 0 ? "border-top-0" : false)) - var currencyValue = vout.value; include includes/value-display.pug tr th td td strong - var currencyValue = totalOutputValue; include includes/value-display.pug div(id="tab-scripts", class="tab-pane", role="tabpanel") h3(class="h5") Input Scripts table(class="table table-striped mb-5") thead tr th(style="width: 50px;") th Script Sig (asm) tbody each vin, vinIndex in result.getrawtransaction.vin tr th #{vinIndex + 1} td if (vin.scriptSig && vin.scriptSig.asm) span(class="word-wrap monospace") #{vin.scriptSig.asm} else if (vin.coinbase) div(style="line-height: 1.75em;") span(class="tag") coinbase br span(class="word-wrap monospace") #{vin.coinbase} br span(class="word-wrap monospace text-muted") (decoded) #{utils.hex2ascii(vin.coinbase)} h3(class="h5") Output Scripts table(class="table table-striped") thead tr th(style="width: 50px;") th Script Pub Key (asm) tbody each vout, voutIndex in result.getrawtransaction.vout tr th #{voutIndex + 1} td if (vout.scriptPubKey && vout.scriptPubKey.asm) span(class="word-wrap monospace") #{vout.scriptPubKey.asm} if (vout.scriptPubKey.asm.startsWith("OP_RETURN")) br span(class="word-wrap monospace text-muted") (decoded) #{utils.hex2ascii(vout.scriptPubKey.asm)} div(id="tab-raw", class="tab-pane", role="tabpanel") div(class="highlight") pre code(class="language-json", data-lang="json") #{JSON.stringify(result.getrawtransaction, null, 4)} //pre #{JSON.stringify(result.txInputs, null, 4)}