Bug fixes

This commit is contained in:
sairaj mote 2023-04-15 15:49:13 +05:30
parent 8334337b75
commit d22c6b03e2

View File

@ -412,14 +412,14 @@
case 'tokenswap': case 'tokenswap':
renderElem( renderElem(
document.getElementById('participant_container'), document.getElementById('participant_container'),
html`${ html`${Object.keys(contractParticipants)
Object.keys(contractParticipants) .map(participant => render.participantCard({
.map(participant => render.participantCard({ accepting_token: contractInfo.accepting_token,
accepting_token: contractInfo.accepting_token, selling_token: contractInfo.selling_token,
selling_token: contractInfo.selling_token, ...contractParticipants[participant]
...contractParticipants[participant]} }
)) ))
}` }`
) )
break; break;
default: default:
@ -722,14 +722,20 @@
<h5 class="label">Sender</h5> <h5 class="label">Sender</h5>
<a href=${`#/address/${sender}`} class="address wrap-around">${sender}</a> <a href=${`#/address/${sender}`} class="address wrap-around">${sender}</a>
</div> </div>
<div class="flex flex-direction-column"> ${receiver ? html`
<h5 class="label">Receiver</h5> <div class="flex flex-direction-column">
<a href=${`#/address/${receiver}`} class="address wrap-around">${receiver}</a> <h5 class="label">Receiver</h5>
</div> <a href=${`#/address/${receiver}`} class="address wrap-around">${receiver}</a>
<div class="flex flex-direction-column"> </div>
<h5 class="label">Amount</h5> `: ''
<h4>${formatAmount(amount, 'usd')}</h4> }
</div> ${amount ? html`
<div class="flex flex-direction-column">
<h5 class="label">Amount</h5>
<h4>${formatAmount(amount, 'usd')}</h4>
</div>
`: ''
}
</div> </div>
<div class="card"> <div class="card">
<h5 class="label">FLO Data</h5> <h5 class="label">FLO Data</h5>
@ -944,8 +950,8 @@
</div> </div>
`; `;
}, },
participantCard(details){ participantCard(details) {
const {participantFloAddress, participationAmount,swapAmount,swapPrice,transactionHash,accepting_token, selling_token} = details; const { participantFloAddress, participationAmount, swapAmount, swapPrice, transactionHash, accepting_token, selling_token } = details;
return html` return html`
<li class="flex align-center flex-wrap participant"> <li class="flex align-center flex-wrap participant">
<a href=${`#/address/${participantFloAddress}`} class="address wrap-around">${participantFloAddress}</a> swapped <a href=${`#/address/${participantFloAddress}`} class="address wrap-around">${participantFloAddress}</a> swapped
@ -1532,8 +1538,8 @@
let transactionHash = transaction.transactionHash, let transactionHash = transaction.transactionHash,
{ flodata, tokenAmount, tokenIdentification, type, nftHash } = transaction.parsedFloData, { flodata, tokenAmount, tokenIdentification, type, nftHash } = transaction.parsedFloData,
{ blockheight, vin, vout, confirmations } = transaction.transactionDetails; { blockheight, vin, vout, confirmations } = transaction.transactionDetails;
let receiver = "", let sender = vin[0].addr;
sender = vin[0].addr; let receiver = sender
for (let i = 0; i < vout.length; i++) { for (let i = 0; i < vout.length; i++) {
if (vout[i]["scriptPubKey"]["addresses"][0] !== vin[0]["addr"]) { if (vout[i]["scriptPubKey"]["addresses"][0] !== vin[0]["addr"]) {
receiver = vout[i]["scriptPubKey"]["addresses"][0]; receiver = vout[i]["scriptPubKey"]["addresses"][0];