fix: show own labelled address for swap transactions (closes #55) #57
@@ -186,8 +186,12 @@ function renderTransactions(txs) {
|
|||||||
let html = "";
|
let html = "";
|
||||||
let i = 0;
|
let i = 0;
|
||||||
for (const tx of txs) {
|
for (const tx of txs) {
|
||||||
|
// For swap transactions, show the user's own labelled wallet
|
||||||
|
// address instead of the contract address (see issue #55).
|
||||||
const counterparty =
|
const counterparty =
|
||||||
tx.direction === "sent" || tx.direction === "contract"
|
tx.direction === "contract" && tx.directionLabel === "Swap"
|
||||||
|
? tx.from
|
||||||
|
: tx.direction === "sent" || tx.direction === "contract"
|
||||||
? tx.to
|
? tx.to
|
||||||
: tx.from;
|
: tx.from;
|
||||||
const ensName = ensNameMap.get(counterparty) || null;
|
const ensName = ensNameMap.get(counterparty) || null;
|
||||||
|
|||||||
@@ -103,8 +103,13 @@ function renderHomeTxList(ctx) {
|
|||||||
let html = "";
|
let html = "";
|
||||||
let i = 0;
|
let i = 0;
|
||||||
for (const tx of homeTxs) {
|
for (const tx of homeTxs) {
|
||||||
|
// For swap transactions, show the user's own labelled wallet
|
||||||
|
// address (the one that initiated the swap) instead of the
|
||||||
|
// contract address which is not useful in the list view.
|
||||||
const counterparty =
|
const counterparty =
|
||||||
tx.direction === "sent" || tx.direction === "contract"
|
tx.direction === "contract" && tx.directionLabel === "Swap"
|
||||||
|
? tx.from
|
||||||
|
: tx.direction === "sent" || tx.direction === "contract"
|
||||||
? tx.to
|
? tx.to
|
||||||
: tx.from;
|
: tx.from;
|
||||||
const dirLabel = tx.directionLabel;
|
const dirLabel = tx.directionLabel;
|
||||||
|
|||||||
Reference in New Issue
Block a user