#![doc(
html_logo_url = "https://github.com/Layr-Labs/eigensdk-rs/assets/91280922/bd13caec-3c00-4afc-839a-b83d2890beb5",
issue_tracker_base_url = "https://github.com/Layr-Labs/eigensdk-rs/issues/"
)]
#![cfg(not(doctest))]
#![cfg_attr(not(test), warn(unused_crate_dependencies))]
#![allow(unused_imports, clippy::all, rustdoc::all)]
pub mod address;
pub mod addressupgradeable;
pub mod avsdirectory;
pub mod beaconchainproofs;
pub mod bitmaputils;
pub mod blsapkregistry;
pub mod blsapkregistrystorage;
pub mod blssignaturechecker;
pub mod bn254;
pub mod checkpointsupgradeable;
pub mod configsreadwriter;
pub mod context;
pub mod contextupgradeable;
pub mod contractsregistry;
pub mod delegationmanager;
pub mod deploymockavs;
pub mod deploymockavsregistries;
pub mod deploytokensstrategiescreatequorums;
pub mod ecdsa;
pub mod ecdsaservicemanagerbase;
pub mod ecdsastakeregistry;
pub mod ecdsastakeregistryequalweight;
pub mod ecdsastakeregistryeventsanderrors;
pub mod ecdsastakeregistrypermissioned;
pub mod ecdsastakeregistrystorage;
pub mod ecdsaupgradeable;
pub mod eigenlayercontractsparser;
pub mod eip1271signatureutils;
pub mod eip712;
pub mod ejectionmanager;
pub mod emptycontract;
pub mod endian;
pub mod erc1967proxy;
pub mod erc1967upgrade;
pub mod erc20;
pub mod iavsdirectory;
pub mod ibeacon;
pub mod ibeaconchainoracle;
pub mod iblsapkregistry;
pub mod iblssignaturechecker;
pub mod idelegationmanager;
pub mod ieigenpod;
pub mod ieigenpodmanager;
pub mod iejectionmanager;
pub mod ierc1271;
pub mod ierc1271upgradeable;
pub mod ierc165;
pub mod ierc1822proxiable;
pub mod ierc20;
pub mod ierc20metadata;
pub mod ierc20permit;
pub mod ierc721;
pub mod ierc721enumerable;
pub mod ierc721metadata;
pub mod ierc721tokenreceiver;
pub mod iethposdeposit;
pub mod iindexregistry;
pub mod indexregistry;
pub mod indexregistrystorage;
pub mod initializable;
pub mod ipausable;
pub mod ipauserregistry;
pub mod iregistry;
pub mod iregistrycoordinator;
pub mod irewardscoordinator;
pub mod iservicemanager;
pub mod iservicemanagerui;
pub mod isignatureutils;
pub mod islasher;
pub mod isocketupdater;
pub mod istakeregistry;
pub mod istrategy;
pub mod istrategymanager;
pub mod mathupgradeable;
pub mod merkle;
pub mod mockavscontractsparser;
pub mod mockavsservicemanager;
pub mod mockerc20;
pub mod mockerc721;
pub mod operatorstateretriever;
pub mod ownable;
pub mod ownableupgradeable;
pub mod pausable;
pub mod pauserregistry;
pub mod proxy;
pub mod proxyadmin;
pub mod registeroperators;
pub mod registrycoordinator;
pub mod registrycoordinatorstorage;
pub mod safecastupgradeable;
pub mod safeerc20;
pub mod servicemanagerbase;
pub mod servicemanagerbasestorage;
pub mod servicemanagerrouter;
pub mod signaturecheckerupgradeable;
pub mod stakeregistry;
pub mod stakeregistrystorage;
pub mod storageslot;
pub mod strategybase;
pub mod strategybasetvllimits;
pub mod strategymanager;
pub mod strings;
pub mod stringsupgradeable;
pub mod tokenandstrategycontractsparser;
pub mod transparentupgradeableproxy;
pub mod updateoperators;
use alloy::network::{Ethereum, EthereumWallet};
use alloy::providers::{
fillers::{
BlobGasFiller, ChainIdFiller, FillProvider, GasFiller, JoinFill, NonceFiller, WalletFiller,
},
Identity, ProviderBuilder, RootProvider, WsConnect,
};
use alloy::pubsub::PubSubFrontend;
use alloy::signers::local::PrivateKeySigner;
use alloy::transports::http::{Client, Http};
use alloy::transports::RpcError;
use alloy::transports::TransportErrorKind;
use reqwest::Url;
use std::str::FromStr;
#[allow(clippy::type_complexity)]
pub fn get_signer(
key: &str,
rpc_url: &str,
) -> alloy::providers::fillers::FillProvider<
JoinFill<
JoinFill<
Identity,
JoinFill<GasFiller, JoinFill<BlobGasFiller, JoinFill<NonceFiller, ChainIdFiller>>>,
>,
WalletFiller<EthereumWallet>,
>,
RootProvider<Http<Client>>,
Http<Client>,
Ethereum,
> {
let signer = PrivateKeySigner::from_str(key).expect("wrong key ");
let wallet = EthereumWallet::from(signer);
let url = Url::parse(rpc_url).expect("Wrong rpc url");
ProviderBuilder::new()
.with_recommended_fillers()
.wallet(wallet.clone())
.on_http(url)
}
#[allow(clippy::type_complexity)]
pub fn get_provider(
rpc_url: &str,
) -> FillProvider<
JoinFill<
Identity,
JoinFill<GasFiller, JoinFill<BlobGasFiller, JoinFill<NonceFiller, ChainIdFiller>>>,
>,
RootProvider<Http<Client>>,
Http<Client>,
Ethereum,
> {
let url = Url::parse(rpc_url).expect("Wrong rpc url");
ProviderBuilder::new()
.with_recommended_fillers()
.on_http(url)
}
#[allow(clippy::type_complexity)]
pub async fn get_ws_provider(
rpc_url: &str,
) -> Result<RootProvider<PubSubFrontend>, RpcError<TransportErrorKind>> {
let ws = WsConnect::new(rpc_url);
ProviderBuilder::new().on_ws(ws).await
}
pub const NEW_PUBKEY_REGISTRATION_EVENT: &str =
"NewPubkeyRegistration(address,(uint256,uint256),(uint256[2],uint256[2]))";
pub const OPERATOR_SOCKET_UPDATE: &str = "OperatorSocketUpdate(bytes32,string)";