Co-authored-by: sairaj mote <sairajmote3@gmail.com>
This commit is contained in:
parent
27a7f47247
commit
72f4824693
18
index.html
18
index.html
@ -408,7 +408,7 @@
|
|||||||
router.addRoute('block', async state => {
|
router.addRoute('block', async state => {
|
||||||
const [blockId] = state.wildcards
|
const [blockId] = state.wildcards
|
||||||
if (!blockId) return;
|
if (!blockId) return;
|
||||||
let [blockInfo, blockTxs] = await Promise.all([getBlockInfo(blockId), getBlockTxs(blockId)])
|
let [blockInfo, blockTxs] = await Promise.all([getBlockInfo(blockId), getBlockTransactions(blockId)])
|
||||||
renderElem(getRef("page_container"), html`${render.blockPage(blockInfo)}`);
|
renderElem(getRef("page_container"), html`${render.blockPage(blockInfo)}`);
|
||||||
getRef("page_title").textContent = 'Block'
|
getRef("page_title").textContent = 'Block'
|
||||||
renderTransactions('block_transaction_container', blockTxs)
|
renderTransactions('block_transaction_container', blockTxs)
|
||||||
@ -879,7 +879,17 @@
|
|||||||
<h5 class="label">${title}</h5>
|
<h5 class="label">${title}</h5>
|
||||||
<a href=${`#/token/${token}`} class="">${token}</a>
|
<a href=${`#/token/${token}`} class="">${token}</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="contract-info">
|
<div class="contract-info">
|
||||||
|
<div class="flex flex-wrap gap-1">
|
||||||
|
<div class="flex flex-direction-column">
|
||||||
|
<h5 class="label">Sender</h5>
|
||||||
|
<a href=${`#/address/${sender}`} class="address wrap-around">${sender}</a>
|
||||||
|
</div>
|
||||||
|
<div class="flex flex-direction-column">
|
||||||
|
<h5 class="label">Receiver</h5>
|
||||||
|
<a href=${`#/address/${receiver}`} class="address wrap-around">${receiver}</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="flex flex-direction-column">
|
<div class="flex flex-direction-column">
|
||||||
<h5 class="label">Amount</h5>
|
<h5 class="label">Amount</h5>
|
||||||
<h4>${formatAmount(amount, token.toLowerCase() === 'rupee' ? 'inr' : 'usd')} ${token}</h4>
|
<h4>${formatAmount(amount, token.toLowerCase() === 'rupee' ? 'inr' : 'usd')} ${token}</h4>
|
||||||
@ -1157,7 +1167,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
async function getBlockTransactions(thisBlock) {
|
async function getBlockTransactions(thisBlock) {
|
||||||
const blockTransactions = await fetchJson(`${tokenApiUrl}/api/v2/blockTransactions/${thisBlock}`)
|
const blockTransactions = await fetchJson(`${tokenApiUrl}/api/v2/blockTransactions/${thisBlock}`)
|
||||||
return blockTransactions.transactions
|
return blockTransactions.transactions
|
||||||
@ -1193,6 +1202,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function parseTransactions(txList) {
|
function parseTransactions(txList) {
|
||||||
|
console.log(txList)
|
||||||
|
if(!Array.isArray(txList))
|
||||||
|
txList = Object.values(txList)
|
||||||
let latestTxArray = [];
|
let latestTxArray = [];
|
||||||
txList.forEach(tx => {
|
txList.forEach(tx => {
|
||||||
// console.log(transactionKey)
|
// console.log(transactionKey)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user