From a108a2a45e3be4c103e282de39208111c75e5ce9 Mon Sep 17 00:00:00 2001 From: g1nt0ki <99907941+g1nt0ki@users.noreply.github.com> Date: Sat, 23 Nov 2024 18:11:18 +0100 Subject: [PATCH] fix opensea bug: exclude NFT --- fees/opensea/seaport.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/fees/opensea/seaport.ts b/fees/opensea/seaport.ts index 99a0255282..2fa7a0b71b 100644 --- a/fees/opensea/seaport.ts +++ b/fees/opensea/seaport.ts @@ -31,10 +31,11 @@ export const fetch = async ({ createBalances, getLogs, chain, }: FetchOptions) = const logs = await getLogs({ targets: seaports, eventAbi: event_order_fulfilled, }) logs.forEach(log => { - if (log.consideration.length < 2) return; - const biggestValue = log.consideration.reduce((a: any, b: any) => a.amount > b.amount ? a : b) + const recipients = log.consideration.filter((i: any) => +i.itemType.toString() < 2) // exclude NFTs (ERC721 and ERC1155) + if (recipients.length < 2) return; + const biggestValue = recipients.reduce((a: any, b: any) => a.amount > b.amount ? a : b) - log.consideration.forEach((consideration: any) => { + recipients.forEach((consideration: any) => { if (consideration.recipient === biggestValue.recipient) return; // this is sent to the NFT owner, rest are fees dailyFees.add(consideration.token, consideration.amount) if (feeCollectorSet.has(consideration.recipient.toLowerCase())) {