Show blockhash in transaction details

This commit is contained in:
Justin Starry 2020-05-08 00:01:35 +08:00 committed by Michael Vines
parent 13af01dcc4
commit 7eb792a0cc
3 changed files with 27 additions and 11 deletions

View File

@ -1269,9 +1269,9 @@
"integrity": "sha512-DetpxZw1fzPD5xUBrIAoplLChO2VB8DlL5Gg+I1IR9b2wPqYIca2WSUxL5g1vLeR4MsQq1NeWriXAVffV+U1Fw=="
},
"@solana/web3.js": {
"version": "0.47.1",
"resolved": "https://registry.npmjs.org/@solana/web3.js/-/web3.js-0.47.1.tgz",
"integrity": "sha512-SeBCJSqQAgPbgP1a6jthFEv46YeYUcdOdejBDKlqsWGCtJ4dy4R/4BL3ItSJAPqYxY9Q4Cccd41Cp35w0iKvfw==",
"version": "0.48.1",
"resolved": "https://registry.npmjs.org/@solana/web3.js/-/web3.js-0.48.1.tgz",
"integrity": "sha512-fzOv8yodlRI8ehjKJPX7Xd0wmswYrzWoHBnf3Anm0FdDaLT5J1riTcE9w6mHijnh97KuIGdD5DQ3J6RX0Sbp4g==",
"requires": {
"@babel/runtime": "^7.3.1",
"bn.js": "^5.0.0",
@ -1627,11 +1627,12 @@
"integrity": "sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g=="
},
"@types/express-serve-static-core": {
"version": "4.17.5",
"resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.5.tgz",
"integrity": "sha512-578YH5Lt88AKoADy0b2jQGwJtrBxezXtVe/MBqWXKZpqx91SnC0pVkVCcxcytz3lWW+cHBYDi3Ysh0WXc+rAYw==",
"version": "4.17.6",
"resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.6.tgz",
"integrity": "sha512-U2oynuRIB17GIbEdvjFrrEACOy7GQkzsX7bPEBz1H41vZYEU4j0fLL97sawmHDwHUXpUQDBMHIyM9vejqP9o1A==",
"requires": {
"@types/node": "*",
"@types/qs": "*",
"@types/range-parser": "*"
}
},
@ -1715,6 +1716,11 @@
"resolved": "https://registry.npmjs.org/@types/q/-/q-1.5.2.tgz",
"integrity": "sha512-ce5d3q03Ex0sy4R14722Rmt6MT07Ua+k4FwDfdcToYJcMKNtRVQvJ6JCAPdAmAnbRb6CsX6aYb9m96NGod9uTw=="
},
"@types/qs": {
"version": "6.9.2",
"resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.2.tgz",
"integrity": "sha512-a9bDi4Z3zCZf4Lv1X/vwnvbbDYSNz59h3i3KdyuYYN+YrLjSeJD0dnphdULDfySvUv6Exy/O0K6wX/kQpnPQ+A=="
},
"@types/range-parser": {
"version": "1.2.3",
"resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.3.tgz",

View File

@ -3,7 +3,7 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@solana/web3.js": "^0.47.1",
"@solana/web3.js": "^0.48.1",
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.3.2",
"@testing-library/user-event": "^7.1.2",

View File

@ -119,6 +119,7 @@ function StatusCard({ signature }: Props) {
};
const fee = details?.transaction?.meta?.fee;
const blockhash = details?.transaction?.transaction.recentBlockhash;
return (
<div className="card">
<div className="card-header align-items-center">
@ -138,15 +139,24 @@ function StatusCard({ signature }: Props) {
<td className="text-right">{renderResult()}</td>
</tr>
<tr>
<td>Confirmations</td>
<td className="text-right text-uppercase">{info.confirmations}</td>
</tr>
<tr>
<td>Block</td>
<td className="text-right">{info.slot}</td>
</tr>
<tr>
<td>Confirmations</td>
<td className="text-right text-uppercase">{info.confirmations}</td>
</tr>
{blockhash && (
<tr>
<td>Blockhash</td>
<td className="text-right">
<code>{blockhash}</code>
</td>
</tr>
)}
{fee && (
<tr>