agentpump-mcp 1.1.2 → 1.1.3

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 +11 -0
  2. package/package.json +2 -2
package/index.js CHANGED
@@ -25,7 +25,17 @@ const rpcFetch = async (u, o) => { let err; for (const url of RPCS) { try { cons
25
25
  const conn = new Connection(RPC, { commitment: "confirmed", fetch: rpcFetch });
26
26
  const [CONFIG] = PublicKey.findProgramAddressSync([Buffer.from("config")], PROGRAM);
27
27
  const V_SOL = 2500000000n, SUPPLY = 1000000000n * 1000000n;
28
+ const META = new PublicKey("metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s");
28
29
  const u64 = (n) => { const b = Buffer.alloc(8); b.writeBigUInt64LE(BigInt(n)); return b; };
30
+ const mstr = (s) => { const b = Buffer.from(s, "utf8"); const l = Buffer.alloc(4); l.writeUInt32LE(b.length); return Buffer.concat([l, b]); };
31
+ function metaIx(mint, auth, payer, name, sym) {
32
+ const [md] = PublicKey.findProgramAddressSync([Buffer.from("metadata"), META.toBuffer(), mint.toBuffer()], META);
33
+ const data = Buffer.concat([Buffer.from([33]), mstr(name), mstr(sym), mstr(""), Buffer.from([0, 0]), Buffer.from([0]), Buffer.from([0]), Buffer.from([0]), Buffer.from([1]), Buffer.from([0])]);
34
+ return new TransactionInstruction({ programId: META, keys: [
35
+ { pubkey: md, isSigner: false, isWritable: true }, { pubkey: mint, isSigner: false, isWritable: false }, { pubkey: auth, isSigner: true, isWritable: false },
36
+ { pubkey: payer, isSigner: true, isWritable: true }, { pubkey: auth, isSigner: false, isWritable: false }, { pubkey: SystemProgram.programId, isSigner: false, isWritable: false },
37
+ ], data });
38
+ }
29
39
  const WDIR = join(homedir(), ".agentpump"), WFILE = join(WDIR, "wallet.json");
30
40
  const curveOf = (m) => PublicKey.findProgramAddressSync([Buffer.from("curve"), m.toBuffer()], PROGRAM)[0];
31
41
  const ataOf = (m, o) => getAssociatedTokenAddressSync(m, o, true);
@@ -69,6 +79,7 @@ s.tool("sol_balance", "Check the wallet's SOL balance.", {}, { title: "Balance",
69
79
  });
70
80
  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 }) => {
71
81
  const kp = loadKp(); const mint = await createMint(conn, kp, kp.publicKey, null, 6); // returns a PublicKey
82
+ await sendAndConfirmTransaction(conn, new Transaction().add(metaIx(mint, kp.publicKey, kp.publicKey, name, symbol)), [kp]); // on-chain name/symbol so it shows on the launchpad
72
83
  const curve = curveOf(mint), cAta = ataOf(mint, curve);
73
84
  await sendAndConfirmTransaction(conn, new Transaction().add(createAssociatedTokenAccountIdempotentInstruction(kp.publicKey, cAta, curve, mint)), [kp]);
74
85
  await mintTo(conn, kp, mint, cAta, kp, SUPPLY);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentpump-mcp",
3
- "version": "1.1.2",
3
+ "version": "1.1.3",
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": {
@@ -37,4 +37,4 @@
37
37
  "zod": "^3.23.8"
38
38
  },
39
39
  "mcpName": "io.github.axiosdevs/agentpump-mcp"
40
- }
40
+ }