pub struct KobeClient { /* private fields */ }Expand description
Main client for interacting with Jito APIs
Implementations§
Source§impl KobeClient
impl KobeClient
Sourcepub async fn get_staker_rewards(
&self,
limit: Option<u32>,
) -> Result<StakerRewardsResponse, KobeApiError>
pub async fn get_staker_rewards( &self, limit: Option<u32>, ) -> Result<StakerRewardsResponse, KobeApiError>
Get staker rewards
Retrieves individual claimable MEV and priority fee rewards from the tip distribution merkle trees.
§Arguments
limit- Optional limit on the number of results (default: API default)
§Example
let client = KobeClient::mainnet();
let rewards = client.get_staker_rewards(Some(10)).await?;Sourcepub async fn get_staker_rewards_with_params(
&self,
params: &QueryParams,
) -> Result<StakerRewardsResponse, KobeApiError>
pub async fn get_staker_rewards_with_params( &self, params: &QueryParams, ) -> Result<StakerRewardsResponse, KobeApiError>
Get staker rewards with full query parameters
Sourcepub async fn get_validator_rewards(
&self,
epoch: Option<u64>,
limit: Option<u32>,
) -> Result<ValidatorRewardsResponse, KobeApiError>
pub async fn get_validator_rewards( &self, epoch: Option<u64>, limit: Option<u32>, ) -> Result<ValidatorRewardsResponse, KobeApiError>
Get validator rewards for a specific epoch
Retrieves aggregated MEV and priority fee rewards data per validator.
§Arguments
epoch- Epoch number (optional, defaults to latest)limit- Optional limit on the number of results
Sourcepub async fn get_validators(
&self,
epoch: Option<u64>,
) -> Result<ValidatorsResponse, KobeApiError>
pub async fn get_validators( &self, epoch: Option<u64>, ) -> Result<ValidatorsResponse, KobeApiError>
Get all validators for a given epoch
Returns validator state for a given epoch (defaults to latest).
§Arguments
epoch- Optional epoch number (defaults to latest)
Examples found in repository?
6async fn main() {
7 let client = KobeApiClientBuilder::new()
8 .timeout(Duration::from_secs(45))
9 .retry(true)
10 .max_retries(5)
11 .build();
12
13 let current_epoch = client.get_current_epoch().await.unwrap();
14 println!("Current epoch: {}\n", current_epoch);
15
16 let validators = client.get_validators(Some(current_epoch)).await.unwrap();
17
18 println!("Found {} validators", validators.validators.len());
19}Sourcepub async fn get_jitosol_validators(
&self,
epoch: Option<u64>,
) -> Result<ValidatorsResponse, KobeApiError>
pub async fn get_jitosol_validators( &self, epoch: Option<u64>, ) -> Result<ValidatorsResponse, KobeApiError>
Get JitoSOL stake pool validators for a given epoch
Returns only validators that are actively part of the JitoSOL validator set.
Examples found in repository?
6async fn main() {
7 let client = KobeApiClientBuilder::new()
8 .timeout(Duration::from_secs(45))
9 .retry(true)
10 .max_retries(5)
11 .build();
12
13 let current_epoch = client.get_current_epoch().await.unwrap();
14 println!("Current epoch: {}\n", current_epoch);
15
16 let jitosol_validators = client.get_jitosol_validators(Some(873)).await.unwrap();
17
18 println!(
19 "Found {} jito_sol Validators",
20 jitosol_validators.validators.len()
21 );
22}Sourcepub async fn get_validator_info_by_vote_account(
&self,
vote_account: &str,
) -> Result<Vec<ValidatorByVoteAccount>, KobeApiError>
pub async fn get_validator_info_by_vote_account( &self, vote_account: &str, ) -> Result<Vec<ValidatorByVoteAccount>, KobeApiError>
Get historical data for a single validator
Returns historical reward data for a validator, sorted by epoch (descending).
§Arguments
vote_account- The validator’s vote account public key
Examples found in repository?
6async fn main() {
7 let client = KobeApiClientBuilder::new()
8 .timeout(Duration::from_secs(45))
9 .retry(true)
10 .max_retries(5)
11 .build();
12
13 let vote_account = "J1to1yufRnoWn81KYg1XkTWzmKjnYSnmE2VY8DGUJ9Qv";
14
15 let validator_info = client
16 .get_validator_info_by_vote_account(vote_account)
17 .await
18 .unwrap();
19
20 println!("Validator Info Length: {}", validator_info.len());
21}Sourcepub async fn get_mev_rewards(
&self,
epoch: Option<u64>,
) -> Result<MevRewards, KobeApiError>
pub async fn get_mev_rewards( &self, epoch: Option<u64>, ) -> Result<MevRewards, KobeApiError>
Get MEV rewards network statistics for an epoch
Returns network-level statistics including total MEV, stake weight, and reward per lamport.
§Arguments
epoch- Optional epoch number (defaults to latest)
Examples found in repository?
6async fn main() {
7 let client = KobeApiClientBuilder::new()
8 .timeout(Duration::from_secs(45))
9 .retry(true)
10 .max_retries(5)
11 .build();
12
13 let current_epoch = client.get_current_epoch().await.unwrap();
14 println!("Current epoch: {}\n", current_epoch);
15
16 let mev_rewards = client.get_mev_rewards(Some(current_epoch)).await.unwrap();
17
18 println!("MEV Rewards: {:?}", mev_rewards);
19}Sourcepub async fn get_daily_mev_rewards(
&self,
) -> Result<Vec<DailyMevRewards>, KobeApiError>
pub async fn get_daily_mev_rewards( &self, ) -> Result<Vec<DailyMevRewards>, KobeApiError>
Get daily MEV rewards
Returns aggregated MEV rewards per calendar day.
Sourcepub async fn get_jito_stake_over_time(
&self,
) -> Result<JitoStakeOverTime, KobeApiError>
pub async fn get_jito_stake_over_time( &self, ) -> Result<JitoStakeOverTime, KobeApiError>
Get Jito stake over time
Returns a map of epoch to percentage of all Solana stake delegated to Jito-running validators.
Sourcepub async fn get_mev_commission_average_over_time(
&self,
) -> Result<MevCommissionAverageOverTime, KobeApiError>
pub async fn get_mev_commission_average_over_time( &self, ) -> Result<MevCommissionAverageOverTime, KobeApiError>
Get MEV commission average over time
Returns stake-weighted average MEV commission along with other metrics.
Sourcepub async fn get_jitosol_sol_ratio(
&self,
start: DateTime<Utc>,
end: DateTime<Utc>,
) -> Result<JitoSolRatio, KobeApiError>
pub async fn get_jitosol_sol_ratio( &self, start: DateTime<Utc>, end: DateTime<Utc>, ) -> Result<JitoSolRatio, KobeApiError>
Get JitoSOL to SOL exchange ratio over time
§Arguments
start- Start datetime for the rangeend- End datetime for the range
Sourcepub async fn get_stake_pool_stats(
&self,
request: Option<&StakePoolStatsRequest>,
) -> Result<StakePoolStats, KobeApiError>
pub async fn get_stake_pool_stats( &self, request: Option<&StakePoolStatsRequest>, ) -> Result<StakePoolStats, KobeApiError>
Get stake pool statistics
Returns stake pool analytics including TVL, APY, validator count, supply metrics, and aggregated MEV rewards over time.
Examples found in repository?
7async fn main() {
8 let client = KobeApiClientBuilder::new()
9 .timeout(Duration::from_secs(45))
10 .retry(true)
11 .max_retries(5)
12 .build();
13
14 let current_epoch = client.get_current_epoch().await.unwrap();
15 println!("Current epoch: {}\n", current_epoch);
16
17 let end = Utc::now();
18
19 let start = end - chrono::Duration::days(1);
20 let request = StakePoolStatsRequest::new()
21 .with_bucket_type("Daily")
22 .with_range_filter(start, end)
23 .sort_asc();
24
25 let stake_pool_stats = client.get_stake_pool_stats(Some(&request)).await.unwrap();
26
27 println!("Stake Pool Stats: {:?}", stake_pool_stats);
28}Sourcepub async fn get_current_epoch(&self) -> Result<u64, KobeApiError>
pub async fn get_current_epoch(&self) -> Result<u64, KobeApiError>
Get the current epoch from the latest MEV rewards data
Examples found in repository?
6async fn main() {
7 let client = KobeApiClientBuilder::new()
8 .timeout(Duration::from_secs(45))
9 .retry(true)
10 .max_retries(5)
11 .build();
12
13 let current_epoch = client.get_current_epoch().await.unwrap();
14 println!("Current epoch: {}\n", current_epoch);
15
16 let mev_rewards = client.get_mev_rewards(Some(current_epoch)).await.unwrap();
17
18 println!("MEV Rewards: {:?}", mev_rewards);
19}More examples
6async fn main() {
7 let client = KobeApiClientBuilder::new()
8 .timeout(Duration::from_secs(45))
9 .retry(true)
10 .max_retries(5)
11 .build();
12
13 let current_epoch = client.get_current_epoch().await.unwrap();
14 println!("Current epoch: {}\n", current_epoch);
15
16 let validators = client.get_validators(Some(current_epoch)).await.unwrap();
17
18 println!("Found {} validators", validators.validators.len());
19}6async fn main() {
7 let client = KobeApiClientBuilder::new()
8 .timeout(Duration::from_secs(45))
9 .retry(true)
10 .max_retries(5)
11 .build();
12
13 let current_epoch = client.get_current_epoch().await.unwrap();
14 println!("Current epoch: {}\n", current_epoch);
15
16 let jitosol_validators = client.get_jitosol_validators(Some(873)).await.unwrap();
17
18 println!(
19 "Found {} jito_sol Validators",
20 jitosol_validators.validators.len()
21 );
22}7async fn main() {
8 let client = KobeApiClientBuilder::new()
9 .timeout(Duration::from_secs(45))
10 .retry(true)
11 .max_retries(5)
12 .build();
13
14 let current_epoch = client.get_current_epoch().await.unwrap();
15 println!("Current epoch: {}\n", current_epoch);
16
17 let end = Utc::now();
18
19 let start = end - chrono::Duration::days(1);
20 let request = StakePoolStatsRequest::new()
21 .with_bucket_type("Daily")
22 .with_range_filter(start, end)
23 .sort_asc();
24
25 let stake_pool_stats = client.get_stake_pool_stats(Some(&request)).await.unwrap();
26
27 println!("Stake Pool Stats: {:?}", stake_pool_stats);
28}Sourcepub async fn get_jito_validators(
&self,
) -> Result<Vec<ValidatorInfo>, KobeApiError>
pub async fn get_jito_validators( &self, ) -> Result<Vec<ValidatorInfo>, KobeApiError>
Get all validators currently running Jito
Sourcepub async fn get_validators_by_stake(
&self,
epoch: Option<u64>,
limit: usize,
) -> Result<Vec<ValidatorInfo>, KobeApiError>
pub async fn get_validators_by_stake( &self, epoch: Option<u64>, limit: usize, ) -> Result<Vec<ValidatorInfo>, KobeApiError>
Get validators sorted by active stake
Sourcepub async fn is_validator_running_jito(
&self,
vote_account: &str,
) -> Result<bool, KobeApiError>
pub async fn is_validator_running_jito( &self, vote_account: &str, ) -> Result<bool, KobeApiError>
Check if a validator is running Jito
Sourcepub async fn calculate_total_mev_rewards(
&self,
start_epoch: u64,
end_epoch: u64,
) -> Result<u64, KobeApiError>
pub async fn calculate_total_mev_rewards( &self, start_epoch: u64, end_epoch: u64, ) -> Result<u64, KobeApiError>
Calculate total MEV rewards for a time period
Sourcepub async fn get_bam_delegation_blacklist(
&self,
) -> Result<Vec<BamDelegationBlacklistEntry>, KobeApiError>
pub async fn get_bam_delegation_blacklist( &self, ) -> Result<Vec<BamDelegationBlacklistEntry>, KobeApiError>
Get BAM Delegation Blacklist
Returns bam delegation blacklist
Sourcepub async fn get_bam_epoch_metrics(
&self,
epoch: u64,
) -> Result<BamEpochMetricsResponse, KobeApiError>
pub async fn get_bam_epoch_metrics( &self, epoch: u64, ) -> Result<BamEpochMetricsResponse, KobeApiError>
Get BAM Epoch Metrics
Returns bam epoch metrics
Sourcepub async fn get_bam_validators(
&self,
epoch: u64,
) -> Result<BamValidatorsResponse, KobeApiError>
pub async fn get_bam_validators( &self, epoch: u64, ) -> Result<BamValidatorsResponse, KobeApiError>
Get BAM Validators
Returns bam validators
Trait Implementations§
Source§impl Clone for KobeClient
impl Clone for KobeClient
Source§fn clone(&self) -> KobeClient
fn clone(&self) -> KobeClient
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more