solana-meme-kit 0.2.4 → 0.3.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.
- package/README.md +154 -80
- package/dist/core/MemeKit.d.ts +30 -0
- package/dist/core/MemeKit.d.ts.map +1 -0
- package/dist/core/MemeKit.js +193 -0
- package/dist/core/MemeKit.js.map +1 -0
- package/dist/core/utils.d.ts +16 -0
- package/dist/core/utils.d.ts.map +1 -0
- package/dist/core/utils.js +39 -0
- package/dist/core/utils.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +16 -0
- package/dist/index.js.map +1 -0
- package/dist/managers/JitoManager.d.ts +17 -0
- package/dist/managers/JitoManager.d.ts.map +1 -0
- package/dist/managers/JitoManager.js +64 -0
- package/dist/managers/JitoManager.js.map +1 -0
- package/dist/managers/LiquidityManager.d.ts +16 -0
- package/dist/managers/LiquidityManager.d.ts.map +1 -0
- package/dist/managers/LiquidityManager.js +121 -0
- package/dist/managers/LiquidityManager.js.map +1 -0
- package/dist/managers/MarketManager.d.ts +17 -0
- package/dist/managers/MarketManager.d.ts.map +1 -0
- package/dist/managers/MarketManager.js +182 -0
- package/dist/managers/MarketManager.js.map +1 -0
- package/dist/managers/TokenManager.d.ts +18 -0
- package/dist/managers/TokenManager.d.ts.map +1 -0
- package/dist/managers/TokenManager.js +64 -0
- package/dist/managers/TokenManager.js.map +1 -0
- package/dist/strategies/LiquidityStrategy.d.ts +33 -0
- package/dist/strategies/LiquidityStrategy.d.ts.map +1 -0
- package/dist/strategies/LiquidityStrategy.js +2 -0
- package/dist/strategies/LiquidityStrategy.js.map +1 -0
- package/dist/strategies/meteora/DLMMManager.d.ts +20 -0
- package/dist/strategies/meteora/DLMMManager.d.ts.map +1 -0
- package/dist/strategies/meteora/DLMMManager.js +82 -0
- package/dist/strategies/meteora/DLMMManager.js.map +1 -0
- package/dist/strategies/meteora/index.d.ts +2 -0
- package/dist/strategies/meteora/index.d.ts.map +1 -0
- package/dist/strategies/meteora/index.js +3 -0
- package/dist/strategies/meteora/index.js.map +1 -0
- package/dist/strategies/raydium/AMMManager.d.ts +20 -0
- package/dist/strategies/raydium/AMMManager.d.ts.map +1 -0
- package/dist/strategies/raydium/AMMManager.js +96 -0
- package/dist/strategies/raydium/AMMManager.js.map +1 -0
- package/dist/strategies/raydium/CPMMManager.d.ts +20 -0
- package/dist/strategies/raydium/CPMMManager.d.ts.map +1 -0
- package/dist/strategies/raydium/CPMMManager.js +121 -0
- package/dist/strategies/raydium/CPMMManager.js.map +1 -0
- package/dist/strategies/raydium/index.d.ts +3 -0
- package/dist/strategies/raydium/index.d.ts.map +1 -0
- package/dist/strategies/raydium/index.js +4 -0
- package/dist/strategies/raydium/index.js.map +1 -0
- package/dist/utils/jitoTools.d.ts +14 -0
- package/dist/utils/jitoTools.d.ts.map +1 -0
- package/dist/utils/jitoTools.js +78 -0
- package/dist/utils/jitoTools.js.map +1 -0
- package/package.json +5 -2
package/README.md
CHANGED
|
@@ -1,80 +1,154 @@
|
|
|
1
|
-
# solana-meme-kit
|
|
2
|
-
|
|
3
|
-
**The Universal SDK for launching Solana Tokens.**
|
|
4
|
-
|
|
5
|
-
[](https://www.npmjs.com/package/solana-meme-kit)
|
|
6
|
-
[](https://opensource.org/licenses/MIT)
|
|
7
|
-
|
|
8
|
-
A unified, open-source TypeScript SDK that abstracts the complexity of Solana token launches. It provides a **Strategy Pattern** allowing you to choose different DEX backends for liquidity provision with a single code path.
|
|
9
|
-
|
|
10
|
-
## ✨ Core Features
|
|
11
|
-
|
|
12
|
-
- **Protocol:Strategy Selection**: Choose your DEX backend using `protocol:strategy` format.
|
|
13
|
-
- **Token Minting**: One-line minting with metadata upload via Metaplex Umi.
|
|
14
|
-
- **OpenBook Markets**: Supports automated low-cost market creation.
|
|
15
|
-
- **Security**: Built-in helpers to revoke Mint and Freeze authorities.
|
|
16
|
-
- **Standardized Interface**: Switch DEXs without changing your business logic.
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
|
22
|
-
|
|
|
23
|
-
| **`
|
|
24
|
-
| **`raydium:
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
dex: "meteora:dlmm", // Choose strategy here
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
console.log(`Token: ${result.mint}, Pool: ${result.poolId}`);
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
1
|
+
# solana-meme-kit
|
|
2
|
+
|
|
3
|
+
**The Universal SDK for launching Solana Tokens.**
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/solana-meme-kit)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
|
|
8
|
+
A unified, open-source TypeScript SDK that abstracts the complexity of Solana token launches. It provides a **Strategy Pattern** allowing you to choose different DEX backends for liquidity provision with a single code path.
|
|
9
|
+
|
|
10
|
+
## ✨ Core Features
|
|
11
|
+
|
|
12
|
+
- **Protocol:Strategy Selection**: Choose your DEX backend using `protocol:strategy` format.
|
|
13
|
+
- **Token Minting**: One-line minting with metadata upload via Metaplex Umi.
|
|
14
|
+
- **OpenBook Markets**: Supports automated low-cost market creation.
|
|
15
|
+
- **Security**: Built-in helpers to revoke Mint and Freeze authorities.
|
|
16
|
+
- **Standardized Interface**: Switch DEXs without changing your business logic.
|
|
17
|
+
- **Jito Smart Tipping**: Use `jitoTip: "auto"` (or a manual tip) with optional block engine region routing.
|
|
18
|
+
|
|
19
|
+
## 📊 Strategy Comparison
|
|
20
|
+
|
|
21
|
+
| Strategy | Cost (est) | Anti-Snipe | Features |
|
|
22
|
+
| :----------------- | :------------- | :--------- | :----------------------------------- |
|
|
23
|
+
| **`meteora:dlmm`** | ~0.02 SOL | ✅ High | Dynamic fees, concentrated liquidity |
|
|
24
|
+
| **`raydium:cpmm`** | ~0.15 SOL | ⚠️ Medium | Modern CPMM, no OpenBook needed |
|
|
25
|
+
| **`raydium:amm`** | ~0.2 - 2.8 SOL | ⚠️ Low | Legacy AMM, maximum compatibility |
|
|
26
|
+
|
|
27
|
+
## 💻 Usage
|
|
28
|
+
|
|
29
|
+
### Basic Launch (Meteora DLMM - Default)
|
|
30
|
+
|
|
31
|
+
```typescript
|
|
32
|
+
import { MemeKit } from "solana-meme-kit";
|
|
33
|
+
|
|
34
|
+
const kit = new MemeKit({
|
|
35
|
+
rpcUrl: "https://api.mainnet-beta.solana.com",
|
|
36
|
+
privateKey: "YOUR_PRIVATE_KEY",
|
|
37
|
+
cluster: "mainnet-beta",
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
const result = await kit.launch({
|
|
41
|
+
name: "Super Gem",
|
|
42
|
+
symbol: "SGEM",
|
|
43
|
+
image: "https://arweave.net/metadata",
|
|
44
|
+
supply: 1_000_000_000,
|
|
45
|
+
liquidity: { solAmount: 5, tokenAmount: 800_000_000 },
|
|
46
|
+
dex: "meteora:dlmm", // Choose strategy here
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
console.log(`Token: ${result.mint}, Pool: ${result.poolId}`);
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Smart Tipping (Jito)
|
|
53
|
+
|
|
54
|
+
`jitoTip` can be a number (SOL) or `"auto"`.
|
|
55
|
+
|
|
56
|
+
```typescript
|
|
57
|
+
import { MemeKit } from "solana-meme-kit";
|
|
58
|
+
|
|
59
|
+
const kit = new MemeKit({
|
|
60
|
+
rpcUrl: "https://api.mainnet-beta.solana.com",
|
|
61
|
+
privateKey: "YOUR_PRIVATE_KEY",
|
|
62
|
+
cluster: "mainnet-beta",
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
const result = await kit.launch({
|
|
66
|
+
name: "Super Gem",
|
|
67
|
+
symbol: "SGEM",
|
|
68
|
+
image: "https://arweave.net/metadata",
|
|
69
|
+
liquidity: { solAmount: 5, tokenAmount: 800_000_000 },
|
|
70
|
+
dex: "meteora:dlmm",
|
|
71
|
+
jitoTip: "auto",
|
|
72
|
+
blockEngine: "ny",
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
console.log(result.signature);
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Available `blockEngine` regions:
|
|
79
|
+
|
|
80
|
+
- **default**
|
|
81
|
+
- **ny**
|
|
82
|
+
- **amsterdam**
|
|
83
|
+
- **frankfurt**
|
|
84
|
+
- **tokyo**
|
|
85
|
+
- **slc**
|
|
86
|
+
|
|
87
|
+
### Smart Tip Quote (for UI)
|
|
88
|
+
|
|
89
|
+
```typescript
|
|
90
|
+
import { MemeKit } from "solana-meme-kit";
|
|
91
|
+
|
|
92
|
+
const tipSol = await MemeKit.getSmartTip();
|
|
93
|
+
console.log(tipSol);
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Cost Estimation + Fund Recovery
|
|
97
|
+
|
|
98
|
+
```typescript
|
|
99
|
+
import { MemeKit } from "solana-meme-kit";
|
|
100
|
+
|
|
101
|
+
const estimatedSol = MemeKit.estimateLaunchCost({
|
|
102
|
+
name: "Super Gem",
|
|
103
|
+
symbol: "SGEM",
|
|
104
|
+
image: "https://arweave.net/metadata",
|
|
105
|
+
liquidity: { solAmount: 5, tokenAmount: 800_000_000 },
|
|
106
|
+
dex: "meteora:dlmm",
|
|
107
|
+
jitoTip: "auto",
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
console.log(estimatedSol);
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
```typescript
|
|
114
|
+
import { MemeKit } from "solana-meme-kit";
|
|
115
|
+
|
|
116
|
+
const kit = new MemeKit({
|
|
117
|
+
rpcUrl: "https://api.mainnet-beta.solana.com",
|
|
118
|
+
privateKey: "YOUR_PRIVATE_KEY",
|
|
119
|
+
cluster: "mainnet-beta",
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
const txid = await kit.recoverFunds("DESTINATION_WALLET_ADDRESS");
|
|
123
|
+
console.log(txid);
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## 🛠️ Architecture
|
|
127
|
+
|
|
128
|
+
```text
|
|
129
|
+
src/
|
|
130
|
+
├── core/ # Main SDK and utilities
|
|
131
|
+
├── managers/ # Modular components (Token, Market, etc)
|
|
132
|
+
└── strategies/ # DEX-specific implementations
|
|
133
|
+
├── meteora/ # Meteora DLMM logic
|
|
134
|
+
└── raydium/ # Raydium CPMM & AMM logic
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
## 🧪 Development
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
bun install
|
|
141
|
+
bun run build
|
|
142
|
+
bun test
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
## 🚀 Roadmap
|
|
146
|
+
|
|
147
|
+
- [x] Meteora DLMM Integration
|
|
148
|
+
- [x] Raydium CPMM Integration
|
|
149
|
+
- [x] Raydium AMM (Legacy) Integration
|
|
150
|
+
- [x] Jito Bundle Support (Mainnet)
|
|
151
|
+
|
|
152
|
+
## 📄 License
|
|
153
|
+
|
|
154
|
+
MIT
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { TokenManager } from "../managers/TokenManager";
|
|
2
|
+
import { MarketManager } from "../managers/MarketManager";
|
|
3
|
+
import { LiquidityManager } from "../managers/LiquidityManager";
|
|
4
|
+
import type { LaunchOptions } from "../strategies/LiquidityStrategy";
|
|
5
|
+
import { JitoManager } from "../managers/JitoManager";
|
|
6
|
+
export declare class MemeKit {
|
|
7
|
+
private connection;
|
|
8
|
+
private wallet;
|
|
9
|
+
private cluster;
|
|
10
|
+
tokenManager: TokenManager;
|
|
11
|
+
marketManager: MarketManager;
|
|
12
|
+
liquidityManager: LiquidityManager;
|
|
13
|
+
jitoManager: JitoManager;
|
|
14
|
+
constructor(config: {
|
|
15
|
+
rpcUrl: string;
|
|
16
|
+
privateKey?: string;
|
|
17
|
+
cluster?: "mainnet-beta" | "devnet";
|
|
18
|
+
});
|
|
19
|
+
static estimateLaunchCost(options: LaunchOptions): number;
|
|
20
|
+
static getSmartTip(): Promise<number>;
|
|
21
|
+
recoverFunds(destinationAddress: string): Promise<string>;
|
|
22
|
+
launch(options: LaunchOptions): Promise<{
|
|
23
|
+
mint: string;
|
|
24
|
+
poolId: string;
|
|
25
|
+
marketId: string;
|
|
26
|
+
strategy: "meteora:dlmm" | "raydium:cpmm" | "raydium:amm";
|
|
27
|
+
signature: string;
|
|
28
|
+
}>;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=MemeKit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MemeKit.d.ts","sourceRoot":"","sources":["../../src/core/MemeKit.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,KAAK,EACV,aAAa,EAEd,MAAM,iCAAiC,CAAC;AAIzC,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAOtD,qBAAa,OAAO;IAClB,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,MAAM,CAAU;IACxB,OAAO,CAAC,OAAO,CAA4B;IAEpC,YAAY,EAAE,YAAY,CAAC;IAC3B,aAAa,EAAE,aAAa,CAAC;IAC7B,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,WAAW,EAAE,WAAW,CAAC;gBAEpB,MAAM,EAAE;QAClB,MAAM,EAAE,MAAM,CAAC;QACf,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,OAAO,CAAC,EAAE,cAAc,GAAG,QAAQ,CAAC;KACrC;IA2BD,MAAM,CAAC,kBAAkB,CAAC,OAAO,EAAE,aAAa,GAAG,MAAM;WAqC5C,WAAW,IAAI,OAAO,CAAC,MAAM,CAAC;IAIrC,YAAY,CAAC,kBAAkB,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAuCzD,MAAM,CAAC,OAAO,EAAE,aAAa;;;;;;;CA+HpC"}
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { Connection, Keypair, PublicKey, SystemProgram, TransactionMessage, VersionedTransaction, } from "@solana/web3.js";
|
|
2
|
+
import { TokenManager } from "../managers/TokenManager";
|
|
3
|
+
import { MarketManager } from "../managers/MarketManager";
|
|
4
|
+
import { LiquidityManager } from "../managers/LiquidityManager";
|
|
5
|
+
import { DLMMManager } from "../strategies/meteora";
|
|
6
|
+
import { CPMMManager, AMMManager } from "../strategies/raydium";
|
|
7
|
+
import { Logger, loadKeypairEnv, getExplorerLink } from "./utils";
|
|
8
|
+
import { JitoManager } from "../managers/JitoManager";
|
|
9
|
+
import { getJitoTipFloor } from "../utils/jitoTools";
|
|
10
|
+
import dotenv from "dotenv";
|
|
11
|
+
import bs58 from "bs58";
|
|
12
|
+
dotenv.config();
|
|
13
|
+
export class MemeKit {
|
|
14
|
+
connection;
|
|
15
|
+
wallet;
|
|
16
|
+
cluster;
|
|
17
|
+
tokenManager;
|
|
18
|
+
marketManager;
|
|
19
|
+
liquidityManager;
|
|
20
|
+
jitoManager;
|
|
21
|
+
constructor(config) {
|
|
22
|
+
this.connection = new Connection(config.rpcUrl, "confirmed");
|
|
23
|
+
this.cluster = config.cluster || "mainnet-beta";
|
|
24
|
+
// Load wallet
|
|
25
|
+
if (config.privateKey) {
|
|
26
|
+
this.wallet = Keypair.fromSecretKey(bs58.decode(config.privateKey));
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
const loaded = loadKeypairEnv();
|
|
30
|
+
if (!loaded)
|
|
31
|
+
throw new Error("No private key provided or found in env");
|
|
32
|
+
this.wallet = loaded;
|
|
33
|
+
}
|
|
34
|
+
this.tokenManager = new TokenManager(this.connection, this.wallet);
|
|
35
|
+
this.marketManager = new MarketManager(this.connection, this.wallet);
|
|
36
|
+
this.liquidityManager = new LiquidityManager(this.connection, this.wallet, this.cluster);
|
|
37
|
+
this.jitoManager = new JitoManager(this.connection, this.wallet, this.cluster);
|
|
38
|
+
}
|
|
39
|
+
static estimateLaunchCost(options) {
|
|
40
|
+
const solLiquidity = options.liquidity?.solAmount ?? options.solLiquidityAmount ?? 0;
|
|
41
|
+
const dex = options.dex ??
|
|
42
|
+
(options.strategy === "meteora"
|
|
43
|
+
? "meteora:dlmm"
|
|
44
|
+
: options.strategy === "raydium-cpmm"
|
|
45
|
+
? "raydium:cpmm"
|
|
46
|
+
: options.strategy === "raydium-amm"
|
|
47
|
+
? "raydium:amm"
|
|
48
|
+
: "meteora:dlmm");
|
|
49
|
+
let baseFees = 0;
|
|
50
|
+
switch (dex) {
|
|
51
|
+
case "meteora:dlmm":
|
|
52
|
+
baseFees = 0.025;
|
|
53
|
+
break;
|
|
54
|
+
case "raydium:cpmm":
|
|
55
|
+
baseFees = 0.15;
|
|
56
|
+
break;
|
|
57
|
+
case "raydium:amm":
|
|
58
|
+
baseFees =
|
|
59
|
+
(options.marketMode ?? "low-cost") === "low-cost" ? 0.6 : 3.2;
|
|
60
|
+
break;
|
|
61
|
+
default:
|
|
62
|
+
baseFees = 0.025;
|
|
63
|
+
break;
|
|
64
|
+
}
|
|
65
|
+
const jitoTip = typeof options.jitoTip === "number" ? options.jitoTip : 0.01;
|
|
66
|
+
const buffer = 0.005;
|
|
67
|
+
return baseFees + solLiquidity + jitoTip + buffer;
|
|
68
|
+
}
|
|
69
|
+
static async getSmartTip() {
|
|
70
|
+
return getJitoTipFloor();
|
|
71
|
+
}
|
|
72
|
+
async recoverFunds(destinationAddress) {
|
|
73
|
+
const destination = new PublicKey(destinationAddress);
|
|
74
|
+
const balance = await this.connection.getBalance(this.wallet.publicKey, "confirmed");
|
|
75
|
+
const transactionFeeLamports = 5000;
|
|
76
|
+
const maxTransfer = balance - transactionFeeLamports;
|
|
77
|
+
if (maxTransfer <= 0) {
|
|
78
|
+
throw new Error("No funds available to recover");
|
|
79
|
+
}
|
|
80
|
+
const { blockhash, lastValidBlockHeight } = await this.connection.getLatestBlockhash("confirmed");
|
|
81
|
+
const messageV0 = new TransactionMessage({
|
|
82
|
+
payerKey: this.wallet.publicKey,
|
|
83
|
+
recentBlockhash: blockhash,
|
|
84
|
+
instructions: [
|
|
85
|
+
SystemProgram.transfer({
|
|
86
|
+
fromPubkey: this.wallet.publicKey,
|
|
87
|
+
toPubkey: destination,
|
|
88
|
+
lamports: maxTransfer,
|
|
89
|
+
}),
|
|
90
|
+
],
|
|
91
|
+
}).compileToV0Message();
|
|
92
|
+
const versionedTx = new VersionedTransaction(messageV0);
|
|
93
|
+
versionedTx.sign([this.wallet]);
|
|
94
|
+
const signature = await this.connection.sendTransaction(versionedTx);
|
|
95
|
+
await this.connection.confirmTransaction({ signature, blockhash, lastValidBlockHeight }, "confirmed");
|
|
96
|
+
return signature;
|
|
97
|
+
}
|
|
98
|
+
async launch(options) {
|
|
99
|
+
const dex = options.dex ??
|
|
100
|
+
(options.strategy === "meteora"
|
|
101
|
+
? "meteora:dlmm"
|
|
102
|
+
: options.strategy === "raydium-cpmm"
|
|
103
|
+
? "raydium:cpmm"
|
|
104
|
+
: options.strategy === "raydium-amm"
|
|
105
|
+
? "raydium:amm"
|
|
106
|
+
: "meteora:dlmm");
|
|
107
|
+
Logger.info(`Starting Launch on strategy: ${dex}`);
|
|
108
|
+
// 1. Create Token
|
|
109
|
+
const { mint } = await this.tokenManager.createToken({
|
|
110
|
+
name: options.name,
|
|
111
|
+
symbol: options.symbol,
|
|
112
|
+
uri: options.image,
|
|
113
|
+
decimals: options.decimals,
|
|
114
|
+
initialSupply: options.supply || 1_000_000_000,
|
|
115
|
+
});
|
|
116
|
+
Logger.info(`Token Minted: ${mint.publicKey.toBase58()}`);
|
|
117
|
+
// 2. Revoke Authorities
|
|
118
|
+
await this.tokenManager.revokeAuthorities(mint.publicKey, this.wallet);
|
|
119
|
+
// 3. Execute Liquidity Strategy
|
|
120
|
+
let strategy;
|
|
121
|
+
switch (dex) {
|
|
122
|
+
case "meteora:dlmm":
|
|
123
|
+
strategy = new DLMMManager(this.connection, this.wallet, this.cluster === "devnet" ? "devnet" : "mainnet-beta");
|
|
124
|
+
break;
|
|
125
|
+
case "raydium:cpmm":
|
|
126
|
+
strategy = new CPMMManager(this.connection, this.wallet, this.cluster);
|
|
127
|
+
break;
|
|
128
|
+
case "raydium:amm":
|
|
129
|
+
strategy = new AMMManager(this.connection, this.wallet, this.marketManager, this.cluster);
|
|
130
|
+
break;
|
|
131
|
+
default:
|
|
132
|
+
throw new Error(`Unknown DEX strategy: ${dex}`);
|
|
133
|
+
}
|
|
134
|
+
const { poolId, instructions } = await strategy.initialize(options, mint.publicKey);
|
|
135
|
+
Logger.info(`Liquidity Setup Instructions Generated. Pool: ${poolId.toBase58()}`);
|
|
136
|
+
// 4. Send Transaction (Jito or Real SOL)
|
|
137
|
+
let signature = "Dry-run (not sent)";
|
|
138
|
+
if (instructions.length > 0) {
|
|
139
|
+
if (options.jitoTip !== undefined) {
|
|
140
|
+
const tipSol = options.jitoTip === "auto"
|
|
141
|
+
? await getJitoTipFloor()
|
|
142
|
+
: options.jitoTip;
|
|
143
|
+
if (options.jitoTip === "auto") {
|
|
144
|
+
Logger.info(`Using Smart Tip: ${tipSol} SOL`);
|
|
145
|
+
}
|
|
146
|
+
Logger.info(`Launching with Jito Bundle (Tip: ${tipSol} SOL)...`);
|
|
147
|
+
try {
|
|
148
|
+
const bundleId = await this.jitoManager.sendBundle(instructions, tipSol, options.blockEngine);
|
|
149
|
+
signature = bundleId;
|
|
150
|
+
Logger.info(`Bundle Submitted: ${bundleId}`);
|
|
151
|
+
}
|
|
152
|
+
catch (err) {
|
|
153
|
+
Logger.error(`Jito Bundle failed: ${err.message}`);
|
|
154
|
+
signature = `Failed: ${err.message}`;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
else {
|
|
158
|
+
const recentBlockhash = await this.connection.getLatestBlockhash();
|
|
159
|
+
const messageV0 = new TransactionMessage({
|
|
160
|
+
payerKey: this.wallet.publicKey,
|
|
161
|
+
recentBlockhash: recentBlockhash.blockhash,
|
|
162
|
+
instructions,
|
|
163
|
+
}).compileToV0Message();
|
|
164
|
+
const versionedTx = new VersionedTransaction(messageV0);
|
|
165
|
+
versionedTx.sign([this.wallet]);
|
|
166
|
+
Logger.info("Sending Liquidity Setup Transaction...");
|
|
167
|
+
try {
|
|
168
|
+
signature = await this.connection.sendTransaction(versionedTx);
|
|
169
|
+
await this.connection.confirmTransaction({
|
|
170
|
+
signature,
|
|
171
|
+
blockhash: recentBlockhash.blockhash,
|
|
172
|
+
lastValidBlockHeight: recentBlockhash.lastValidBlockHeight,
|
|
173
|
+
}, "confirmed");
|
|
174
|
+
Logger.info(`Transaction Sent: ${signature}`);
|
|
175
|
+
Logger.info("Transaction Confirmed! ✓");
|
|
176
|
+
Logger.info(`Explorer: ${getExplorerLink("tx", signature, this.cluster)}`);
|
|
177
|
+
}
|
|
178
|
+
catch (err) {
|
|
179
|
+
Logger.error(`Transaction failed: ${err.message}`);
|
|
180
|
+
signature = `Failed: ${err.message}`;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
return {
|
|
185
|
+
mint: mint.publicKey.toBase58(),
|
|
186
|
+
poolId: poolId.toBase58(),
|
|
187
|
+
marketId: dex === "raydium:amm" ? "Generated internally" : "Not Required",
|
|
188
|
+
strategy: dex,
|
|
189
|
+
signature,
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
//# sourceMappingURL=MemeKit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MemeKit.js","sourceRoot":"","sources":["../../src/core/MemeKit.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,OAAO,EACP,SAAS,EACT,aAAa,EACb,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAKhE,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,MAAM,CAAC,MAAM,EAAE,CAAC;AAEhB,MAAM,OAAO,OAAO;IACV,UAAU,CAAa;IACvB,MAAM,CAAU;IAChB,OAAO,CAA4B;IAEpC,YAAY,CAAe;IAC3B,aAAa,CAAgB;IAC7B,gBAAgB,CAAmB;IACnC,WAAW,CAAc;IAEhC,YAAY,MAIX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;YACzB,QAAQ,EAAE,GAAG,KAAK,aAAa,CAAC,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,cAAc;YACzE,QAAQ,EAAE,GAAG;YACb,SAAS;SACV,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Keypair } from '@solana/web3.js';
|
|
2
|
+
export declare const LOG_LEVELS: {
|
|
3
|
+
INFO: string;
|
|
4
|
+
WARN: string;
|
|
5
|
+
ERROR: string;
|
|
6
|
+
DEBUG: string;
|
|
7
|
+
};
|
|
8
|
+
export declare class Logger {
|
|
9
|
+
static info(msg: string, ...args: any[]): void;
|
|
10
|
+
static warn(msg: string, ...args: any[]): void;
|
|
11
|
+
static error(msg: string, ...args: any[]): void;
|
|
12
|
+
}
|
|
13
|
+
export declare function loadKeypairEnv(envVar?: string): Keypair | null;
|
|
14
|
+
export declare const EXPLORER_URL = "https://explorer.solana.com";
|
|
15
|
+
export declare function getExplorerLink(type: 'tx' | 'address' | 'block', id: string, cluster?: 'devnet' | 'mainnet-beta'): string;
|
|
16
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/core/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,OAAO,EAAa,MAAM,iBAAiB,CAAC;AAOjE,eAAO,MAAM,UAAU;;;;;CAKtB,CAAC;AAEF,qBAAa,MAAM;IACjB,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE;IAGvC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE;IAGvC,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE;CAGzC;AAED,wBAAgB,cAAc,CAAC,MAAM,GAAE,MAAsB,GAAG,OAAO,GAAG,IAAI,CAS7E;AAED,eAAO,MAAM,YAAY,gCAAgC,CAAC;AAE1D,wBAAgB,eAAe,CAAC,IAAI,EAAE,IAAI,GAAG,SAAS,GAAG,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,OAAO,GAAE,QAAQ,GAAG,cAA+B,UAEhI"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Connection, Keypair, PublicKey } from '@solana/web3.js';
|
|
2
|
+
import fs from 'fs';
|
|
3
|
+
import dotenv from 'dotenv';
|
|
4
|
+
import bs58 from 'bs58';
|
|
5
|
+
dotenv.config();
|
|
6
|
+
export const LOG_LEVELS = {
|
|
7
|
+
INFO: 'INFO',
|
|
8
|
+
WARN: 'WARN',
|
|
9
|
+
ERROR: 'ERROR',
|
|
10
|
+
DEBUG: 'DEBUG',
|
|
11
|
+
};
|
|
12
|
+
export class Logger {
|
|
13
|
+
static info(msg, ...args) {
|
|
14
|
+
console.log(`[${new Date().toISOString()}] [INFO] ${msg}`, ...args);
|
|
15
|
+
}
|
|
16
|
+
static warn(msg, ...args) {
|
|
17
|
+
console.warn(`[${new Date().toISOString()}] [WARN] ${msg}`, ...args);
|
|
18
|
+
}
|
|
19
|
+
static error(msg, ...args) {
|
|
20
|
+
console.error(`[${new Date().toISOString()}] [ERROR] ${msg}`, ...args);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
export function loadKeypairEnv(envVar = 'PRIVATE_KEY') {
|
|
24
|
+
const pk = process.env[envVar];
|
|
25
|
+
if (!pk)
|
|
26
|
+
return null;
|
|
27
|
+
try {
|
|
28
|
+
return Keypair.fromSecretKey(bs58.decode(pk));
|
|
29
|
+
}
|
|
30
|
+
catch (e) {
|
|
31
|
+
Logger.error('Failed to parse private key from env', e);
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
export const EXPLORER_URL = 'https://explorer.solana.com';
|
|
36
|
+
export function getExplorerLink(type, id, cluster = 'mainnet-beta') {
|
|
37
|
+
return `${EXPLORER_URL}/${type}/${id}?cluster=${cluster}`;
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/core/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,MAAM,CAAC,MAAM,EAAE,CAAC;AAEhB,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,OAAO;CACf,CAAC;AAEF,MAAM,OAAO,MAAM;IACjB,MAAM,CAAC,IAAI,CAAC,GAAW,EAAE,GAAG,IAAW;QACrC,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,YAAY,GAAG,EAAE,EAAE,GAAG,IAAI,CAAC,CAAC;IACtE,CAAC;IACD,MAAM,CAAC,IAAI,CAAC,GAAW,EAAE,GAAG,IAAW;QACrC,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,YAAY,GAAG,EAAE,EAAE,GAAG,IAAI,CAAC,CAAC;IACvE,CAAC;IACD,MAAM,CAAC,KAAK,CAAC,GAAW,EAAE,GAAG,IAAW;QACtC,OAAO,CAAC,KAAK,CAAC,IAAI,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,aAAa,GAAG,EAAE,EAAE,GAAG,IAAI,CAAC,CAAC;IACzE,CAAC;CACF;AAED,MAAM,UAAU,cAAc,CAAC,SAAiB,aAAa;IAC3D,MAAM,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAC/B,IAAI,CAAC,EAAE;QAAE,OAAO,IAAI,CAAC;IACrB,IAAI,CAAC;QACH,OAAO,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;IAChD,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,MAAM,CAAC,KAAK,CAAC,sCAAsC,EAAE,CAAC,CAAC,CAAC;QACxD,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED,MAAM,CAAC,MAAM,YAAY,GAAG,6BAA6B,CAAC;AAE1D,MAAM,UAAU,eAAe,CAAC,IAAgC,EAAE,EAAU,EAAE,UAAqC,cAAc;IAC/H,OAAO,GAAG,YAAY,IAAI,IAAI,IAAI,EAAE,YAAY,OAAO,EAAE,CAAC;AAC5D,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from "./core/MemeKit";
|
|
2
|
+
export * from "./core/utils";
|
|
3
|
+
export * from "./managers/TokenManager";
|
|
4
|
+
export * from "./managers/MarketManager";
|
|
5
|
+
export * from "./managers/LiquidityManager";
|
|
6
|
+
export * from "./strategies/LiquidityStrategy";
|
|
7
|
+
export * from "./strategies/meteora";
|
|
8
|
+
export * from "./strategies/raydium";
|
|
9
|
+
export * from "./utils/jitoTools";
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAG7B,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAG5C,cAAc,gCAAgC,CAAC;AAG/C,cAAc,sBAAsB,CAAC;AAGrC,cAAc,sBAAsB,CAAC;AAGrC,cAAc,mBAAmB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Core
|
|
2
|
+
export * from "./core/MemeKit";
|
|
3
|
+
export * from "./core/utils";
|
|
4
|
+
// Managers
|
|
5
|
+
export * from "./managers/TokenManager";
|
|
6
|
+
export * from "./managers/MarketManager";
|
|
7
|
+
export * from "./managers/LiquidityManager";
|
|
8
|
+
// Strategies - Interface
|
|
9
|
+
export * from "./strategies/LiquidityStrategy";
|
|
10
|
+
// Strategies - Meteora
|
|
11
|
+
export * from "./strategies/meteora";
|
|
12
|
+
// Strategies - Raydium
|
|
13
|
+
export * from "./strategies/raydium";
|
|
14
|
+
// Utils
|
|
15
|
+
export * from "./utils/jitoTools";
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO;AACP,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAE7B,WAAW;AACX,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAE5C,yBAAyB;AACzB,cAAc,gCAAgC,CAAC;AAE/C,uBAAuB;AACvB,cAAc,sBAAsB,CAAC;AAErC,uBAAuB;AACvB,cAAc,sBAAsB,CAAC;AAErC,QAAQ;AACR,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Connection, Keypair } from "@solana/web3.js";
|
|
2
|
+
import type { BlockEngineRegion } from "../utils/jitoTools";
|
|
3
|
+
export declare class JitoManager {
|
|
4
|
+
private connection;
|
|
5
|
+
private wallet;
|
|
6
|
+
private cluster;
|
|
7
|
+
private client;
|
|
8
|
+
private region;
|
|
9
|
+
constructor(connection: Connection, wallet: Keypair, cluster?: "mainnet-beta" | "devnet", region?: BlockEngineRegion);
|
|
10
|
+
private setRegion;
|
|
11
|
+
/**
|
|
12
|
+
* Sends a bundle of instructions with a Jito tip
|
|
13
|
+
*/
|
|
14
|
+
sendBundle(instructions: any[], // TransactionInstruction[]
|
|
15
|
+
tipSol?: number, region?: BlockEngineRegion): Promise<string>;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=JitoManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"JitoManager.d.ts","sourceRoot":"","sources":["../../src/managers/JitoManager.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EAKV,OAAO,EACR,MAAM,iBAAiB,CAAC;AAIzB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAG5D,qBAAa,WAAW;IAKpB,OAAO,CAAC,UAAU;IAClB,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,OAAO;IANjB,OAAO,CAAC,MAAM,CAAM;IACpB,OAAO,CAAC,MAAM,CAAoB;gBAGxB,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,OAAO,EACf,OAAO,GAAE,cAAc,GAAG,QAAyB,EAC3D,MAAM,GAAE,iBAAwB;IAQlC,OAAO,CAAC,SAAS;IAQjB;;OAEG;IACG,UAAU,CACd,YAAY,EAAE,GAAG,EAAE,EAAE,2BAA2B;IAChD,MAAM,GAAE,MAAc,EACtB,MAAM,CAAC,EAAE,iBAAiB,GACzB,OAAO,CAAC,MAAM,CAAC;CAuCnB"}
|