Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 21 additions & 16 deletions crates/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,17 @@ serde_json = { workspace = true }
serde_yaml = "0.9.30"
async-trait = "0.1"
reqwest = { version = "0.12", features = ["json"] }
alloy = { workspace = true, features = ["full", "signer-mnemonic", "eips", "eip712", "signer-keystore", "signer-aws", "json-rpc"] }
alloy = { workspace = true, features = ["full", "signer-mnemonic", "eips", "eip712", "signer-keystore", "json-rpc"] }
alloy-rlp = { workspace = true }
alloy-eips = { workspace = true }
uuid = { version = "1.0", features = ["v4", "serde"] }
rand = "0.8"
aws-sdk-secretsmanager = "1.14.0"
aws-sdk-kms = "1.14.0"
aws-sdk-sts = "1.14.0"
aws-config = "1.1.4"
aws-sdk-secretsmanager = { version = "1.14.0", optional = true }
aws-sdk-kms = { version = "1.14.0", optional = true }
aws-sdk-sts = { version = "1.14.0", optional = true }
aws-config = { version = "1.1.4", optional = true }
base64 = "0.22.0"
chrono = "0.4.19"
chrono = { version = "0.4.19", features = ["serde"] }
bytes = "1.5.0"
regex = "1.5.4"
thiserror = "1.0"
Expand All @@ -52,16 +52,21 @@ postgres-native-tls = "0.5"
hex = "0.4.3"
anyhow = "1.0.98"
rust_decimal = { version = "1.35.0", features = ["db-tokio-postgres"] }
google-secretmanager1 = "6.0"
hyper = "0.14"
hyper-rustls = "0.24"
google-secretmanager1 = { version = "6.0", optional = true }
rustls = { version = "0.23.35", features = ["ring"]}
hmac = "0.12"
sha2 = "0.10"
p256 = { version = "0.13", features = ["ecdsa"] }
sha2 = { version = "0.10", optional = true }
p256 = { version = "0.13", features = ["ecdsa"], optional = true }
tower = "0.5.2"
subtle = "2.6.1"
cryptoki = "0.10"
secrecy = "0.8"
jsonwebtoken = "9.3"
rsa = "0.9"
cryptoki = { version = "0.10", optional = true }
secrecy = { version = "0.8", optional = true }
jsonwebtoken = { version = "9.3", optional = true }

