pub struct EigenlayerClient {
pub config: BlueprintEnvironment,
}Expand description
Client that provides access to EigenLayer utility functions through the use of the BlueprintEnvironment.
Fields§
§config: BlueprintEnvironmentImplementations§
Source§impl EigenlayerClient
impl EigenlayerClient
Sourcepub fn new(config: BlueprintEnvironment) -> Self
pub fn new(config: BlueprintEnvironment) -> Self
Creates a new EigenlayerClient.
Sourcepub fn config(&self) -> &BlueprintEnvironment
pub fn config(&self) -> &BlueprintEnvironment
Get the BlueprintEnvironment for this client
Sourcepub fn get_provider_http(&self) -> RootProvider
pub fn get_provider_http(&self) -> RootProvider
Sourcepub fn get_wallet_provider_http(&self, wallet: EthereumWallet) -> RootProvider
pub fn get_wallet_provider_http(&self, wallet: EthereumWallet) -> RootProvider
Get the provider for this client’s http endpoint with the specified EthereumWallet
§Returns
Sourcepub async fn get_provider_ws(&self) -> Result<RootProvider>
pub async fn get_provider_ws(&self) -> Result<RootProvider>
Sourcepub async fn avs_registry_reader(&self) -> Result<AvsRegistryChainReader>
pub async fn avs_registry_reader(&self) -> Result<AvsRegistryChainReader>
Provides a reader for the AVS registry.
§Errors
- The
BlueprintEnvironmentis not configured for Eigenlayer - See
AvsRegistryChainReader::new()
Sourcepub async fn avs_registry_writer(
&self,
private_key: String,
) -> Result<AvsRegistryChainWriter>
pub async fn avs_registry_writer( &self, private_key: String, ) -> Result<AvsRegistryChainWriter>
Provides a writer for the AVS registry.
§Errors
- The
BlueprintEnvironmentis not configured for Eigenlayer - See
AvsRegistryChainWriter::build_avs_registry_chain_writer()
Sourcepub async fn operator_info_service_in_memory(
&self,
) -> Result<(OperatorInfoServiceInMemory, UnboundedReceiver<OperatorInfoServiceError>)>
pub async fn operator_info_service_in_memory( &self, ) -> Result<(OperatorInfoServiceInMemory, UnboundedReceiver<OperatorInfoServiceError>)>
Provides an operator info service.
§Errors
- The
BlueprintEnvironmentis not configured for Eigenlayer - See
OperatorInfoServiceInMemory::new()
Sourcepub async fn avs_registry_service_chain_caller_in_memory(
&self,
) -> Result<AvsRegistryServiceChainCaller<AvsRegistryChainReader, OperatorInfoServiceInMemory>>
pub async fn avs_registry_service_chain_caller_in_memory( &self, ) -> Result<AvsRegistryServiceChainCaller<AvsRegistryChainReader, OperatorInfoServiceInMemory>>
Provides an AVS registry service chain caller.
§Errors
Sourcepub async fn bls_aggregation_service_in_memory(
&self,
) -> Result<BlsAggregatorService<AvsRegistryServiceChainCaller<AvsRegistryChainReader, OperatorInfoServiceInMemory>>>
pub async fn bls_aggregation_service_in_memory( &self, ) -> Result<BlsAggregatorService<AvsRegistryServiceChainCaller<AvsRegistryChainReader, OperatorInfoServiceInMemory>>>
Sourcepub async fn get_operator_stake_in_quorums_at_block(
&self,
block_number: u32,
quorum_numbers: Bytes,
) -> Result<Vec<Vec<Operator>>>
pub async fn get_operator_stake_in_quorums_at_block( &self, block_number: u32, quorum_numbers: Bytes, ) -> Result<Vec<Vec<Operator>>>
Get Operator stake in Quorums at a given block.
§Errors
Sourcepub async fn get_operator_stake_in_quorums_at_current_block(
&self,
operator_id: FixedBytes<32>,
) -> Result<HashMap<u8, BigInt>>
pub async fn get_operator_stake_in_quorums_at_current_block( &self, operator_id: FixedBytes<32>, ) -> Result<HashMap<u8, BigInt>>
Get an Operator’s stake in Quorums at current block.
§Errors
Sourcepub async fn get_operator_by_id(&self, operator_id: [u8; 32]) -> Result<Address>
pub async fn get_operator_by_id(&self, operator_id: [u8; 32]) -> Result<Address>
Get an Operator by ID.
§Errors
Sourcepub async fn get_operator_stake_history(
&self,
operator_id: FixedBytes<32>,
quorum_number: u8,
) -> Result<Vec<StakeUpdate>>
pub async fn get_operator_stake_history( &self, operator_id: FixedBytes<32>, quorum_number: u8, ) -> Result<Vec<StakeUpdate>>
Sourcepub async fn get_operator_stake_update_at_index(
&self,
quorum_number: u8,
operator_id: FixedBytes<32>,
index: U256,
) -> Result<StakeUpdate>
pub async fn get_operator_stake_update_at_index( &self, quorum_number: u8, operator_id: FixedBytes<32>, index: U256, ) -> Result<StakeUpdate>
Get an Operator stake update at a given index.
§Errors
- The
BlueprintEnvironmentis not configured for Eigenlayer
Sourcepub async fn get_operator_stake_at_block_number(
&self,
operator_id: FixedBytes<32>,
quorum_number: u8,
block_number: u32,
) -> Result<Uint<96, 2>>
pub async fn get_operator_stake_at_block_number( &self, operator_id: FixedBytes<32>, quorum_number: u8, block_number: u32, ) -> Result<Uint<96, 2>>
Get an Operator’s stake at a given block number.
§Errors
- The
BlueprintEnvironmentis not configured for Eigenlayer
Sourcepub async fn get_latest_stake_update(
&self,
operator_id: FixedBytes<32>,
quorum_number: u8,
) -> Result<StakeUpdate>
pub async fn get_latest_stake_update( &self, operator_id: FixedBytes<32>, quorum_number: u8, ) -> Result<StakeUpdate>
Get an Operator’s latest stake update.
§Errors
- The
BlueprintEnvironmentis not configured for Eigenlayer
Sourcepub async fn get_operator_id(
&self,
operator_addr: Address,
) -> Result<FixedBytes<32>>
pub async fn get_operator_id( &self, operator_addr: Address, ) -> Result<FixedBytes<32>>
Get an Operator’s ID as FixedBytes from its Address.
§Errors
Sourcepub async fn get_total_stake_at_block_number_from_index(
&self,
quorum_number: u8,
block_number: u32,
index: U256,
) -> Result<Uint<96, 2>>
pub async fn get_total_stake_at_block_number_from_index( &self, quorum_number: u8, block_number: u32, index: U256, ) -> Result<Uint<96, 2>>
Get the total stake at a given block number from a given index.
§Errors
- The
BlueprintEnvironmentis not configured for Eigenlayer
Sourcepub async fn get_total_stake_history_length(
&self,
quorum_number: u8,
) -> Result<U256>
pub async fn get_total_stake_history_length( &self, quorum_number: u8, ) -> Result<U256>
Get the total stake history length of a given quorum.
§Errors
- The
BlueprintEnvironmentis not configured for Eigenlayer
Sourcepub async fn query_existing_registered_operator_pub_keys(
&self,
start_block: u64,
to_block: u64,
) -> Result<(Vec<Address>, Vec<OperatorPubKeys>)>
pub async fn query_existing_registered_operator_pub_keys( &self, start_block: u64, to_block: u64, ) -> Result<(Vec<Address>, Vec<OperatorPubKeys>)>
Provides the public keys of existing registered operators within the provided block range.
§Errors
Sourcepub async fn get_strategies_in_operator_set(
&self,
avs_address: Address,
operator_set_id: u8,
) -> Result<Vec<Address>>
pub async fn get_strategies_in_operator_set( &self, avs_address: Address, operator_set_id: u8, ) -> Result<Vec<Address>>
Get strategies in an operator set (quorum) for a given AVS.
§Arguments
avs_address- The address of the AVS service manageroperator_set_id- The ID of the operator set (quorum number)
§Returns
A vector of strategy addresses used in the specified operator set
§Errors
- [
Error::AlloyContractError] - If the call to the contract fails
Sourcepub async fn get_strategy_allocations(
&self,
operator_address: Address,
strategy_address: Address,
) -> Result<(Vec<OperatorSet>, Vec<Allocation>)>
pub async fn get_strategy_allocations( &self, operator_address: Address, strategy_address: Address, ) -> Result<(Vec<OperatorSet>, Vec<Allocation>)>
Get strategy allocations for a specific operator and strategy.
§Arguments
operator_address- The address of the operatorstrategy_address- The address of the strategy
§Returns
A tuple containing:
- A vector of operator sets the operator is part of
- A vector of allocations for each operator set
§Errors
- [
Error::AlloyContractError] - If the call to the contract fails
Sourcepub async fn get_max_magnitude(
&self,
operator_address: Address,
strategy_address: Address,
) -> Result<u64>
pub async fn get_max_magnitude( &self, operator_address: Address, strategy_address: Address, ) -> Result<u64>
Sourcepub async fn get_operators_for_service(
&self,
_avs_address: Address,
block_number: u32,
quorum_numbers: Vec<u8>,
) -> Result<Vec<Vec<Operator>>>
pub async fn get_operators_for_service( &self, _avs_address: Address, block_number: u32, quorum_numbers: Vec<u8>, ) -> Result<Vec<Vec<Operator>>>
Get all operators for a service at a specific block.
§Arguments
avs_address- The address of the AVS service managerblock_number- The block number to retrieve the operators atquorum_numbers- The quorum numbers to retrieve operators for
§Returns
A vector of vectors containing operators in each quorum
§Errors
- [
Error::AlloyContractError] - If the call to the contract fails
Sourcepub async fn get_slashable_assets_for_avs(
&self,
avs_address: Address,
block_number: u32,
quorum_numbers: Vec<u8>,
) -> Result<HashMap<Address, HashMap<Address, U256>>>
pub async fn get_slashable_assets_for_avs( &self, avs_address: Address, block_number: u32, quorum_numbers: Vec<u8>, ) -> Result<HashMap<Address, HashMap<Address, U256>>>
Get all slashable assets for an AVS.
§Arguments
avs_address- The address of the AVS service managerblock_number- The block number to retrieve the data atquorum_numbers- The quorum numbers (operator set IDs) to retrieve data for
§Returns
A hashmap where:
- Key: Operator address
- Value: A hashmap where:
- Key: Strategy address
- Value: Amount of slashable shares
§Errors
- [
Error::AlloyContractError] - If any contract call fails
Trait Implementations§
Source§impl Clone for EigenlayerClient
impl Clone for EigenlayerClient
Source§fn clone(&self) -> EigenlayerClient
fn clone(&self) -> EigenlayerClient
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for EigenlayerClient
impl !RefUnwindSafe for EigenlayerClient
impl Send for EigenlayerClient
impl Sync for EigenlayerClient
impl Unpin for EigenlayerClient
impl !UnwindSafe for EigenlayerClient
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CheckedConversion for T
impl<T> CheckedConversion for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::RequestSource§impl<T, Outer> IsWrappedBy<Outer> for T
impl<T, Outer> IsWrappedBy<Outer> for T
Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
Source§fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
Source§fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
T. Read moreSource§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.Source§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
Source§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
unchecked_from.Source§impl<T, S> UniqueSaturatedInto<T> for S
impl<T, S> UniqueSaturatedInto<T> for S
Source§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
T.