Fix swap detection: include internal category as native transfers

This commit is contained in:
2026-05-24 05:00:47 +08:00
parent 6d32c91fb3
commit 13a9d3a8a6
+4 -4
View File
@@ -226,17 +226,17 @@ async function pairTransfers(
const combined: TxEntry[] = [] const combined: TxEntry[] = []
for (const [, group] of byHash) { for (const [, group] of byHash) {
const external = group.filter( const native = group.filter(
(t: any) => t.category === 'external', (t: any) => t.category === 'external' || t.category === 'internal',
) )
const tokens = group.filter( const tokens = group.filter(
(t: any) => t.category === 'erc20', (t: any) => t.category === 'erc20',
) )
const extOut = external.filter( const extOut = native.filter(
(t: any) => t.from?.toLowerCase() === addrLower, (t: any) => t.from?.toLowerCase() === addrLower,
) )
const extIn = external.filter( const extIn = native.filter(
(t: any) => t.to?.toLowerCase() === addrLower, (t: any) => t.to?.toLowerCase() === addrLower,
) )
const tokIn = tokens.filter( const tokIn = tokens.filter(