[features]
default = ["gcp", "aws", "privy", "turnkey", "pkcs11", "fireblocks"]
gcp = ["dep:google-secretmanager1"]
aws = ["dep:aws-sdk-kms", "dep:aws-sdk-sts", "dep:aws-sdk-secretsmanager", "dep:aws-config", "alloy/signer-aws"]
privy = []
turnkey = ["dep:p256"]
pkcs11 = ["dep:cryptoki", "dep:secrecy"]
fireblocks = ["dep:jsonwebtoken", "dep:sha2"]
11 changes: 7 additions & 4 deletions crates/core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ pub use provider::create_retry_client;
pub mod relayer;
pub mod safe_proxy;
pub use safe_proxy::{SafeProxyError, SafeProxyManager, SafeTransaction};
#[cfg(feature = "aws")]
pub use yaml::AwsKmsSigningProviderConfig;
pub use yaml::{
read, ApiConfig, AwsKmsSigningProviderConfig, GasProviders, NetworkSetupConfig,
RateLimitConfig, RateLimitWithInterval, RawSigningProviderConfig, SafeProxyConfig, SetupConfig,
SigningProvider, UserRateLimitConfig,
read, ApiConfig, GasProviders, NetworkSetupConfig, RateLimitConfig, RateLimitWithInterval,
RawSigningProviderConfig, SafeProxyConfig, SetupConfig, SigningProvider, UserRateLimitConfig,
};
mod shared;
pub use shared::{common_types, utils::get_chain_id};
Expand All @@ -30,7 +31,9 @@ mod schema;
pub mod signing;
pub mod transaction;
mod wallet;
pub use wallet::{generate_seed_phrase, AwsKmsWalletManager, WalletError};
#[cfg(feature = "aws")]
pub use wallet::AwsKmsWalletManager;
pub use wallet::{generate_seed_phrase, WalletError};
mod background_tasks;
mod rate_limiting;
pub use rate_limiting::RATE_LIMIT_HEADER_NAME;
Expand Down
32 changes: 25 additions & 7 deletions crates/core/src/provider/evm_provider.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,28 @@
use crate::gas::BLOB_GAS_PER_BLOB;
use crate::provider::layer_extensions::RpcLoggingLayer;
use crate::relayer::Relayer;
#[cfg(feature = "aws")]
use crate::wallet::AwsKmsWalletManager;
#[cfg(feature = "fireblocks")]
use crate::wallet::FireblocksWalletManager;
#[cfg(feature = "pkcs11")]
use crate::wallet::Pkcs11WalletManager;
#[cfg(feature = "privy")]
use crate::wallet::PrivyWalletManager;
#[cfg(feature = "turnkey")]
use crate::wallet::TurnkeyWalletManager;
use crate::wallet::{
AwsKmsWalletManager, CompositeWalletManager, FireblocksWalletManager, ImportKeyResult,
MnemonicWalletManager, Pkcs11WalletManager, PrivateKeyWalletManager, PrivyWalletManager,
TurnkeyWalletManager, WalletError, WalletManagerTrait,
};
use crate::yaml::{
AwsKmsSigningProviderConfig, FireblocksSigningProviderConfig, Pkcs11SigningProviderConfig,
TurnkeySigningProviderConfig,
CompositeWalletManager, ImportKeyResult, MnemonicWalletManager, PrivateKeyWalletManager,
WalletError, WalletManagerTrait,
};
#[cfg(feature = "aws")]
use crate::yaml::AwsKmsSigningProviderConfig;
#[cfg(feature = "fireblocks")]
use crate::yaml::FireblocksSigningProviderConfig;
#[cfg(feature = "pkcs11")]
use crate::yaml::Pkcs11SigningProviderConfig;
#[cfg(feature = "turnkey")]
use crate::yaml::TurnkeySigningProviderConfig;
use crate::{
gas::{
BaseGasFeeEstimator, BlobGasEstimatorResult, BlobGasPriceResult, GasEstimatorError,
Expand Down Expand Up @@ -168,6 +181,7 @@ impl EvmProvider {
Self::new_internal(network_setup_config, wallet_manager, gas_estimator, true).await
}

#[cfg(feature = "privy")]
pub async fn new_with_privy(
network_setup_config: &NetworkSetupConfig,
app_id: String,
Expand All @@ -179,6 +193,7 @@ impl EvmProvider {
Self::new_internal(network_setup_config, wallet_manager, gas_estimator, true).await
}

#[cfg(feature = "aws")]
pub async fn new_with_aws_kms(
network_setup_config: &NetworkSetupConfig,
aws_kms_config: AwsKmsSigningProviderConfig,
Expand All @@ -188,6 +203,7 @@ impl EvmProvider {
Self::new_internal(network_setup_config, wallet_manager, gas_estimator, true).await
}

#[cfg(feature = "turnkey")]
pub async fn new_with_turnkey(
network_setup_config: &NetworkSetupConfig,
turnkey_config: TurnkeySigningProviderConfig,
Expand All @@ -207,6 +223,7 @@ impl EvmProvider {
Self::new_internal(network_setup_config, wallet_manager, gas_estimator, false).await
}

#[cfg(feature = "pkcs11")]
pub async fn new_with_pkcs11(
network_setup_config: &NetworkSetupConfig,
pkcs11_config: Pkcs11SigningProviderConfig,
Expand All @@ -216,6 +233,7 @@ impl EvmProvider {
Self::new_internal(network_setup_config, wallet_manager, gas_estimator, true).await
}

#[cfg(feature = "fireblocks")]
pub async fn new_with_fireblocks(
network_setup_config: &NetworkSetupConfig,
fireblocks_config: FireblocksSigningProviderConfig,
Expand Down
Loading
Loading