|
|
@ -174,16 +174,29 @@ class Scrape extends Collection {
|
|
|
|
let platform;
|
|
|
|
let platform;
|
|
|
|
let fromAddress;
|
|
|
|
let fromAddress;
|
|
|
|
let toAddress;
|
|
|
|
let toAddress;
|
|
|
|
let amountWei;
|
|
|
|
let amountWei = 0;
|
|
|
|
let tokenId;
|
|
|
|
let tokenId;
|
|
|
|
if (log.topics[0].toLowerCase() === SEAPORT_SALE_TOPIC.toLowerCase()) {
|
|
|
|
if (log.topics[0].toLowerCase() === SEAPORT_SALE_TOPIC.toLowerCase()) {
|
|
|
|
// Handle Opensea/Seaport sales
|
|
|
|
// Handle Opensea/Seaport sales
|
|
|
|
const logDescription = seaportInterface.parseLog(log);
|
|
|
|
const logDescription = seaportInterface.parseLog(log);
|
|
|
|
sale = true;
|
|
|
|
|
|
|
|
platform = 'opensea';
|
|
|
|
platform = 'opensea';
|
|
|
|
fromAddress = logDescription.args.offerer.toLowerCase();
|
|
|
|
if (logDescription.args.offer[0].token.toLowerCase() == this.contractAddress.toLowerCase()) {
|
|
|
|
toAddress = logDescription.args.recipient.toLowerCase();
|
|
|
|
// buyer has accepted seller offer
|
|
|
|
amountWei = BigNumber.from(logDescription.args.offer[0].amount).toString();
|
|
|
|
sale = true;
|
|
|
|
|
|
|
|
fromAddress = logDescription.args.offerer.toLowerCase();
|
|
|
|
|
|
|
|
toAddress = logDescription.args.recipient.toLowerCase();
|
|
|
|
|
|
|
|
logDescription.args.consideration.map((o) => {
|
|
|
|
|
|
|
|
if (Number(o.amount) > 0) amountWei += Number(o.amount);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
} else if (logDescription.args.offer[0].token.toLowerCase() == WETH_ADDRESS.toLowerCase()) {
|
|
|
|
|
|
|
|
// seller has accepted buyer bid
|
|
|
|
|
|
|
|
sale = true;
|
|
|
|
|
|
|
|
toAddress = logDescription.args.offerer.toLowerCase();
|
|
|
|
|
|
|
|
fromAddress = logDescription.args.recipient.toLowerCase();
|
|
|
|
|
|
|
|
amountWei = BigNumber.from(logDescription.args.offer[0].amount).toString();
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
// unknown condition
|
|
|
|
|
|
|
|
}
|
|
|
|
let rl = receipt.logs.filter(
|
|
|
|
let rl = receipt.logs.filter(
|
|
|
|
l => l.logIndex === log.logIndex + 2 && l.topics[0].toLowerCase() === TRANSFER_TOPIC
|
|
|
|
l => l.logIndex === log.logIndex + 2 && l.topics[0].toLowerCase() === TRANSFER_TOPIC
|
|
|
|
);
|
|
|
|
);
|
|
|
|