1
0
mirror of https://github.com/mortdeus/legacy-cc.git synced 2026-10-08 11:52:22 +00:00
Files
mortdeus_legacy-cc/1_solana sniper bot(node) using gRPC/index.js
cryptoking1106 086ec82844 init
2025-09-18 18:12:50 -03:00

29 lines
673 B
JavaScript

import { pump_geyser } from "./main.js";
import dotenv from "dotenv";
dotenv.config()
const privateKey = process.env.PRIVATE_KEY; // Use private key directly
if (!privateKey) {
console.error("Error: PRIVATE_KEY is not set in environment variables.");
process.exit(1);
}
(async () => {
try {
const { getBalance } = await import("./swap.js");
const balance = await getBalance();
if (balance < 1) {
console.error("Error: Wallet balance is below 1 SOL. Current balance:", balance, "SOL");
process.exit(1);
}
} catch (err) {
console.error("Error checking wallet balance:", err.message);
process.exit(1);
}
})();
pump_geyser()