pump-kit 0.0.8 → 0.1.1

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 (62) hide show
  1. package/README.md +60 -45
  2. package/dist/index.js +12 -12
  3. package/dist/types/ammsdk/bondingCurveMath.d.ts +1 -1
  4. package/dist/types/ammsdk/generated/accounts/globalConfig.d.ts +4 -6
  5. package/dist/types/ammsdk/generated/accounts/index.d.ts +0 -4
  6. package/dist/types/ammsdk/generated/accounts/pool.d.ts +0 -2
  7. package/dist/types/ammsdk/generated/errors/pumpAmm.d.ts +29 -55
  8. package/dist/types/ammsdk/generated/index.d.ts +1 -1
  9. package/dist/types/ammsdk/generated/instructions/buy.d.ts +14 -67
  10. package/dist/types/ammsdk/generated/instructions/createConfig.d.ts +5 -26
  11. package/dist/types/ammsdk/generated/instructions/createPool.d.ts +12 -42
  12. package/dist/types/ammsdk/generated/instructions/deposit.d.ts +10 -33
  13. package/dist/types/ammsdk/generated/instructions/disable.d.ts +2 -16
  14. package/dist/types/ammsdk/generated/instructions/extendAccount.d.ts +2 -12
  15. package/dist/types/ammsdk/generated/instructions/index.d.ts +0 -9
  16. package/dist/types/ammsdk/generated/instructions/sell.d.ts +14 -54
  17. package/dist/types/ammsdk/generated/instructions/updateAdmin.d.ts +2 -12
  18. package/dist/types/ammsdk/generated/instructions/updateFeeConfig.d.ts +2 -22
  19. package/dist/types/ammsdk/generated/instructions/withdraw.d.ts +10 -33
  20. package/dist/types/ammsdk/generated/programs/pumpAmm.d.ts +15 -46
  21. package/dist/types/ammsdk/generated/types/buyEvent.d.ts +4 -25
  22. package/dist/types/ammsdk/generated/types/createConfigEvent.d.ts +0 -4
  23. package/dist/types/ammsdk/generated/types/createPoolEvent.d.ts +0 -2
  24. package/dist/types/ammsdk/generated/types/globalConfig.d.ts +49 -0
  25. package/dist/types/ammsdk/generated/types/index.d.ts +2 -12
  26. package/dist/types/ammsdk/generated/types/pool.d.ts +35 -0
  27. package/dist/types/ammsdk/generated/types/sellEvent.d.ts +0 -6
  28. package/dist/types/ammsdk/generated/types/updateFeeConfigEvent.d.ts +0 -4
  29. package/dist/types/clients/amm.d.ts +10 -2
  30. package/dist/types/index.d.ts +2 -2
  31. package/dist/types/pda/pumpAmm.d.ts +4 -0
  32. package/dist/types/pumpsdk/generated/index.d.ts +1 -1
  33. package/dist/types/simple.d.ts +2 -2
  34. package/dist/types/swap/amm.d.ts +35 -0
  35. package/dist/types/swap/curve.d.ts +36 -0
  36. package/dist/types/swap.d.ts +10 -49
  37. package/package.json +3 -3
  38. package/dist/types/ammsdk/generated/accounts/bondingCurve.d.ts +0 -39
  39. package/dist/types/ammsdk/generated/accounts/feeConfig.d.ts +0 -33
  40. package/dist/types/ammsdk/generated/accounts/globalVolumeAccumulator.d.ts +0 -37
  41. package/dist/types/ammsdk/generated/accounts/userVolumeAccumulator.d.ts +0 -39
  42. package/dist/types/ammsdk/generated/instructions/adminSetCoinCreator.d.ts +0 -63
  43. package/dist/types/ammsdk/generated/instructions/adminUpdateTokenIncentives.d.ts +0 -99
  44. package/dist/types/ammsdk/generated/instructions/buyExactQuoteIn.d.ts +0 -144
  45. package/dist/types/ammsdk/generated/instructions/claimTokenIncentives.d.ts +0 -86
  46. package/dist/types/ammsdk/generated/instructions/closeUserVolumeAccumulator.d.ts +0 -54
  47. package/dist/types/ammsdk/generated/instructions/collectCoinCreatorFee.d.ts +0 -70
  48. package/dist/types/ammsdk/generated/instructions/initUserVolumeAccumulator.d.ts +0 -62
  49. package/dist/types/ammsdk/generated/instructions/setCoinCreator.d.ts +0 -58
  50. package/dist/types/ammsdk/generated/instructions/syncUserVolumeAccumulator.d.ts +0 -58
  51. package/dist/types/ammsdk/generated/types/adminSetCoinCreatorEvent.d.ts +0 -27
  52. package/dist/types/ammsdk/generated/types/adminUpdateTokenIncentivesEvent.d.ts +0 -29
  53. package/dist/types/ammsdk/generated/types/claimTokenIncentivesEvent.d.ts +0 -27
  54. package/dist/types/ammsdk/generated/types/closeUserVolumeAccumulatorEvent.d.ts +0 -27
  55. package/dist/types/ammsdk/generated/types/collectCoinCreatorFeeEvent.d.ts +0 -25
  56. package/dist/types/ammsdk/generated/types/feeTier.d.ts +0 -20
  57. package/dist/types/ammsdk/generated/types/fees.d.ts +0 -21
  58. package/dist/types/ammsdk/generated/types/initUserVolumeAccumulatorEvent.d.ts +0 -21
  59. package/dist/types/ammsdk/generated/types/optionBool.d.ts +0 -13
  60. package/dist/types/ammsdk/generated/types/setBondingCurveCoinCreatorEvent.d.ts +0 -25
  61. package/dist/types/ammsdk/generated/types/setMetaplexCoinCreatorEvent.d.ts +0 -25
  62. package/dist/types/ammsdk/generated/types/syncUserVolumeAccumulatorEvent.d.ts +0 -23
