-
Notifications
You must be signed in to change notification settings - Fork 5
fix(syscoin): restore explorer UX after upstream merge #24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -106,9 +106,39 @@ <h4 class="row"> | |
| <td>No. Transactions</td> | ||
| <td>{{formatInt $addr.UnconfirmedTxs}}</td> | ||
| </tr> | ||
| {{/* SYSCOIN: show unconfirmed SPT balances on normal address pages. */}} | ||
| {{if isSyscoinShortcut .CoinShortcut}} | ||
| {{if $addr.TokensAsset}} | ||
| <tr> | ||
| <td>Syscoin Assets</td> | ||
| <td style="padding: 0;"> | ||
| <table class="table data-table mt-0 mb-0"> | ||
| <tbody> | ||
| <tr> | ||
| <th>Asset</th> | ||
| <th>Unconfirmed Balance</th> | ||
| <th class="text-end"><span class="d-none d-md-block">Transfers</span><span class="d-block d-md-none">#</span></th> | ||
| </tr> | ||
| {{range $t := $addr.TokensAsset}} | ||
| {{if $t.UnconfirmedBalanceSat}} | ||
| <tr> | ||
| <td><a href="/asset/{{$t.AssetGuid}}" class="copyable">{{$t.AssetGuid}}</a> <span class="text-muted">{{if $t.Symbol}}{{$t.Symbol}}{{else}}SPT{{end}}</span></td> | ||
| <td>{{formattedAmountSpan $t.UnconfirmedBalanceSat $t.Decimals $t.Symbol $data "copyable"}}</td> | ||
| <td class="text-end">{{formatInt $t.UnconfirmedTransfers}}</td> | ||
| </tr> | ||
| {{end}} | ||
| {{end}} | ||
| </tbody> | ||
| </table> | ||
| </td> | ||
| </tr> | ||
| {{end}} | ||
| {{end}} | ||
| </tbody> | ||
| </table> | ||
| {{end}} | ||
| {{/* SYSCOIN: show SPT balances on normal address pages. */}} | ||
| {{if isSyscoinShortcut .CoinShortcut}} | ||
| {{if $addr.TokensAsset}} | ||
| <div class="accordion mt-2 mb-2" id="syscoinAssets"> | ||
| <div class="accordion-item"> | ||
|
|
@@ -124,17 +154,23 @@ <h5 class="col-12 mb-md-0">Syscoin Assets <span class="badge bg-secondary">{{len | |
| <table class="table data-table mt-0 mb-0"> | ||
| <tbody> | ||
| <tr> | ||
| <th style="width: 25%;">Asset GUID</th> | ||
| <th style="width: 25%;">Symbol</th> | ||
| <th style="width: 30%;">Balance</th> | ||
| <th class="text-end" style="width: 20%;">Unconfirmed</th> | ||
| <th>Asset GUID</th> | ||
| <th>Symbol</th> | ||
| <th>Received</th> | ||
| <th>Sent</th> | ||
| <th>Balance</th> | ||
| <th>Unconfirmed</th> | ||
| <th class="text-end"><span class="d-none d-md-block">Transfers</span><span class="d-block d-md-none">#</span></th> | ||
| </tr> | ||
| {{range $t := $addr.TokensAsset}} | ||
| <tr> | ||
| <td><a href="/asset/{{$t.AssetGuid}}" class="copyable">{{$t.AssetGuid}}</a></td> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
These new Syscoin asset links point at Useful? React with 👍 / 👎. |
||
| <td>{{if $t.Symbol}}{{$t.Symbol}}{{else}}SPT{{end}}</td> | ||
| <td>{{formattedAmountSpan $t.TotalReceivedSat $t.Decimals $t.Symbol $data "copyable"}}</td> | ||
| <td>{{formattedAmountSpan $t.TotalSentSat $t.Decimals $t.Symbol $data "copyable"}}</td> | ||
| <td>{{formattedAmountSpan $t.BalanceSat $t.Decimals $t.Symbol $data "copyable"}}</td> | ||
| <td class="text-end">{{if $t.UnconfirmedBalanceSat}}{{formattedAmountSpan $t.UnconfirmedBalanceSat $t.Decimals $t.Symbol $data "copyable"}}{{else}}0{{end}}</td> | ||
| <td>{{if $t.UnconfirmedBalanceSat}}{{formattedAmountSpan $t.UnconfirmedBalanceSat $t.Decimals $t.Symbol $data "copyable"}}{{else}}0{{end}}</td> | ||
| <td class="text-end">{{formatInt $t.Transfers}}</td> | ||
| </tr> | ||
| {{end}} | ||
| </tbody> | ||
|
|
@@ -144,6 +180,7 @@ <h5 class="col-12 mb-md-0">Syscoin Assets <span class="badge bg-secondary">{{len | |
| </div> | ||
| </div> | ||
| {{end}} | ||
| {{end}} | ||
| {{if eq .ChainType 1}} | ||
| {{if tokenCount $addr.Tokens .FungibleTokenName}} | ||
| <div class="accordion mt-2 mb-2" id="erc20"> | ||
|
|
@@ -171,7 +208,7 @@ <h5 class="col-md-8 mb-md-0"><span tt="Total value of tokens">{{summaryValuesSpa | |
| <tr> | ||
| <td class="ellipsis"><a href="/address/{{$t.Contract}}">{{if $t.Name}}<span class="copyable" cc="{{$t.Contract}}" alias-type="Contract">{{$t.Name}}</span>{{else}}<span class="copyable">{{$t.Contract}}</span>{{end}}</a></td> | ||
| <td>{{formattedAmountSpan $t.BalanceSat $t.Decimals $t.Symbol $data "copyable"}}</td> | ||
| <td>{{summaryValuesSpan $t.BaseValue $t.SecondaryValue $data}}</span></td> | ||
| <td>{{summaryValuesSpan $t.BaseValue $t.SecondaryValue $data}}</td> | ||
| <td class="text-end">{{formatInt $t.Transfers}}</td> | ||
| </tr> | ||
| {{end}} | ||
|
|
@@ -263,7 +300,7 @@ <h5 class="col-12 mb-md-0">{{.MultiTokenName}} Tokens <span class="badge bg-seco | |
| <div class="accordion-header" id="stakingPoolsHeading"> | ||
| <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#stakingPoolsBody" aria-expanded="false" aria-controls="stakingPoolsBody"> | ||
| <div class="row g-0 w-100"> | ||
| <h5 class="col-12 mb-md-0">Staking Pools <span class="badge bg-secondary">{{len $addr.StakingPools}}</span></span></h5> | ||
| <h5 class="col-12 mb-md-0">Staking Pools <span class="badge bg-secondary">{{len $addr.StakingPools}}</span></h5> | ||
| </div> | ||
| </button> | ||
| </div> | ||
|
|
@@ -316,7 +353,8 @@ <h5 class="col-12 mb-md-0">Staking Pools <span class="badge bg-secondary">{{len | |
| <div class="row pt-3 pb-1"> | ||
| <h3 class="col-sm-6 col-lg-3 m-0 align-self-center">Transactions</h3> | ||
| <div class="col-sm-6 col-lg-3 my-2 my-lg-0 align-self-center"> | ||
| {{if $addr.TokensAsset}}<select class="w-100" onchange="self.location='?assetMask='+options[selectedIndex].value+'&filter='+options[selectedIndex].value">{{else}}<select class="w-100" onchange="self.location='?filter='+options[selectedIndex].value">{{end}} | ||
| {{/* SYSCOIN: preserve SPT transaction filters when the address has assets. */}} | ||
| {{if isSyscoinShortcut .CoinShortcut}}{{if $addr.TokensAsset}}<select class="w-100" onchange="self.location='?assetMask='+options[selectedIndex].value+'&filter='+options[selectedIndex].value">{{else}}<select class="w-100" onchange="self.location='?filter='+options[selectedIndex].value">{{end}}{{else}}<select class="w-100" onchange="self.location='?filter='+options[selectedIndex].value">{{end}} | ||
| <option>All</option> | ||
| <option {{if eq $addr.Filter "inputs"}}selected{{end}} value="inputs">Address on input side</option> | ||
| <option {{if eq $addr.Filter "outputs"}}selected{{end}} value="outputs">Address on output side</option> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,6 +17,8 @@ <h5 class="col-12 d-flex h-data"><span class="ellipsis copyable">{{$tx.Txid}}</s | |
| <td>In Block</td> | ||
| <td class="ellipsis" style="max-width: 280px">{{if $tx.Confirmations}}{{$tx.Blockhash}}{{else}}<span class="badge bg-danger">Unconfirmed</span>{{end}}</td> | ||
| </tr> | ||
| {{/* SYSCOIN: expose SPT transaction metadata on the full transaction page. */}} | ||
| {{if isSyscoinShortcut $data.CoinShortcut}} | ||
| {{if $tx.TokenType}} | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
For SYS/TSYS this branch is evaluated on every Bitcoin-type transaction page, but Useful? React with 👍 / 👎. |
||
| <tr> | ||
| <td>Syscoin Transaction Type</td> | ||
|
|
@@ -53,6 +55,7 @@ <h5 class="col-12 d-flex h-data"><span class="ellipsis copyable">{{$tx.Txid}}</s | |
| </td> | ||
| </tr> | ||
| {{end}} | ||
| {{end}} | ||
| {{if $tx.Confirmations}} | ||
| <tr> | ||
| <td>In Block Height</td> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On SYS/TSYS address pages this
iftries to readTokensAssetfromapi.Address, but that struct has no such field (nor the relatedUsedAssetTokensused inxpub.html). The first Syscoin address render that reaches this block will hit a template execution error for the missing field and truncate the page instead of displaying address details.Useful? React with 👍 / 👎.