ul(class='nav nav-tabs mb-3') li(class="nav-item") a(data-toggle="tab", href="#tab-summary", class="nav-link active", role="tab") Summary li(class="nav-item") a(data-toggle="tab", href="#tab-raw", class="nav-link", role="tab") Raw - var txCount = result.getblock.tx.length; div(class="tab-content") div(id="tab-summary", class="tab-pane active", role="tabpanel") if (coinConfig.specialBlocks && coinConfig.specialBlocks[result.getblock.hash]) div(class="alert alert-info", style="padding-bottom: 0;") h4(class="alert-heading h5") #{coinConfig.specialBlocks[result.getblock.hash].noteTitle} if (coinConfig.specialBlocks[result.getblock.hash].noteBodyHtml) p !{coinConfig.specialBlocks[result.getblock.hash].noteBodyHtml} table(class="table") tr th(class="table-active properties-header") Block Hash td(class="monospace") a(href=("/block/" + result.getblock.hash)) #{result.getblock.hash} tr th(class="table-active properties-header") Previous Block Hash td(class="monospace") if (result.getblock.previousblockhash) a(href=("/block/" + result.getblock.previousblockhash)) #{result.getblock.previousblockhash} else if (result.getblock.hash == genesisBlockHash) span None tr th(class="table-active properties-header") Next Block Hash td(class="monospace") if (result.getblock.nextblockhash) a(href=("/block/" + result.getblock.nextblockhash)) #{result.getblock.nextblockhash} else span None span(class="text-muted") (latest block) tr th(class="table-active properties-header") Block Height td(class="monospace") a(href=("/block-height/" + result.getblock.height)) #{result.getblock.height.toLocaleString()} tr th(class="table-active properties-header") Timestamp (utc) - var timeAgo = moment.duration(moment.utc(new Date()).diff(moment.utc(new Date(parseInt(result.getblock.time) * 1000)))); td(class="monospace") #{moment.utc(new Date(result.getblock.time * 1000)).format("Y-MM-DD HH:mm:ss")} span(class="text-muted") (#{timeAgo.format()}) tr th(class="table-active properties-header") Transaction Count td(class="monospace") #{result.getblock.tx.length.toLocaleString()} tr th(class="table-active properties-header") Size td(class="monospace") span #{result.getblock.size.toLocaleString()} bytes if (result.getblock.weight) span(class="text-muted") (weight: #{result.getblock.weight.toLocaleString()}) tr th(class="table-active properties-header") Confirmations td(class="monospace") if (result.getblock.confirmations < 6) strong(class="text-warning") #{result.getblock.confirmations} else strong(class="text-success") #{result.getblock.confirmations.toLocaleString()} tr - var scales = [ {val:1000000000000000, name:"quadrillion"}, {val:1000000000000, name:"trillion"}, {val:1000000000, name:"billion"}, {val:1000000, name:"million"} ]; - var scaleDone = false; th(class="table-active properties-header") Difficulty td(class="monospace") span #{parseFloat(result.getblock.difficulty).toLocaleString()} each item in scales if (!scaleDone) - var fraction = Math.floor(result.getblock.difficulty / item.val); if (fraction >= 1) - scaleDone = true; span(class="text-muted") (#{fraction} #{item.name}) tr th(class="table-active text-right") Version td(class="monospace") 0x#{result.getblock.versionHex} span(class="text-muted") (decimal: #{result.getblock.version}) tr th(class="table-active text-right") Nonce td(class="monospace") #{result.getblock.nonce} tr th(class="table-active text-right") Bits td(class="monospace") #{result.getblock.bits} tr th(class="table-active text-right") Merkle Root td(class="monospace") #{result.getblock.merkleroot} tr th(class="table-active text-right") Chainwork td(class="monospace") #{result.getblock.chainwork} hr h2(class="h4") Transactions (#{txCount.toLocaleString()}) small - Showing if (txCount <= limit) span all else span #{(offset + 1)} - #{Math.min(offset + limit, txCount)} each tx, txIndex in result.transactions //pre // code #{JSON.stringify(tx, null, 4)} div(class="card mb-3") div(class="card-header") if (tx && tx.txid) a(href=("/tx/" + tx.txid), class="monospace") #{tx.txid} div(class="card-body") //pre // code #{JSON.stringify(result.txInputsByTransaction[tx.txid], null, 4)} if (true) div(class="row") div(class="col-md-6") //h6 Input (#{tx.vin.length.toLocaleString()}) if (result.txInputsByTransaction[tx.txid]) - var totalInputValue = new Decimal(0); table(class="table mb-0") thead tr th(style="width: 40px;") th Input th Amount tbody if (tx.vin[0].coinbase) - totalInputValue = totalInputValue.plus(new Decimal(coinConfig.blockRewardFunction(result.getblock.height))); tr th 1 td span(class="tag monospace") coinbase span(class="monospace") Newly minted coins td - var currencyValue = coinConfig.blockRewardFunction(result.getblock.height); include ./value-display.pug each txInput, txInputIndex in result.txInputsByTransaction[tx.txid] if (txInput) - var vout = txInput.vout[tx.vin[txInputIndex].vout]; tr th #{(txInputIndex + 1)} //pre // code #{JSON.stringify(txInput)} td if (vout.scriptPubKey && vout.scriptPubKey.addresses) div(class="monospace", style="word-break: break-word;") #{vout.scriptPubKey.addresses[0]} span(class="monospace text-muted") via tx a(href=("/tx/" + txInput.txid + "#output-" + tx.vin[txInputIndex].vout), class="monospace") #{txInput.txid.substring(0, 14)}..., Output ##{tx.vin[txInputIndex].vout + 1} td if (vout.value) - totalInputValue = totalInputValue.plus(new Decimal(vout.value)); - var currencyValue = vout.value; include ./value-display.pug - var coinbaseCount = tx.vin[0].coinbase ? 1 : 0; if ((tx.vin.length - coinbaseCount) > result.txInputsByTransaction[tx.txid].length) tr td td span(class="monospace text-muted") #{(tx.vin.length - result.txInputsByTransaction[tx.txid].length).toLocaleString()} more... td else tr td td td strong - var currencyValue = totalInputValue; include ./value-display.pug div(class="col-md-6") //h6 Output (#{tx.vout.length.toLocaleString()}) - var totalOutputValue = new Decimal(0); table(class="table mb-0") thead tr th th Output th Amount tbody each vout, voutIndex in tx.vout tr th #{(voutIndex + 1)} td if (vout.scriptPubKey) if (vout.scriptPubKey.addresses) a(id="output-" + voutIndex) 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))} td - var currencyValue = vout.value; include ./value-display.pug - totalOutputValue = totalOutputValue.plus(vout.value); tr td td td strong - var currencyValue = totalOutputValue; include ./value-display.pug //pre // code #{JSON.stringify(tx, null, 4)} if (txCount > limit) - var pageNumber = offset / limit + 1; - var pageCount = Math.floor(txCount / limit); - if (pageCount * limit < txCount) { - pageCount++; - } - var paginationUrlFunction = function(x) { - return paginationBaseUrl + "?limit=" + limit + "&offset=" + ((x - 1) * limit); - } hr include ./pagination.pug div(id="tab-raw", class="tab-pane", role="tabpanel") pre code #{JSON.stringify(result.getblock, null, 4)}