|
- 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")
- 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}
-
- 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}
-
- tr
- th(class="table-active properties-header") Timestamp
- td(class="monospace") #{moment.utc(new Date(result.getblock.time * 1000)).format("Y-MM-DD HH:mm:ss")} (utc)
-
- 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)
- br
- 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 #{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}
- else if (result.getblock.height == 0)
- a(href=(""), class="monospace") #{result.getblock.tx}
- div(class="card-body")
- //pre
- // code #{JSON.stringify(result.txInputsByTransaction[tx.txid], null, 4)}
- if (tx && tx.txid)
- 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(utils.getBlockReward(result.getblock.height)));
- tr
- th 1
- td
- span(class="tag monospace") coinbase
- span(class="monospace") Newly minted VIVO
- td(class="monospace") Σ #{utils.getBlockReward(result.getblock.height)}
-
- 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)
- span(class="monospace") #{vout.scriptPubKey.addresses[0]}
- br
- 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));
- span(class="monospace") Σ #{vout.value}
-
- - 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()} : click on transaction id for all ...
-
- //span(class="monospace text-muted") a(href=("/tx/" + tx.txid), click on transaction id for all ....)}
- //a(href=""/tx/" + #{tx.txid}", class="nav-link") more ... #{tx.txid}
- //a(href=("/tx/" + tx.txid), class="monospace") #{tx.txid}
-
- //span(class="monospace text-muted") #{(tx.vin.length - result.txInputsByTransaction[tx.txid].length).toLocaleString()}:
- span(class="monospace text-muted") #{tx.vin.length.toLocaleString()}:
- //a(href=("/tx/" + tx.txid), class="monospace")
-
- a(href=("/tx/" + tx.txid), class="monospace") Go to all #{tx.vin.length.toLocaleString()}
-
- td
- else
- tr
- td
- td
- td
- strong(class="monospace") Σ #{totalInputValue}
-
-
- 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)
- //span(class="monospace") #{vout.scriptPubKey.addresses[0]}
- span(class="monospace")
- a(href=("/address/" + vout.scriptPubKey.addresses[0])) #{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") docs
- i(class="fa fa-external-link")
- 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
- span(class="monospace") Σ #{vout.value}
- - totalOutputValue = totalOutputValue.plus(vout.value);
-
- tr
- td
- td
- td
- strong(class="monospace") Σ #{totalOutputValue}
- else if (result.getblock.height == 0)
- table(class="table mb-0")
- thead
- tr
- th(style="text-align: center;") Genesis
- //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)}
|