update dex_type
This commit is contained in:
@@ -43,8 +43,8 @@ pub struct TradeFactory;
|
|||||||
|
|
||||||
impl TradeFactory {
|
impl TradeFactory {
|
||||||
/// 创建指定协议的交易执行器
|
/// 创建指定协议的交易执行器
|
||||||
pub fn create_executor(protocol: DexType) -> Arc<dyn TradeExecutor> {
|
pub fn create_executor(dex_type: DexType) -> Arc<dyn TradeExecutor> {
|
||||||
match protocol {
|
match dex_type {
|
||||||
DexType::PumpFun => {
|
DexType::PumpFun => {
|
||||||
let instruction_builder = Arc::new(PumpFunInstructionBuilder);
|
let instruction_builder = Arc::new(PumpFunInstructionBuilder);
|
||||||
Arc::new(GenericTradeExecutor::new(instruction_builder, "PumpFun"))
|
Arc::new(GenericTradeExecutor::new(instruction_builder, "PumpFun"))
|
||||||
@@ -64,12 +64,12 @@ impl TradeFactory {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// 获取所有支持的协议
|
/// 获取所有支持的协议
|
||||||
pub fn supported_protocols() -> Vec<DexType> {
|
pub fn supported_dex_types() -> Vec<DexType> {
|
||||||
vec![DexType::PumpFun, DexType::PumpSwap, DexType::Bonk]
|
vec![DexType::PumpFun, DexType::PumpSwap, DexType::Bonk]
|
||||||
}
|
}
|
||||||
|
|
||||||
/// 检查协议是否支持
|
/// 检查协议是否支持
|
||||||
pub fn is_supported(protocol: &DexType) -> bool {
|
pub fn is_supported(dex_type: &DexType) -> bool {
|
||||||
Self::supported_protocols().contains(protocol)
|
Self::supported_dex_types().contains(dex_type)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user