Skip to content

Commit bae2b7c

Browse files
committed
fix: prioritize sender role over receiver, for escrows between same address.
1 parent 68d836e commit bae2b7c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/hooks/useTransactions.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,10 @@ export function useTransactions() {
223223
blockTimestamps[index],
224224
contractAddress,
225225
metaEvidence,
226-
metaEvidence?.aliases[address],
226+
//For escrows between same address, metaevidence.aliases will priorize the receiver role, but the actions will be based on the sender role, so the below check is better for clarity
227+
metaEvidence.sender.toLowerCase() === address.toLowerCase()
228+
? "sender"
229+
: "receiver",
227230
tx.result[tx.result.length - 1] as number, //status
228231
tx.result[2].toString(), //amount in escrow
229232
tx.result[tx.result.length - 2] as number //last interaction

0 commit comments

Comments
 (0)