Merge commit 'bac48044c0a98f202a37df8f560242b6d0c25eae'
This commit is contained in:
@@ -139,6 +139,20 @@ let ipfs_response = create_token_metadata(metadata, api_token).await?;
|
|||||||
pumpfun.create(mint_keypair, ipfs_response).await?;
|
pumpfun.create(mint_keypair, ipfs_response).await?;
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### 3.1. Create and Buy Token (with MEV protection)
|
||||||
|
|
||||||
|
```rust
|
||||||
|
// Create token and buy simultaneously with MEV protection
|
||||||
|
pumpfun.create_and_buy_with_tip(
|
||||||
|
payer.clone(), // payer keypair
|
||||||
|
mint_keypair, // mint keypair
|
||||||
|
ipfs_response, // IPFS response
|
||||||
|
50000000, // buy_sol_cost (purchase amount in lamports, 0.05 SOL)
|
||||||
|
Some(100), // slippage (1%)
|
||||||
|
recent_blockhash,
|
||||||
|
).await?;
|
||||||
|
```
|
||||||
|
|
||||||
### 4. Buy Tokens
|
### 4. Buy Tokens
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
@@ -350,6 +364,7 @@ src/
|
|||||||
├── pumpfun/ # PumpFun trading functionality
|
├── pumpfun/ # PumpFun trading functionality
|
||||||
├── pumpswap/ # PumpSwap trading functionality
|
├── pumpswap/ # PumpSwap trading functionality
|
||||||
├── swqos/ # MEV service clients
|
├── swqos/ # MEV service clients
|
||||||
|
├── trading/ # Unified trading engine
|
||||||
├── lib.rs # Main library file
|
├── lib.rs # Main library file
|
||||||
└── main.rs # Example program
|
└── main.rs # Example program
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -139,6 +139,20 @@ let ipfs_response = create_token_metadata(metadata, api_token).await?;
|
|||||||
pumpfun.create(mint_keypair, ipfs_response).await?;
|
pumpfun.create(mint_keypair, ipfs_response).await?;
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### 3.1. 创建并购买代币(带小费)
|
||||||
|
|
||||||
|
```rust
|
||||||
|
// 创建代币的同时购买,并使用MEV保护
|
||||||
|
pumpfun.create_and_buy_with_tip(
|
||||||
|
payer.clone(), // payer keypair
|
||||||
|
mint_keypair, // mint keypair
|
||||||
|
ipfs_response, // IPFS响应
|
||||||
|
50000000, // buy_sol_cost (购买金额,lamports,0.05 SOL)
|
||||||
|
Some(100), // slippage (1%)
|
||||||
|
recent_blockhash,
|
||||||
|
).await?;
|
||||||
|
```
|
||||||
|
|
||||||
### 4. 购买代币
|
### 4. 购买代币
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
@@ -350,6 +364,7 @@ src/
|
|||||||
├── pumpfun/ # PumpFun交易功能
|
├── pumpfun/ # PumpFun交易功能
|
||||||
├── pumpswap/ # PumpSwap交易功能
|
├── pumpswap/ # PumpSwap交易功能
|
||||||
├── swqos/ # MEV服务客户端
|
├── swqos/ # MEV服务客户端
|
||||||
|
├── trading/ # 统一交易引擎
|
||||||
├── lib.rs # 主库文件
|
├── lib.rs # 主库文件
|
||||||
└── main.rs # 示例程序
|
└── main.rs # 示例程序
|
||||||
```
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user