package/README.md CHANGED
@@ -24,12 +24,17 @@ A TypeScript SDK for Pump.fun built on **Solana Kit 5.0**. Designed for high-per
24
24
 
25
25
  - **Solana Kit 5.0** – Built on the latest Solana development framework
26
26
  - **Modern transaction patterns** – Optimized for speed and reliability
27
- - **Human-readable API** – Work with SOL amounts and percentages instead of raw lamports
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`)
28
30
  - **Automatic slippage protection** – Built-in guards for buy/sell operations
29
- - **Launch capabilities** – Create and buy tokens in one atomic transaction
30
- - **Liquidity operations** – Add/remove liquidity with simple helpers
31
31
  - **Full TypeScript support** – Strongly typed throughout with complete type coverage
32
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
37
+
33
38
  ---
34
39
 
35
40
  ## Installation
@@ -50,12 +55,12 @@ import { createSolanaRpc } from "@solana/kit";
50
55
  const rpc = createSolanaRpc("https://api.mainnet-beta.solana.com");
51
56
  ```
52
57
 
53
- ### Buy Tokens
58
+ ### Buy Tokens (Curve)
54
59
 
55
60
  ```ts
56
- import { buy } from "pump-kit";
61
+ import { curveBuy } from "pump-kit";
57
62
 
58
- await buy({
63
+ await curveBuy({
59
64
  user: myWallet,
60
65
  mint: "TokenMintAddress",
61
66
  solAmount: 0.5, // 0.5 SOL
@@ -64,13 +69,13 @@ await buy({
64
69
  });
65
70
  ```
66
71
 
67
- ### Sell Tokens
72
+ ### Sell Tokens (Curve)
68
73
 
69
74
  ```ts
70
- import { sell } from "pump-kit";
75
+ import { curveSell } from "pump-kit";
71
76
 
72
77
  // Sell specific amount
73
- await sell({
78
+ await curveSell({
74
79
  user: myWallet,
75
80
  mint: "TokenMintAddress",
76
81
  tokenAmount: 125_000,
@@ -78,7 +83,7 @@ await sell({
78
83
  });
79
84
 
80
85
  // Sell percentage of wallet
81
- await sell({
86
+ await curveSell({
82
87
  user: myWallet,
83
88
  mint: "TokenMintAddress",
84
89
  useWalletPercentage: true,
@@ -87,68 +92,78 @@ await sell({
87
92
  });
88
93
  ```
89
94
 
90
- ### Create and Buy Token
95
+ ### Buy Tokens (AMM)
91
96
 
