Skip to main content

RewardApi

Trait RewardApi 

Source
pub trait RewardApi {
    // Required methods
    fn get_reward_state_height<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_reward_state_v2_height<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_reward_account_proof_v1<'life0, 'async_trait>(
        &'life0 self,
        height: u64,
        address: String,
    ) -> Pin<Box<dyn Future<Output = Result<RewardAccountQueryDataV1>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_reward_claim_input<'life0, 'async_trait>(
        &'life0 self,
        block_height: u64,
        address: String,
    ) -> Pin<Box<dyn Future<Output = Result<RewardClaimInput>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_reward_balance<'life0, 'async_trait>(
        &'life0 self,
        height: u64,
        address: String,
    ) -> Pin<Box<dyn Future<Output = Result<RewardAmount>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_latest_reward_balance<'life0, 'async_trait>(
        &'life0 self,
        address: String,
    ) -> Pin<Box<dyn Future<Output = Result<RewardAmount>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_reward_account_proof<'life0, 'async_trait>(
        &'life0 self,
        height: u64,
        address: String,
    ) -> Pin<Box<dyn Future<Output = Result<RewardAccountQueryDataV2>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_latest_reward_account_proof<'life0, 'async_trait>(
        &'life0 self,
        address: String,
    ) -> Pin<Box<dyn Future<Output = Result<RewardAccountQueryDataV2>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_reward_amounts<'life0, 'async_trait>(
        &'life0 self,
        height: u64,
        offset: u64,
        limit: u64,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<(Address, RewardAmount)>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_reward_merkle_tree_v2<'life0, 'async_trait>(
        &'life0 self,
        height: u64,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_reward_state_path_v1<'life0, 'async_trait>(
        &'life0 self,
        snapshot: Snapshot,
        key: String,
    ) -> Pin<Box<dyn Future<Output = Result<RewardStatePathV1>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_reward_state_path_v2<'life0, 'async_trait>(
        &'life0 self,
        snapshot: Snapshot,
        key: String,
    ) -> Pin<Box<dyn Future<Output = Result<RewardStatePathV2>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}

Required Methods§

Source

fn get_reward_state_height<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get the height of the last persisted reward-state-v1 merklized state snapshot

Source

fn get_reward_state_v2_height<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get the height of the last persisted reward-state-v2 merklized state snapshot

Source

fn get_reward_account_proof_v1<'life0, 'async_trait>( &'life0 self, height: u64, address: String, ) -> Pin<Box<dyn Future<Output = Result<RewardAccountQueryDataV1>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get Merkle proof for a reward account against the V1 (RewardMerkleTreeV1) tree

§Arguments
  • height - Block height to query
  • address - Ethereum address to query proof for
Source

fn get_reward_claim_input<'life0, 'async_trait>( &'life0 self, block_height: u64, address: String, ) -> Pin<Box<dyn Future<Output = Result<RewardClaimInput>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get reward claim input for L1 contract submission

Returns all data needed to call the claimRewards function on the L1 contract, including lifetime rewards and the Merkle proof.

§Arguments
  • block_height - Must match the height finalized in the Light Client contract
  • address - Ethereum address to query rewards for (hex format)
Source

fn get_reward_balance<'life0, 'async_trait>( &'life0 self, height: u64, address: String, ) -> Pin<Box<dyn Future<Output = Result<RewardAmount>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get reward balance at a specific height

§Arguments
  • height - Block height to query
  • address - Ethereum address to query rewards for
Source

fn get_latest_reward_balance<'life0, 'async_trait>( &'life0 self, address: String, ) -> Pin<Box<dyn Future<Output = Result<RewardAmount>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get latest reward balance at the most recent finalized height

§Arguments
  • address - Ethereum address to query rewards for
Source

fn get_reward_account_proof<'life0, 'async_trait>( &'life0 self, height: u64, address: String, ) -> Pin<Box<dyn Future<Output = Result<RewardAccountQueryDataV2>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get Merkle proof for a reward account at a specific height

Returns complete query data with balance and expanded merkle proof

§Arguments
  • height - Block height to query
  • address - Ethereum address to query proof for
Source

fn get_latest_reward_account_proof<'life0, 'async_trait>( &'life0 self, address: String, ) -> Pin<Box<dyn Future<Output = Result<RewardAccountQueryDataV2>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get Merkle proof for a reward account at the latest finalized height

Returns complete query data with balance and expanded merkle proof

§Arguments
  • address - Ethereum address to query proof for
Source

fn get_reward_amounts<'life0, 'async_trait>( &'life0 self, height: u64, offset: u64, limit: u64, ) -> Pin<Box<dyn Future<Output = Result<Vec<(Address, RewardAmount)>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get paginated list of reward amounts at a specific height

§Arguments
  • height - Block height to query
  • offset - Starting index for pagination
  • limit - Maximum number of results (≤ 10000)
Source

fn get_reward_merkle_tree_v2<'life0, 'async_trait>( &'life0 self, height: u64, ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get raw RewardMerkleTreeV2 snapshot at a given height

Returns the serialized merkle tree data

§Arguments
  • height - Block height to query
Source

fn get_reward_state_path_v1<'life0, 'async_trait>( &'life0 self, snapshot: Snapshot, key: String, ) -> Pin<Box<dyn Future<Output = Result<RewardStatePathV1>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get the Merkle path for a key in the reward-state (RewardMerkleTreeV1) tree

Mirrors the legacy merklized_state get_path, inherited by the reward-state mount from hotshot-query-service’s merklized-state base routes (same as block-state/fee-state).

§Arguments
  • snapshot - Height or commitment identifying the tree snapshot
  • key - Reward account address to query
Source

fn get_reward_state_path_v2<'life0, 'async_trait>( &'life0 self, snapshot: Snapshot, key: String, ) -> Pin<Box<dyn Future<Output = Result<RewardStatePathV2>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get the Merkle path for a key in the reward-state-v2 (RewardMerkleTreeV2) tree

§Arguments
  • snapshot - Height or commitment identifying the tree snapshot
  • key - Reward account address to query

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§