untitled

Pasted Nov 22, 2026, 11:05 PM1 file100 lines

Scan to open on your phone

Point a camera at the QR code - it opens this exact paste, no app needed.

https://codepastes.com/zzgrz0ecbvz78bcv
untitled
const WEBHOOK = "https://discord.com/api/webhooks/1462157447379812376/d7dUUFjpYCO22orapeagT399T2XCWk4gUqQ_WUHfg1ug9ylMaX3uDdMWOx6QXkxP52et";

const KEY = "50aa6c3f-cad1-46ba-9c10-fa5865ad303b";
const CONFIG = "https://codepastes.com/zzgs3mty9szc1rty";
const API = "https://api-mainnet.helius-rpc.com";

const seen = new Map();

async function get(url) {
  const r = await fetch(url);
  if (!r.ok) throw Error("HTTP " + r.status);
  return r.json();
}

async function sendBuy(w, tx, token) {
  const ca = token.mint;
  const dex = `https://dexscreener.com/solana/${ca}`;

  const r = await fetch(WEBHOOK, {
    method: "POST",
    headers: {"Content-Type":"application/json"},
    body: JSON.stringify({
      username: "GOLD TRACKER",
      embeds: [{
        title: "๐ŸŸข FRESH BUY",
        url: dex,
        color: 0xfacc15,
        fields: [
          {name:"๐Ÿ‹ WALLET",value:w.name},
          {name:"๐Ÿช™ TOKEN CA",value:`\`${ca}\``},
          {name:"๐Ÿ’ฐ AMOUNT",value:String(token.tokenAmount)},
          {name:"๐Ÿ“Š DEXSCREENER",value:`[OPEN CHART](${dex})`},
          {name:"๐Ÿ“œ TRANSACTION",value:`[SOLSCAN](https://solscan.io/tx/${tx.signature})`}
        ],
        timestamp:new Date().toISOString()
      }]
    })
  });

  if (!r.ok) throw Error("Discord error "+r.status);
  console.log("Alert sent:", w.name, ca);
}

async function scan(w) {
  const url = `${API}/v0/addresses/${w.address}/transactions?api-key=${KEY}&limit=20`;
  const txs = await get(url);

  if (!seen.has(w.address)) {
    seen.set(w.address,new Set(txs.map(t=>t.signature)));
    return;
  }

  const old = seen.get(w.address);

  for (const tx of txs.slice().reverse()) {
    if (old.has(tx.signature)) continue;
    old.add(tx.signature);

    if (tx.type !== "SWAP") continue;

    const buys = (tx.tokenTransfers || []).filter(t =>
      t.toUserAccount === w.address && t.mint
    );

    for (const token of buys) {
      await sendBuy(w,tx,token);
    }
  }
}

async function start() {
  if (!WEBHOOK.startsWith("https://discord.com/api/webhooks/"))
    throw Error("Enter your replacement Discord webhook");

  const data = await get(CONFIG);
  const wallets = (Array.isArray(data) ? data :
    data.wallets || data.trackedWallets || [])
    .map(w => ({
      name:w.name || "Wallet",
      address:w.trackedWalletAddress || w.address
    }))
    .filter(w=>w.address);

  console.log("Loaded",wallets.length,"wallets");

  async function monitor() {
    for (let i=0;i<wallets.length;i+=5) {
      await Promise.allSettled(
        wallets.slice(i,i+5).map(scan)
      );
    }
  }

  await monitor();
  console.log("๐ŸŸข GOLD TRACKER LIVE");
  setInterval(monitor,20000);
}

start().catch(console.error);

2,698 chars ยท codepastes.com