pump-kit 0.0.7 → 0.1.0

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.
package/README.md CHANGED
@@ -16,16 +16,24 @@
16
16
  </a>
17
17
  </p>
18
18
 
19
- A lightweight TypeScript SDK for Pump.fun that handles all the lamport math for you. Work with human-readable SOL amounts, token counts, and wallet percentages.
19
+ A TypeScript SDK for Pump.fun built on **Solana Kit 5.0**. Designed for high-performance applications including launch bots, bundlers, and low-latency trading systems using latest Solana best practices.
20
+
21
+ **Production-ready package coming soon.**
20
22
 
21
23
  ## Features
22
24
 
23
- - **Human-readable inputs** – Use SOL amounts and percentages instead of lamports
25
+ - **Solana Kit 5.0** – Built on the latest Solana development framework
26
+ - **Modern transaction patterns** – Optimized for speed and reliability
27
+ - **Unified swaps** – `buy`/`sell` auto-route between bonding curves and AMM pools
28
+ - **Curve helpers** – Direct access to bonding-curve instructions when you need them (`curveBuy`, `curveSell`)
29
+ - **AMM helpers** – Deterministic AMM operations with percentage-aware selling (`ammBuy`, `ammSell`)
24
30
  - **Automatic slippage protection** – Built-in guards for buy/sell operations
25
- - **Token launches** – Create and buy tokens in one transaction
26
- - **Liquidity management** – Add/remove liquidity with simple helpers
27
- - **Full TypeScript support** – Strong types throughout
28
- - **Bun-optimized** – Built and tested with Bun
31
+ - **Full TypeScript support** – Strongly typed throughout with complete type coverage
32
+
33
+ ### Coming Soon
34
+
35
+ - **Launch & mint helpers** – Create and seed new Pump.fun tokens once integration is ready
36
+ - **Liquidity tooling** – Add/remove liquidity with tested helpers
29
37
 
30
38
  ---
31
39
 
@@ -47,12 +55,12 @@ import { createSolanaRpc } from "@solana/kit";
47
55
  const rpc = createSolanaRpc("https://api.mainnet-beta.solana.com");
48
56
  ```
49
57
 
50
- ### Buy Tokens
58
+ ### Buy Tokens (Curve)
51
59
 
52
60
  ```ts
53
- import { buy } from "pump-kit";
61
+ import { curveBuy } from "pump-kit";
54
62
 
