Skip to content

Commit 1552bf9

Browse files
authored
pull address_to from change instead of top-level address_to (#6052)
1 parent 4fefea8 commit 1552bf9

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/parsers/transactions.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,16 @@ export const parseTransaction = async (
113113
iconUrl: meta.contract_icon_url,
114114
};
115115

116+
// NOTE: For send transactions, the to address should be pulled from the outgoing change directly, not the txn.address_to
117+
let to = txn.address_to;
118+
if (meta.type === 'send') {
119+
to = txn.changes.find(change => change?.direction === 'out')?.address_to ?? txn.address_to;
120+
}
121+
116122
return {
117123
chainId,
118124
from: txn.address_from,
119-
to: txn.address_to,
125+
to,
120126
title: `${type}.${status}`,
121127
description,
122128
hash,

0 commit comments

Comments
 (0)