agentpump-mcp 1.1.0 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +8 -6
  2. package/package.json +6 -4
package/index.js CHANGED
@@ -20,7 +20,9 @@ import { mkdirSync, readFileSync, writeFileSync, existsSync, chmodSync } from "f
20
20
  const RPC = process.env.AGENTPUMP_RPC || "https://mainnet.helius-rpc.com/?api-key=397a9216-3198-4f6b-8304-0bf3f62cf5bd";
21
21
  const PROGRAM = new PublicKey("4M93xdyduoYj4W7LaLRmXrk5PqyGD6SoxzX8CwdKe3VM");
22
22
  const FEE = new PublicKey("2tGTwpzcLLgp6D33Sns4cMZuz1Zg6rBnzjt3taqTmZz6");
23
- const conn = new Connection(RPC, "confirmed");
23
+ const RPCS = [RPC, "https://solana-rpc.publicnode.com", "https://api.mainnet-beta.solana.com"].filter((v,i,a)=>a.indexOf(v)===i);
24
+ const rpcFetch = async (u, o) => { let err; for (const url of RPCS) { try { const r = await fetch(url, o); if (r.status === 429 || r.status >= 500) { err = new Error("rpc " + r.status); continue; } return r; } catch (e) { err = e; } } throw err; };
25
+ const conn = new Connection(RPC, { commitment: "confirmed", fetch: rpcFetch });
24
26
  const [CONFIG] = PublicKey.findProgramAddressSync([Buffer.from("config")], PROGRAM);
25
27
  const V_SOL = 2500000000n, SUPPLY = 1000000000n * 1000000n;
26
28
  const u64 = (n) => { const b = Buffer.alloc(8); b.writeBigUInt64LE(BigInt(n)); return b; };
@@ -66,16 +68,16 @@ s.tool("sol_balance", "Check the wallet's SOL balance.", {}, { title: "Balance",
66
68
  const kp = loadKp(); const b = await conn.getBalance(kp.publicKey); return ok((b / LAMPORTS_PER_SOL).toFixed(4) + " SOL\n" + kp.publicKey.toBase58());
67
69
  });
68
70
  s.tool("sol_launch", "Launch a new token on AgentPump (bonding curve). Costs ~0.02 SOL in rent.", { name: z.string(), symbol: z.string() }, { title: "Launch token", readOnlyHint: false, openWorldHint: true }, async ({ name, symbol }) => {
69
- const kp = loadKp(); const mint = await createMint(conn, kp, kp.publicKey, null, 6);
70
- const curve = curveOf(mint.publicKey), cAta = ataOf(mint.publicKey, curve);
71
- await sendAndConfirmTransaction(conn, new Transaction().add(createAssociatedTokenAccountIdempotentInstruction(kp.publicKey, cAta, curve, mint.publicKey)), [kp]);
71
+ const kp = loadKp(); const mint = await createMint(conn, kp, kp.publicKey, null, 6); // returns a PublicKey
72
+ const curve = curveOf(mint), cAta = ataOf(mint, curve);
73
+ await sendAndConfirmTransaction(conn, new Transaction().add(createAssociatedTokenAccountIdempotentInstruction(kp.publicKey, cAta, curve, mint)), [kp]);
72
74
  await mintTo(conn, kp, mint, cAta, kp, SUPPLY);
73
75
  const ix = new TransactionInstruction({ programId: PROGRAM, data: Buffer.concat([Buffer.from([1]), u64(V_SOL), u64(SUPPLY)]), keys: [
74
- { pubkey: CONFIG, isSigner: false, isWritable: true }, { pubkey: curve, isSigner: false, isWritable: true }, { pubkey: mint.publicKey, isSigner: false, isWritable: false },
76
+ { pubkey: CONFIG, isSigner: false, isWritable: true }, { pubkey: curve, isSigner: false, isWritable: true }, { pubkey: mint, isSigner: false, isWritable: false },
75
77
  { pubkey: cAta, isSigner: false, isWritable: true }, { pubkey: kp.publicKey, isSigner: true, isWritable: true }, { pubkey: SystemProgram.programId, isSigner: false, isWritable: false },
76
78
  ] });
77
79
  await sendAndConfirmTransaction(conn, new Transaction().add(ix), [kp]);
78
- return ok(`Launched ${symbol}. Token: ${mint.publicKey.toBase58()}\nTradeable on the curve; graduates to Raydium at 10 SOL.`);
80
+ return ok(`Launched ${symbol}. Token: ${mint.toBase58()}\nTradeable on the curve; graduates to Raydium at 10 SOL.`);
79
81
  });
80
82
  s.tool("sol_buy", "Buy a token on its bonding curve (pre-graduation). For graduated tokens use sol_raydium_buy.", { mint: z.string(), sol: z.number() }, { title: "Buy (curve)", readOnlyHint: false, openWorldHint: true }, async ({ mint: ms, sol: amt }) => {
81
83
  const kp = loadKp(); const mint = new PublicKey(ms); const curve = curveOf(mint), cAta = ataOf(mint, curve), uAta = ataOf(mint, kp.publicKey);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentpump-mcp",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "description": "MCP server to launch & trade tokens on AgentPump (Solana bonding-curve launchpad) from AI agents. Trade graduated tokens on Raydium.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -30,9 +30,11 @@
30
30
  "dependencies": {
31
31
  "@modelcontextprotocol/sdk": "^1.0.4",
32
32
  "@raydium-io/raydium-sdk-v2": "^0.2.56-alpha",
33
- "@solana/spl-token": "^0.4.8",
34
- "@solana/web3.js": "^1.95.3",
33
+ "@solana/spl-token": "^0.4.15",
34
+ "@solana/web3.js": "^1.98.4",
35
35
  "bn.js": "^5.2.4",
36
+ "bs58": "^6.0.0",
36
37
  "zod": "^3.23.8"
37
- }
38
+ },
39
+ "mcpName": "io.github.axiosdevs/agentpump-mcp"
38
40
  }