55
- await buy({
63
+ await curveBuy({
56
64
  user: myWallet,
57
65
  mint: "TokenMintAddress",
58
66
  solAmount: 0.5, // 0.5 SOL
@@ -61,13 +69,13 @@ await buy({
61
69
  });
62
70
  ```
63
71
 
64
- ### Sell Tokens
72
+ ### Sell Tokens (Curve)
65
73
 
66
74
  ```ts
67
- import { sell } from "pump-kit";
75
+ import { curveSell } from "pump-kit";
68
76
 
69
77
  // Sell specific amount
70
- await sell({
78
+ await curveSell({
71
79
  user: myWallet,
72
80
  mint: "TokenMintAddress",
73
81
  tokenAmount: 125_000,
@@ -75,7 +83,7 @@ await sell({
75
83
  });
76
84
 
77
85
  // Sell percentage of wallet
78
- await sell({
86
+ await curveSell({
79
87
  user: myWallet,
80
88
  mint: "TokenMintAddress",
81
89
  useWalletPercentage: true,
@@ -84,68 +92,95 @@ await sell({
84
92
  });
85
93
  ```
86
94
 
87
- ### Create and Buy Token
95
+ ### Buy Tokens (AMM)
88
96
 
89
97
  ```ts
90
- import { mintWithFirstBuy } from "pump-kit";
91
- import { generateKeyPair } from "@solana/kit";
92
-
93
- const mintKeypair = await generateKeyPair();
98
+ import { buy } from "pump-kit";
94
99
 
95
- const { createInstruction, buyInstruction } = await mintWithFirstBuy({
100
+ await buy({
96
101
  user: myWallet,
97
- mint: mintKeypair,
98
- mintAuthority: myWallet.address,
99
- name: "My Token",
100
- symbol: "MTK",
101
- uri: "https://arweave.net/metadata.json",
102
- firstBuyTokenAmount: 1_000_000,
103
- firstBuySolBudget: 1.0,
102
+ mint: "TokenMintAddress",
103
+ solAmount: 0.5,
104
+ route: "amm", // force AMM routing
105
+ poolCreator: "CreatorAddress", // optional if auto detection works
104
106
  rpc,
105
107
  });
106
108
  ```
107
109
 
108
- ### Quick Helpers
110
+ > `route` defaults to `"auto"`, which prefers the bonding curve when available and falls back to the AMM after migration.
109
111
 
110
- ```ts
111
- import { quickBuy, quickSell } from "pump-kit";
112
+ ### Sell Tokens (AMM)
112
113
 
113
- // Get buy instruction
114
- const buyIx = await quickBuy(myWallet, "TokenMint", 0.25, { rpc });
114
+ ```ts
115
+ import { sell } from "pump-kit";
115
116
 
116
- // Get sell instruction
117
- const sellIx = await quickSell(myWallet, "TokenMint", 100_000, { rpc });
117
+ await sell({
118
+ user: myWallet,
119
+ mint: "TokenMintAddress",
120
+ useWalletPercentage: true,
121
+ walletPercentage: 50,
122
+ route: "amm",
123
+ poolCreator: "CreatorAddress",
124
+ rpc,
125
+ });
118
126
  ```
119
127
 
120
128
  ---
121
129
 
122
130
  ## API Reference
123
131
 
124
- ### Core Functions
132
+ ### Unified Swap Entry Points
125
133
 
126
134
  ```ts
127
- // Buy tokens
128
- buy({ user, mint, solAmount, slippageBps?, rpc, ... })
135
+ // Auto route (default)
136
+ buy({ user, mint, solAmount, rpc, ...options });
137
+
138
+ sell({ user, mint, tokenAmount?, useWalletPercentage?, rpc, ...options });
129
139
 
130
- // Sell tokens
131
- sell({ user, mint, tokenAmount?, useWalletPercentage?, walletPercentage?, rpc, ... })
140
+ // Force AMM routing, optionally provide pool hints
141
+ buy({ user, mint, solAmount, rpc, route: "amm", poolCreator?, poolAddress?, quoteMint? });
142
+ sell({ user, mint, route: "amm", poolCreator?, poolAddress?, quoteMint?, useWalletPercentage? });
143
+ ```
132
144
 
133
- // Quick helpers (return instructions only)
134
- quickBuy(wallet, mint, solAmount, { rpc, ...options })
135
- quickSell(wallet, mint, tokenAmount, { rpc, ...options })
145
+ ### Curve Swap Helpers
136
146
 
137
- // Create token with initial buy
138
- mintWithFirstBuy({ user, mint, name, symbol, uri, firstBuyTokenAmount, firstBuySolBudget, rpc, ... })
147
+ ```ts
148
+ // Buy tokens on the bonding curve
149
+ curveBuy({ user, mint, solAmount, slippageBps?, rpc, ... })
150
+
151
+ // Sell tokens on the bonding curve
152
+ curveSell({ user, mint, tokenAmount?, useWalletPercentage?, walletPercentage?, rpc, ... })
153
+ ```
154
+
155
+ ### AMM Swap Helpers
156
+
157
+ ```ts
158
+ // Buy tokens from the AMM pool using a SOL budget
159
+ ammBuy({ user, mint, solAmount, rpc, quoteMint?, poolCreator?, poolAddress? })
160
+
161
+ // Sell tokens into the AMM pool (supports percentage-based selling)
162
+ ammSell({
163
+ user,
164
+ mint,
165
+ tokenAmount?,
166
+ useWalletPercentage?,
167
+ walletPercentage?,
168
+ rpc,
169
+ quoteMint?,
170
+ poolCreator?,
171
+ poolAddress?,
172
+ })
139
173
  ```
140
174
 
141
- ### Liquidity Management
175
+ ### Coming Soon
142
176
 
143
177
  ```ts
144
- // Add liquidity to pool
145
- addLiquidity({ user, baseMint, quoteMint?, maxBaseAmountIn, maxQuoteAmountIn, rpc, ... })
178
+ // Create token with initial buy
179
+ mintWithFirstBuy({ ... })
146
180
 
147
- // Remove liquidity from pool
148
- removeLiquidity({ user, baseMint, quoteMint?, lpAmountIn, rpc, ... })
181
+ // Liquidity helpers
182
+ addLiquidity({ ... })
183
+ removeLiquidity({ ... })
149
184
  ```
150
185
 
151
186
  ### Transaction Utilities