fix collection bugs in seaport

master
lza_menace 2 years ago
parent 807fb13e9d
commit 8cbfb69504

@ -188,11 +188,7 @@ class Scrape extends Collection {
logDescription.args.consideration.map((o) => { logDescription.args.consideration.map((o) => {
if (Number(o.amount) > 0) amountWei += Number(o.amount); if (Number(o.amount) > 0) amountWei += Number(o.amount);
}); });
receipt.logs.filter( amountWei = amountWei.toString();
l => l.logIndex === log.logIndex + 2 && l.topics[0].toLowerCase() === TRANSFER_TOPIC
).map((t) => {
tokenId = BigInt(t.topics[3]);
});
} else if (logDescription.args.offer[0].token.toLowerCase() == WETH_ADDRESS.toLowerCase()) { } else if (logDescription.args.offer[0].token.toLowerCase() == WETH_ADDRESS.toLowerCase()) {
// seller has accepted buyer bid // seller has accepted buyer bid
sale = true; sale = true;
@ -207,6 +203,8 @@ class Scrape extends Collection {
} else { } else {
// unknown condition // unknown condition
} }
let rl = logDescription.args.offer.filter((l) => l.token.toLowerCase() === this.contractAddress.toLowerCase());
if (rl.length > 0) tokenId = rl[0].identifier.toString();
} else if (log.topics[0].toLowerCase() === WYVERN_SALE_TOPIC.toLowerCase()) { } else if (log.topics[0].toLowerCase() === WYVERN_SALE_TOPIC.toLowerCase()) {
// Handle Opensea/Wyvern sales // Handle Opensea/Wyvern sales
let txEventType = TRANSFER_TOPIC.toLowerCase(); let txEventType = TRANSFER_TOPIC.toLowerCase();

Loading…
Cancel
Save