// Copyright 2017-2021 DERO Project. All rights reserved. // Use of this source code in any form is governed by RESEARCH license. // license can be found in the LICENSE file. // GPG: 0F39 E425 8C65 3947 702A 8234 08B2 0360 A03A 9DE8 // // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL // THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package main // this files defines all the templates var header_template string = ` {{define "header"}} {{ .title }}

logo {{ .title }} {{if .testnet}} TestNet {{end}}

{{if .Network_Difficulty}}

Server time: {{ .servertime }} | Transaction pool

Network difficulty: {{ .Network_Difficulty }} | Hash rate: {{ .hash_rate }} KH/s | Average Block Time(50) {{.averageblocktime50}} sec | Total supply : {{ .total_supply }} | Mempool size : {{ .txpool_size }} | Fee per kb: {{.fee_per_kb}} | Median block size limit: {{.median_block_size}} kB

{{end}} {{end}} ` var block_template string = `{{define "block"}} {{ template "header" . }}

Block Topo height (unique): {{.block.TopoHeight}} Block height: ({{.block.Height}})

Block hash: {{.block.Hash}}

{{range $i, $a := .block.Tips}}
Previous blocks: {{$a}}
{{end}}
Timestamp [UCT] (epoch):{{.block.Block_time}} ({{.block.Epoch}}) Age [h:m:s]:{{.block.Age}} Δ [h:m:s]:
Major.minor version:{{.block.Major_Version}}.{{.block.Minor_Version}} Block reward:{{.block.Reward}} Block size [kB]:{{.block.Size}}
nonce:{{.block.Nonce}} Total fees:{{.block.Fees}} No of txs:{{.block.Tx_Count}}

Miner reward for this block

Miner Address outputs size [kB] version
{{index .block.Mtx.OutAddress 0}} {{.block.Mtx.Amount}} {{.block.Mtx.Size}} {{.block.Mtx.Version}}

Transactions ({{.block.Tx_Count}})

{{range .block.Txs}} {{if .Skipped }} {{else}} {{end}} {{end}}
hash type fee ring size version size [kB]
{{.Hash}} {{.Hash}}{{.TransactionType}} {{.Fee}} {{.Ring_size}} {{.Version}} {{.Size}}
{{ template "footer" . }} {{end}} ` var tx_template string = `{{define "tx"}} {{ template "header" . }}

Tx hash: {{.info.Hash}} Type {{.info.TransactionType }}

Tx prefix hash: {{.info.PrefixHash}}
Block: {{.info.ValidBlock}} (VALID)
{{range $i, $e := .info.InvalidBlock}}
Block: {{$e}}
{{end}} {{if eq .info.TransactionType "PREMINE"}}
{{index .info.OutAddress 0}} Registered with funds {{.info.Amount}}
{{end}} {{if eq .info.TransactionType "REGISTRATION"}}
{{index .info.OutAddress 0}} Registered
{{end}} {{if eq .info.TransactionType "NORMAL"}}
Tx RootHash: {{.info.RootHash}} built height : {{.info.HeightBuilt}}
{{if .info.PayID32}}
PaymentID: {{.info.PayID32}}
{{end}} {{if .info.PayID8}}
Encrypted PaymentID: {{.info.PayID8}}
{{end}}
Timestamp: {{.info.Timestamp}} Timestamp [UTC]: {{.info.Block_time}} Age [y:d:h:m:s]: {{.info.Age}}
Block: {{.info.Height}} Fee: {{.info.Fee}} Tx size: {{.info.Size}} kB
Tx version: {{.info.Version}} No of confirmations: {{.info.Depth}} Signature type: {{.info.Type}}
Extra: {{.info.Extra}}

{{len .info.OutAddress}} inputs/outputs (RING size)

{{range $i, $e := .info.OutAddress}} {{end}}
address amount
{{ $e }} {{$.info.Amount}}


{{if .info.Proof_amount }} {{end}} {{if .info.Proof_error }} {{end}}

Prove to someone that you have sent them DERO in this transaction

proof can be obtained using get_tx_key command in dero-wallet-cli or from the statement
Note: proof is sent to the server, as the calculations are done on the server side

{{.info.Proof_address}} Received {{.info.Proof_amount}} DERO {{if .info.Proof_PayID8}}
Decrypted Payment ID {{ .info.Proof_PayID8}} {{end}}

{{.info.Proof_error}}
{{end}} {{if eq .info.CoinBase false}} {{end}}
{{ template "footer" . }} {{end}}` var txpool_template string = `{{define "txpool"}}

Transaction pool

(no of txs: {{ .txpool_size }}, size: 0.00 kB, updated every 5 seconds)

{{range .mempool}} {{end}}
height built transaction hash fee ring size tx size [kB]
{{.HeightBuilt}} {{.Hash}} {{.Fee}} {{.Ring_size}} {{.Size}}
{{end}}` // full page txpool_template var txpool_page_template string = `{{define "txpool_page"}} {{ template "header" . }} {{ template "txpool" . }} {{ template "footer" . }} {{end}}` // not found page txpool_template var notfound_page_template string = `{{define "notfound_page"}} {{ template "header" . }}

No details found in database

{{ template "footer" . }} {{end}}` var main_template string = ` {{define "main"}} {{ template "header" . }} {{ template "txpool" . }}

Transactions in the last 11 blocks

(Median size of these blocks: 0.09 kB)

{{range .block_array}} {{range .Txs}} {{if .Skipped }} {{else}} {{end}} {{end}} {{end}}
height topo height age [h:m:s] size [kB] tx hash type fees ring size tx size [kB]
{{if .SyncBlock }} {{.Height}} {{else}} {{.Height}} {{end}} {{.TopoHeight}} {{.Age}} {{.Size}} block {{.Hash}} N/A {{.Mtx.Amount}} 0 {{.Mtx.Size}}
{{.Hash}} {{.Hash}}{{.TransactionType}} {{.Fee}} {{.Ring_size}} {{.Size}}
{{ template "paging" . }}
{{ template "footer" . }} {{end}}` var paging_template string = `{{ define "paging"}}
previous page | first page | current page: {{.current_page}}/{{.total_page}} | next page | last page
{{end}}` var footer_template string = ` {{define "footer"}}
DERO explorer source code | explorer version (api): under development (1.0) | dero version: golang pre-alpha | Copyright 2017-2021 Dero Project
{{end}} `