Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Track solanart bid purchase (Plus other various update) #20

Merged
merged 9 commits into from
Jan 5, 2022
Prev Previous commit
Next Next commit
Update purchase message to show bidding
  • Loading branch information
kryptoj committed Jan 3, 2022
commit e2626bd8d9a5d9c1a1a8e08acea1043b92b9141c
11 changes: 6 additions & 5 deletions src/lib/discord/notifyDiscordSale.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Discord, { MessageEmbed, TextChannel } from "discord.js";
import { NFTSale } from "lib/marketplaces";
import { NFTSale, SaleMethod } from "lib/marketplaces";

const status: {
totalNotified: number;
Expand All @@ -20,11 +20,12 @@ export default async function notifyDiscordSale(
if (!client.isReady()) {
return;
}

const { marketplace, nftData } = nftSale;
const description = `Sold for ${nftSale.getPriceInSOL()} S◎L at ${
marketplace.name
}`;

const description = `Sold ${
nftSale.method === SaleMethod.Bid ? "via bidding " : ""
}for ${nftSale.getPriceInSOL()} S◎L at ${marketplace.name}`;

const embedMsg = new MessageEmbed({
color: "#0099ff",
title: nftData?.name,
Expand Down
1 change: 1 addition & 0 deletions src/lib/marketplaces/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {
ParsedConfirmedTransaction,
ParsedConfirmedTransactionMeta,
ParsedInstruction,
TokenBalance,
} from "@solana/web3.js";
import { Marketplace, NFTSale, SaleMethod, Transfer } from "./types";
import { LamportPerSOL } from "../solana";
Expand Down