From e3dd2c476fcffe7024f4f606d6065ed93fd80dfe Mon Sep 17 00:00:00 2001 From: Marco van Dijk Date: Fri, 4 Mar 2022 17:27:22 +0100 Subject: [PATCH] Separate complex events as migrations, which they might not be but probably are --- src/eventButton.js | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/src/eventButton.js b/src/eventButton.js index 745350f..088f13d 100644 --- a/src/eventButton.js +++ b/src/eventButton.js @@ -12,6 +12,7 @@ const updateColour = "rgba(122, 63, 23, 0.3)"; const withdrawStakeColour = "rgba(102, 3, 10, 0.3)"; const stakeColour = "rgba(71, 23, 122, 0.3)"; const claimColour = "rgba(77, 91, 42, 0.3)"; +const migrateColour = "rgba(56, 23, 122, 0.3)"; const thresholdStaking = 0.001; const thresholdFees = 0.00009; @@ -49,7 +50,7 @@ const EventButton = (obj) => { transactionTo = eventObj.data.newDelegate.toLowerCase(); transactionAmount = parseFloat(eventObj.data.bondedAmount) / 1000000000000000000; transactionAdditionalAmount = parseFloat(eventObj.data.additionalAmount) / 1000000000000000000; - if (hasEarningsClaimed){ + if (hasEarningsClaimed) { transactionName = "Stake"; hasEarningsClaimed = false; console.log("COMPLEX BOND " + thisURL); @@ -85,13 +86,13 @@ const EventButton = (obj) => { transactionCaller = eventObj.data.delegator.toLowerCase(); transactionAmount = parseFloat(eventObj.data.amount) / 1000000000000000000; } - if (hasEarningsClaimed){ - transactionName = "Rebond"; + if (hasEarningsClaimed) { + transactionName = "Migrate"; hasEarningsClaimed = false; transactionTo = eventObj.data.delegate.toLowerCase(); transactionCaller = eventObj.data.delegator.toLowerCase(); transactionAmount = parseFloat(eventObj.data.amount) / 1000000000000000000; - thisColour = stakeColour; + thisColour = migrateColour; } hasRebondTransaction = true; } @@ -155,6 +156,9 @@ const EventButton = (obj) => { // If we only had a bond transaction and nothing else, this is a stake if (hasBondTransaction) { + if (transactionName === "Migrate"){ + console.log("overwr"); + } transactionName = "Stake"; thisColour = stakeColour; } @@ -214,6 +218,12 @@ const EventButton = (obj) => { } count++; } + if (obj.stakeActivated) { + if (transactionName === "Migrate") { + isFiltered = false; + } + count++; + } if (obj.delegatorRewardActivated) { if (transactionName === "Claim") { isFiltered = false; @@ -281,11 +291,17 @@ const EventButton = (obj) => { } } else if (transactionName === "Rebond") { - eventSpecificInfo = -
-

increased their stake with {transactionAmount.toFixed(2)} LPT at

- -
+ eventSpecificInfo = +
+

increased their stake with {transactionAmount.toFixed(2)} LPT at

+ +
+ } else if (transactionName === "Migrate") { + eventSpecificInfo = +
+

migrated {transactionAmount.toFixed(2)} LPT to L2 at

+ +
} else if (transactionName === "Withdraw") { eventSpecificInfo =