92
97
  ```ts
93
- import { mintWithFirstBuy } from "pump-kit";
94
- import { generateKeyPair } from "@solana/kit";
98
+ import { ammBuy } from "pump-kit";
95
99
 
96
- const mintKeypair = await generateKeyPair();
97
-
98
- const { createInstruction, buyInstruction } = await mintWithFirstBuy({
100
+ await ammBuy({
99
101
  user: myWallet,
100
- mint: mintKeypair,
101
- mintAuthority: myWallet.address,
102
- name: "My Token",
103
- symbol: "MTK",
104
- uri: "https://arweave.net/metadata.json",
105
- firstBuyTokenAmount: 1_000_000,
106
- firstBuySolBudget: 1.0,
102
+ mint: "TokenMintAddress",
103
+ solAmount: 0.5,
104
+ poolCreator: "CreatorAddress", // optional if auto detection works
107
105
  rpc,
108
106
  });
109
107
  ```
110
108
 
111
- ### Quick Helpers
109
+ ### Sell Tokens (AMM)
112
110
 
113
111
  ```ts
114
- import { quickBuy, quickSell } from "pump-kit";
112
+ import { ammSell } from "pump-kit";
115
113
 
116
- // Get buy instruction
117
- const buyIx = await quickBuy(myWallet, "TokenMint", 0.25, { rpc });
118
-
119
- // Get sell instruction
120
- const sellIx = await quickSell(myWallet, "TokenMint", 100_000, { rpc });
114
+ await ammSell({
115
+ user: myWallet,
116
+ mint: "TokenMintAddress",
117
+ useWalletPercentage: true,
118
+ walletPercentage: 100,
119
+ poolCreator: "CreatorAddress",
120
+ rpc,
121
+ });
121
122
  ```
122
123
 
123
124
  ---
124
125
 
125
126
  ## API Reference
126
127
 
127
- ### Core Functions
128
+ ### Curve Swap Helpers
128
129
 
129
130
  ```ts
130
- // Buy tokens
131
- buy({ user, mint, solAmount, slippageBps?, rpc, ... })
131
+ // Buy tokens on the bonding curve
132
+ curveBuy({ user, mint, solAmount, slippageBps?, rpc, ... })
132
133
 
133
- // Sell tokens
134
- sell({ user, mint, tokenAmount?, useWalletPercentage?, walletPercentage?, rpc, ... })
134
+ // Sell tokens on the bonding curve
135
+ curveSell({ user, mint, tokenAmount?, useWalletPercentage?, walletPercentage?, rpc, ... })
136
+ ```
135
137
 
136
- // Quick helpers (return instructions only)
137
- quickBuy(wallet, mint, solAmount, { rpc, ...options })
138
- quickSell(wallet, mint, tokenAmount, { rpc, ...options })
138
+ ### AMM Swap Helpers
139
139
 
140
- // Create token with initial buy
141
- mintWithFirstBuy({ user, mint, name, symbol, uri, firstBuyTokenAmount, firstBuySolBudget, rpc, ... })
140
+ ```ts
141
+ // Buy tokens from the AMM pool using a SOL budget
142
+ ammBuy({ user, mint, solAmount, rpc, quoteMint?, poolCreator?, poolAddress? })
143
+
144
+ // Sell tokens into the AMM pool (supports percentage-based selling)
145
+ ammSell({
146
+ user,
147
+ mint,
148
+ tokenAmount?,
149
+ useWalletPercentage?,
150
+ walletPercentage?,
151
+ rpc,
152
+ quoteMint?,
153
+ poolCreator?,
154
+ poolAddress?,
155
+ })
142
156
  ```
143
157
 
144
- ### Liquidity Management
158
+ ### Coming Soon
145
159
 
146
160
  ```ts
147
- // Add liquidity to pool
148
- addLiquidity({ user, baseMint, quoteMint?, maxBaseAmountIn, maxQuoteAmountIn, rpc, ... })
161
+ // Create token with initial buy
162
+ mintWithFirstBuy({ ... })
149
163
 
150
- // Remove liquidity from pool
151
- removeLiquidity({ user, baseMint, quoteMint?, lpAmountIn, rpc, ... })
164
+ // Liquidity helpers
165
+ addLiquidity({ ... })
166
+ removeLiquidity({ ... })
152
167
  ```
153
168
 
154
169
  ### Transaction Utilities