From 2798df46bf52a1d3af8a7bda12fdd6e947a6a124 Mon Sep 17 00:00:00 2001 From: Matthew Wall Date: Wed, 28 Aug 2024 11:21:41 -0400 Subject: [PATCH] pull address_to from change instead of top-level address_to --- src/parsers/transactions.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/parsers/transactions.ts b/src/parsers/transactions.ts index 495ff7ba0c4..d02037c2cd8 100644 --- a/src/parsers/transactions.ts +++ b/src/parsers/transactions.ts @@ -113,10 +113,16 @@ export const parseTransaction = async ( iconUrl: meta.contract_icon_url, }; + // NOTE: For send transactions, the to address should be pulled from the outgoing change directly, not the txn.address_to + let to = txn.address_to; + if (meta.type === 'send') { + to = txn.changes.find(change => change?.direction === 'out')?.address_to ?? txn.address_to; + } + return { chainId, from: txn.address_from, - to: txn.address_to, + to, title: `${type}.${status}`, description, hash,