fixed off chain ttcs grouping
This commit is contained in:
parent
45ec74ffad
commit
62e7f8b20a
19
index.html
19
index.html
@ -1191,8 +1191,8 @@
|
||||
</li>`;
|
||||
},
|
||||
compoundTransactionCard(details) {
|
||||
const { time, hash, sender, receiver, contractName, token, amount, offChainTransactions = [], userChoice } = details
|
||||
const smartContract = `${contractName}-${receiver}`
|
||||
const { time, hash, sender, receiver, contractName, token, amount, offChainTransactions = [], userChoice, contractAddress } = details
|
||||
const smartContract = `${contractName}-${receiver || contractAddress}`
|
||||
const renderedOffChainTransactions = offChainTransactions.map(tx => {
|
||||
const { receiverAddress, tokenAmount, tokenIdentification } = tx
|
||||
return html`
|
||||
@ -1226,6 +1226,7 @@
|
||||
</div>
|
||||
<div class="contract-info">
|
||||
<ul class="transfer-steps">
|
||||
${sender ? html`
|
||||
<li class="transfer-step">
|
||||
<div class="flex flex-direction-column gap-0-5">
|
||||
<div class="flex flex-direction-column">
|
||||
@ -1242,8 +1243,10 @@
|
||||
<a href=${`#/contract/${smartContract}`} class="address wrap-around">${smartContract}</a>
|
||||
</div>
|
||||
</li>
|
||||
`: ''}
|
||||
${renderedOffChainTransactions}
|
||||
</ul>
|
||||
${hash ? html`
|
||||
<div class="flex align-center space-between flex-wrap gap-1">
|
||||
<div class="flex flex-direction-column">
|
||||
<h5 class="label">Transaction ID</h5>
|
||||
@ -1251,6 +1254,7 @@
|
||||
</div>
|
||||
<a href=${`#/transaction/${hash}`} class="button button--small button--colored">View details</a>
|
||||
</div>
|
||||
`: ''}
|
||||
</div>
|
||||
</li>
|
||||
`
|
||||
@ -2008,7 +2012,7 @@
|
||||
|
||||
if (!groupedTxs.has(key)) {
|
||||
groupedTxs.set(key, {
|
||||
sourceTransaction: null,
|
||||
sourceTransaction: {},
|
||||
offChainTransactions: [],
|
||||
type: transactionTrigger ? 'compoundTransaction' : undefined,
|
||||
});
|
||||
@ -2017,12 +2021,18 @@
|
||||
if (hash) {
|
||||
groupedTxs.get(key).sourceTransaction = tx;
|
||||
} else {
|
||||
const { tokenIdentification, senderAddress, receiverAddress, onChain, tokenAmount } = tx;
|
||||
const { tokenIdentification, senderAddress, receiverAddress, onChain, tokenAmount, time, contractName } = tx;
|
||||
groupedTxs.get(key).offChainTransactions.push({
|
||||
tokenIdentification,
|
||||
receiverAddress,
|
||||
tokenAmount,
|
||||
});
|
||||
if (time)
|
||||
groupedTxs.get(key).sourceTransaction.time = time
|
||||
if (contractName)
|
||||
groupedTxs.get(key).sourceTransaction.contractName = contractName
|
||||
if (senderAddress)
|
||||
groupedTxs.get(key).sourceTransaction.contractAddress = senderAddress
|
||||
}
|
||||
});
|
||||
|
||||
@ -2232,7 +2242,6 @@
|
||||
}
|
||||
|
||||
async function getContractDeposits(contract) {
|
||||
console.log(`${floGlobals.tokenApiUrl}/api/v2/smartContractDeposits?contractName=${contract.name}&contractAddress=${contract.address}`)
|
||||
const deposits = await fetchJson(`${floGlobals.tokenApiUrl}/api/v2/smartContractDeposits?contractName=${contract.name}&contractAddress=${contract.address}`)
|
||||
return deposits.depositInfo
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user