{{define "txdetail"}}{{$cs := .CoinShortcut}}{{$addr := .AddrStr}}{{$tx := .Tx}}{{$data := .}}
{{$tx.Txid}} {{if $tx.Rbf}} RBF{{end}}
{{if $tx.Blocktime}}
{{if $tx.Confirmations}}mined{{else}}first seen{{end}} {{unixTimeSpan $tx.Blocktime}}
{{end}} {{if eq $tx.EthereumSpecific.Status 0}}
Failed{{if $tx.EthereumSpecific.Error}}{{$tx.EthereumSpecific.Error}}{{end}}
{{end}} {{if $tx.EthereumSpecific.ParsedData}} {{if $tx.EthereumSpecific.ParsedData.Name}}
{{$tx.EthereumSpecific.ParsedData.Name}}{{if $tx.EthereumSpecific.ParsedData.MethodId}} ({{$tx.EthereumSpecific.ParsedData.MethodId}}){{end}}
{{else}} {{if $tx.EthereumSpecific.ParsedData.MethodId}}
{{$tx.EthereumSpecific.ParsedData.MethodId}}
{{end}} {{end}} {{end}}
{{range $vin := $tx.Vin}}
{{range $a := $vin.Addresses}} {{if and (ne $a $addr) $vin.IsAddress}}{{addressAliasSpan $a $data}}{{else}}{{addressAliasSpan $a $data}}{{end}} {{else}} Unparsed address {{end}}
{{else}}
No Inputs
{{end}}
 
{{range $vout := $tx.Vout}}
{{range $a := $vout.Addresses}} {{if and (ne $a $addr) $vout.IsAddress}}{{addressAliasSpan $a $data}}{{else}}{{addressAliasSpan $a $data}}{{end}} {{else}} Unparsed address {{end}}
{{else}}
No Outputs
{{end}}
{{amountSpan $tx.ValueOutSat $data "tx-out copyable"}}
{{if eq $tx.EthereumSpecific.Type 1}}
Contract creation
{{if ne $tx.EthereumSpecific.CreatedContract $addr}}{{addressAliasSpan $tx.EthereumSpecific.CreatedContract $data}}{{else}}{{addressAliasSpan $tx.EthereumSpecific.CreatedContract $data}}{{end}}
{{end}} {{if $tx.EthereumSpecific.InternalTransfers}}
Internal Transactions
{{range $tt := $tx.EthereumSpecific.InternalTransfers}} {{if eq $tt.Type 1}}
Contract creation
{{end}} {{if eq $tt.Type 2}}
Contract destruction
{{end}}
{{if ne $tt.From $addr}}{{addressAliasSpan $tt.From $data}}{{else}}{{addressAliasSpan $tt.From $data}}{{end}}
 
{{if ne $tt.To $addr}}{{addressAliasSpan $tt.To $data}}{{else}}{{addressAliasSpan $tt.To $data}}{{end}}
{{amountSpan $tt.Value $data "tx-out copyable"}}
{{end}} {{end}} {{if tokenTransfersCount $tx .FungibleTokenName}}
{{.FungibleTokenName}} Token Transfers
{{range $tt := $tx.TokenTransfers}} {{if eq $tt.Type $.FungibleTokenName}}
{{if ne $tt.From $addr}}{{addressAliasSpan $tt.From $data}}{{else}}{{addressAliasSpan $tt.From $data}}{{end}}
 
{{if ne $tt.To $addr}}{{addressAliasSpan $tt.To $data}}{{else}}{{addressAliasSpan $tt.To $data}}{{end}}
{{tokenAmountSpan $tt $data "tx-out copyable"}}
{{end}} {{end}} {{end}} {{if tokenTransfersCount $tx .NonFungibleTokenName}}
{{.NonFungibleTokenName}} Token Transfers
{{range $tt := $tx.TokenTransfers}} {{if eq $tt.Type $.NonFungibleTokenName}}
{{if ne $tt.From $addr}}{{addressAliasSpan $tt.From $data}}{{else}}{{addressAliasSpan $tt.From $data}}{{end}}
 
{{if ne $tt.To $addr}}{{addressAliasSpan $tt.To $data}}{{else}}{{addressAliasSpan $tt.To $data}}{{end}}
ID {{$tt.Value}} {{$tt.Symbol}}
{{end}} {{end}} {{end}} {{if tokenTransfersCount $tx .MultiTokenName}}
{{.MultiTokenName}} Token Transfers
{{range $tt := $tx.TokenTransfers}} {{if eq $tt.Type $.MultiTokenName}}
{{if ne $tt.From $addr}}{{addressAliasSpan $tt.From $data}}{{else}}{{addressAliasSpan $tt.From $data}}{{end}}
 
{{if ne $tt.To $addr}}{{addressAliasSpan $tt.To $data}}{{else}}{{addressAliasSpan $tt.To $data}}{{end}}
{{range $i, $iv := $tt.MultiTokenValues}} {{if $i}}, {{end}}{{formattedAmountSpan $iv.Value 0 $tt.Symbol $data ""}} of ID {{$iv.Id}} {{end}}
{{end}} {{end}} {{end}}
{{end}}