feat: add Node1 minimum tip amount validation (0.002 SOL)
- Add intelligent tip amount detection for Node1 - Implement MIN_TIP_AMOUNT check in transaction builder - Add MIN_TIP_AMOUNT.md documentation - Optimize pumpswap instruction handling - Update common utility functions 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -100,7 +100,7 @@ pub fn _create_associated_token_account_idempotent_fast(
|
||||
};
|
||||
|
||||
// Only use seed if the mint address is not wSOL or SOL
|
||||
// token 2022 测试不成功(TODO)
|
||||
// 🔧 修复:Token-2022 也支持 seed 方式(白名单方式更安全)
|
||||
if use_seed
|
||||
&& !mint.eq(&crate::constants::WSOL_TOKEN_ACCOUNT)
|
||||
&& !mint.eq(&crate::constants::SOL_TOKEN_ACCOUNT)
|
||||
@@ -236,7 +236,7 @@ fn _get_associated_token_address_with_program_id_fast(
|
||||
|
||||
// Slow path: compute new ATA
|
||||
// Only use seed if the token mint address is not wSOL or SOL
|
||||
// token 2022 测试不成功(TODO)
|
||||
// 🔧 修复:Token-2022 也支持 seed 方式(白名单方式更安全)
|
||||
let ata = if use_seed
|
||||
&& !token_mint_address.eq(&crate::constants::WSOL_TOKEN_ACCOUNT)
|
||||
&& !token_mint_address.eq(&crate::constants::SOL_TOKEN_ACCOUNT)
|
||||
|
||||
+6
-7
@@ -74,9 +74,12 @@ pub fn create_associated_token_account_use_seed(
|
||||
};
|
||||
}
|
||||
let seed = unsafe { std::str::from_utf8_unchecked(&buf) };
|
||||
// 🔧 修复:使用传入的 token_program 生成地址(支持 Token 和 Token-2022)
|
||||
// 买入和卖出只要都使用事件中的 token_program,地址自然一致
|
||||
let ata_like = Pubkey::create_with_seed(payer, seed, token_program)?;
|
||||
|
||||
let len = 165;
|
||||
// 但账户的 owner 仍然使用正确的 token_program(Token 或 Token-2022)
|
||||
let create_acc =
|
||||
create_account_with_seed(payer, &ata_like, owner, seed, rent, len, token_program);
|
||||
|
||||
@@ -106,13 +109,9 @@ pub fn get_associated_token_address_with_program_id_use_seed(
|
||||
_ => b'a' + (nibble - 10),
|
||||
};
|
||||
}
|
||||
let is_2022_token = token_program_id == &crate::constants::TOKEN_PROGRAM_2022;
|
||||
let seed = unsafe { std::str::from_utf8_unchecked(&buf) };
|
||||
let token_program = if is_2022_token {
|
||||
&crate::constants::TOKEN_PROGRAM_2022
|
||||
} else {
|
||||
&crate::constants::TOKEN_PROGRAM
|
||||
};
|
||||
let ata_like = Pubkey::create_with_seed(wallet_address, seed, token_program)?;
|
||||
// 🔧 修复:使用传入的 token_program_id 生成地址(支持 Token 和 Token-2022)
|
||||
// 买入和卖出只要都使用事件中的 token_program_id,地址自然一致
|
||||
let ata_like = Pubkey::create_with_seed(wallet_address, seed, token_program_id)?;
|
||||
Ok(ata_like)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user