Release solana-streamer-sdk v1.4.3

Route gRPC, ShredStream, and account parsing through sol-parser-sdk.

Remove local protocol parsing implementations.

Depend on sol-parser-sdk v0.4.8 from crates.io.
This commit is contained in:
0xfnzero
2026-05-16 06:45:35 +08:00
parent 55e6bc6459
commit 92bac16fd4
43 changed files with 837 additions and 5460 deletions
+21 -11
View File
@@ -81,7 +81,7 @@ pub(crate) fn convert_parser_event(
e.metadata.clone(),
bt,
recv_wall_us,
ProtocolType::PumpFun,
ProtocolType::PumpFees,
EventType::PumpFeesCreateFeeSharingConfig,
pump_fees_program(),
);
@@ -94,7 +94,7 @@ pub(crate) fn convert_parser_event(
e.metadata.clone(),
bt,
recv_wall_us,
ProtocolType::PumpFun,
ProtocolType::PumpFees,
EventType::PumpFeesInitializeFeeConfig,
pump_fees_program(),
);
@@ -107,7 +107,7 @@ pub(crate) fn convert_parser_event(
e.metadata.clone(),
bt,
recv_wall_us,
ProtocolType::PumpFun,
ProtocolType::PumpFees,
EventType::PumpFeesResetFeeSharingConfig,
pump_fees_program(),
);
@@ -120,7 +120,7 @@ pub(crate) fn convert_parser_event(
e.metadata.clone(),
bt,
recv_wall_us,
ProtocolType::PumpFun,
ProtocolType::PumpFees,
EventType::PumpFeesRevokeFeeSharingAuthority,
pump_fees_program(),
);
@@ -133,7 +133,7 @@ pub(crate) fn convert_parser_event(
e.metadata.clone(),
bt,
recv_wall_us,
ProtocolType::PumpFun,
ProtocolType::PumpFees,
EventType::PumpFeesTransferFeeSharingAuthority,
pump_fees_program(),
);
@@ -146,7 +146,7 @@ pub(crate) fn convert_parser_event(
e.metadata.clone(),
bt,
recv_wall_us,
ProtocolType::PumpFun,
ProtocolType::PumpFees,
EventType::PumpFeesUpdateAdmin,
pump_fees_program(),
);
@@ -157,7 +157,7 @@ pub(crate) fn convert_parser_event(
e.metadata.clone(),
bt,
recv_wall_us,
ProtocolType::PumpFun,
ProtocolType::PumpFees,
EventType::PumpFeesUpdateFeeConfig,
pump_fees_program(),
);
@@ -170,7 +170,7 @@ pub(crate) fn convert_parser_event(
e.metadata.clone(),
bt,
recv_wall_us,
ProtocolType::PumpFun,
ProtocolType::PumpFees,
EventType::PumpFeesUpdateFeeShares,
pump_fees_program(),
);
@@ -183,7 +183,7 @@ pub(crate) fn convert_parser_event(
e.metadata.clone(),
bt,
recv_wall_us,
ProtocolType::PumpFun,
ProtocolType::PumpFees,
EventType::PumpFeesUpsertFeeTiers,
pump_fees_program(),
);
@@ -309,12 +309,17 @@ pub(crate) fn convert_parser_event(
}
PbDexEvent::RaydiumCpmmSwap(e) => {
let event_type = if e.base_input {
EventType::RaydiumCpmmSwapBaseInput
} else {
EventType::RaydiumCpmmSwapBaseOutput
};
let meta = adapt_pm(
e.metadata.clone(),
bt,
recv_wall_us,
ProtocolType::RaydiumCpmm,
EventType::RaydiumCpmmSwapBaseInput,
event_type,
raydium_cpmm_program(),
);
Some(DexEvent::RaydiumCpmmSwapEvent(raydium_cpmm_swap_from_parser(e, meta)))
@@ -457,12 +462,17 @@ pub(crate) fn convert_parser_event(
}
PbDexEvent::RaydiumAmmV4Swap(e) => {
let event_type = if e.max_amount_in != 0 || (e.amount_out != 0 && e.amount_in == 0) {
EventType::RaydiumAmmV4SwapBaseOut
} else {
EventType::RaydiumAmmV4SwapBaseIn
};
let meta = adapt_pm(
e.metadata.clone(),
bt,
recv_wall_us,
ProtocolType::RaydiumAmmV4,
EventType::RaydiumAmmV4SwapBaseIn,
event_type,
raydium_amm_v4_program(),
);
Some(DexEvent::RaydiumAmmV4SwapEvent(raydium_amm_v4_swap_from_parser(e, meta)))
+17 -1
View File
@@ -43,6 +43,15 @@ fn protocol_matches_event(p: &Protocol, ev: &DexEvent) -> bool {
| (Protocol::PumpFun, DexEvent::PumpFunMigrateBondingCurveCreatorEvent(_))
| (Protocol::PumpFun, DexEvent::PumpFunBondingCurveAccountEvent(_))
| (Protocol::PumpFun, DexEvent::PumpFunGlobalAccountEvent(_)) => true,
(Protocol::PumpFees, DexEvent::PumpFeesCreateFeeSharingConfigEvent(_))
| (Protocol::PumpFees, DexEvent::PumpFeesInitializeFeeConfigEvent(_))
| (Protocol::PumpFees, DexEvent::PumpFeesResetFeeSharingConfigEvent(_))
| (Protocol::PumpFees, DexEvent::PumpFeesRevokeFeeSharingAuthorityEvent(_))
| (Protocol::PumpFees, DexEvent::PumpFeesTransferFeeSharingAuthorityEvent(_))
| (Protocol::PumpFees, DexEvent::PumpFeesUpdateAdminEvent(_))
| (Protocol::PumpFees, DexEvent::PumpFeesUpdateFeeConfigEvent(_))
| (Protocol::PumpFees, DexEvent::PumpFeesUpdateFeeSharesEvent(_))
| (Protocol::PumpFees, DexEvent::PumpFeesUpsertFeeTiersEvent(_)) => true,
(Protocol::PumpSwap, DexEvent::PumpSwapBuyEvent(_))
| (Protocol::PumpSwap, DexEvent::PumpSwapSellEvent(_))
| (Protocol::PumpSwap, DexEvent::PumpSwapCreatePoolEvent(_))
@@ -56,7 +65,14 @@ fn protocol_matches_event(p: &Protocol, ev: &DexEvent) -> bool {
| (Protocol::Bonk, DexEvent::BonkMigrateToCpswapEvent(_))
| (Protocol::Bonk, DexEvent::BonkPoolStateAccountEvent(_))
| (Protocol::Bonk, DexEvent::BonkGlobalConfigAccountEvent(_))
| (Protocol::Bonk, DexEvent::BonkPlatformConfigAccountEvent(_)) => true,
| (Protocol::Bonk, DexEvent::BonkPlatformConfigAccountEvent(_))
| (Protocol::RaydiumLaunchpad, DexEvent::BonkTradeEvent(_))
| (Protocol::RaydiumLaunchpad, DexEvent::BonkPoolCreateEvent(_))
| (Protocol::RaydiumLaunchpad, DexEvent::BonkMigrateToAmmEvent(_))
| (Protocol::RaydiumLaunchpad, DexEvent::BonkMigrateToCpswapEvent(_))
| (Protocol::RaydiumLaunchpad, DexEvent::BonkPoolStateAccountEvent(_))
| (Protocol::RaydiumLaunchpad, DexEvent::BonkGlobalConfigAccountEvent(_))
| (Protocol::RaydiumLaunchpad, DexEvent::BonkPlatformConfigAccountEvent(_)) => true,
(Protocol::RaydiumCpmm, DexEvent::RaydiumCpmmSwapEvent(_))
| (Protocol::RaydiumCpmm, DexEvent::RaydiumCpmmDepositEvent(_))
| (Protocol::RaydiumCpmm, DexEvent::RaydiumCpmmWithdrawEvent(_))
+12 -13
View File
@@ -1,41 +1,40 @@
//! Protocol program ids used by bridged events.
use crate::streaming::event_parser::protocols::sol_parser_forward;
use sol_parser_sdk::instr::program_ids;
use solana_sdk::pubkey::Pubkey;
pub(crate) fn pumpswap_program() -> Pubkey {
crate::streaming::event_parser::protocols::pumpswap::parser::PUMPSWAP_PROGRAM_ID
program_ids::PUMPSWAP_PROGRAM_ID
}
pub(crate) fn pump_program() -> Pubkey {
crate::streaming::event_parser::protocols::pumpfun::parser::PUMPFUN_PROGRAM_ID
program_ids::PUMPFUN_PROGRAM_ID
}
pub(crate) fn pump_fees_program() -> Pubkey {
sol_parser_sdk::instr::program_ids::PUMP_FEES_PROGRAM_ID
program_ids::PUMP_FEES_PROGRAM_ID
}
pub(crate) fn bonk_program() -> Pubkey {
crate::streaming::event_parser::protocols::bonk::parser::BONK_PROGRAM_ID
program_ids::BONK_PROGRAM_ID
}
pub(crate) fn raydium_cpmm_program() -> Pubkey {
crate::streaming::event_parser::protocols::raydium_cpmm::parser::RAYDIUM_CPMM_PROGRAM_ID
program_ids::RAYDIUM_CPMM_PROGRAM_ID
}
pub(crate) fn raydium_clmm_program() -> Pubkey {
crate::streaming::event_parser::protocols::raydium_clmm::parser::RAYDIUM_CLMM_PROGRAM_ID
program_ids::RAYDIUM_CLMM_PROGRAM_ID
}
pub(crate) fn raydium_amm_v4_program() -> Pubkey {
crate::streaming::event_parser::protocols::raydium_amm_v4::parser::RAYDIUM_AMM_V4_PROGRAM_ID
program_ids::RAYDIUM_AMM_V4_PROGRAM_ID
}
pub(crate) fn meteora_damm_program() -> Pubkey {
crate::streaming::event_parser::protocols::meteora_damm_v2::parser::METEORA_DAMM_V2_PROGRAM_ID
program_ids::METEORA_DAMM_V2_PROGRAM_ID
}
pub(crate) fn orca_whirlpool_program() -> Pubkey {
sol_parser_forward::ORCA_WHIRLPOOL_PROGRAM_ID
program_ids::ORCA_WHIRLPOOL_PROGRAM_ID
}
pub(crate) fn meteora_pools_program() -> Pubkey {
sol_parser_forward::METEORA_POOLS_PROGRAM_ID
program_ids::METEORA_POOLS_PROGRAM_ID
}
pub(crate) fn meteora_dlmm_program() -> Pubkey {
sol_parser_forward::METEORA_DLMM_PROGRAM_ID
program_ids::METEORA_DLMM_PROGRAM_ID
}