Skip to content

Commit

Permalink
fix opensea bug: exclude NFT
Browse files Browse the repository at this point in the history
  • Loading branch information
g1nt0ki committed Nov 23, 2024
1 parent ac5a24f commit a108a2a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions fees/opensea/seaport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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())) {
Expand Down

0 comments on commit a108a2a

Please sign in to comment.