- Add structured comment sections with clear code organization - Improve variable naming and account address calculation logic - Update comments for better readability across all trading protocols - Enhance code structure for PumpFun, PumpSwap, and Raydium protocols
18 lines
605 B
Rust
Executable File
18 lines
605 B
Rust
Executable File
use solana_sdk::{message::AddressLookupTableAccount, pubkey::Pubkey};
|
|
|
|
use crate::common::address_lookup_cache::get_address_lookup_table_account;
|
|
|
|
/// Get address lookup table account list
|
|
/// If lookup_table_key is provided, get the corresponding account, otherwise return empty list
|
|
pub async fn get_address_lookup_table_accounts(
|
|
lookup_table_key: Option<Pubkey>,
|
|
) -> Vec<AddressLookupTableAccount> {
|
|
match lookup_table_key {
|
|
Some(key) => {
|
|
let account = get_address_lookup_table_account(&key).await;
|
|
vec![account]
|
|
}
|
|
None => Vec::new(),
|
|
}
|
|
}
|