-
npm i
-
Paste your private key and Helius RPC key in .env.copy
-
rename it to .env
import {wallet_1} from "./constants";
import {PumpSwapSDK} from './pumpswap';
async function main() {
const mint = "your-pumpfun-token-address";
const sol_amt = 0.99; // buy 1 SOL worth of token using WSOL
const sell_percentage = 0.5; // sell 50% of the token
const pumpswap_sdk = new PumpSwapSDK();
await pumpswap_sdk.buy(new PublicKey(mint), wallet_1.publicKey, sol_amt); // 0.99 sol
await pumpswap_sdk.sell_percentage(new PublicKey(mint), wallet_1.publicKey, sell_percentage);
await pumpswap_sdk.sell_exactAmount(new PublicKey(mint), wallet_1.publicKey, 1000); // 1000 token
}
import {getPrice} from './pool';
async function main() {
const mint = new PublicKey("your-pumpfun-token-address");
console.log(await getPrice(mint));
}
import {getPumpSwapPool} from './pool';
async function main() {
const mint = new PublicKey("your-pumpfun-token-address");
console.log(await getPumpSwapPool(mint));
}