|
1 | 1 | use crate::gas::BLOB_GAS_PER_BLOB; |
2 | 2 | use crate::provider::layer_extensions::RpcLoggingLayer; |
3 | 3 | use crate::wallet::{ |
4 | | - AwsKmsWalletManager, CompositeWalletManager, MnemonicWalletManager, PrivateKeyWalletManager, |
5 | | - PrivyWalletManager, TurnkeyWalletManager, WalletError, WalletManagerTrait, |
| 4 | + AwsKmsWalletManager, CompositeWalletManager, MnemonicWalletManager, Pkcs11WalletManager, |
| 5 | + PrivateKeyWalletManager, PrivyWalletManager, TurnkeyWalletManager, WalletError, |
| 6 | + WalletManagerTrait, |
| 7 | +}; |
| 8 | +use crate::yaml::{ |
| 9 | + AwsKmsSigningProviderConfig, Pkcs11SigningProviderConfig, TurnkeySigningProviderConfig, |
6 | 10 | }; |
7 | | -use crate::yaml::{AwsKmsSigningProviderConfig, TurnkeySigningProviderConfig}; |
8 | 11 | use crate::{ |
9 | 12 | gas::{ |
10 | 13 | BaseGasFeeEstimator, BlobGasEstimatorResult, BlobGasPriceResult, GasEstimatorError, |
@@ -200,6 +203,15 @@ impl EvmProvider { |
200 | 203 | Self::new_internal(network_setup_config, wallet_manager, gas_estimator).await |
201 | 204 | } |
202 | 205 |
|
| 206 | + pub async fn new_with_pkcs11( |
| 207 | + network_setup_config: &NetworkSetupConfig, |
| 208 | + pkcs11_config: Pkcs11SigningProviderConfig, |
| 209 | + gas_estimator: Arc<dyn BaseGasFeeEstimator + Send + Sync>, |
| 210 | + ) -> Result<Self, EvmProviderNewError> { |
| 211 | + let wallet_manager = Arc::new(Pkcs11WalletManager::new(pkcs11_config)?); |
| 212 | + Self::new_internal(network_setup_config, wallet_manager, gas_estimator).await |
| 213 | + } |
| 214 | + |
203 | 215 | pub async fn new_with_composite( |
204 | 216 | network_setup_config: &NetworkSetupConfig, |
205 | 217 | primary_manager: Arc<dyn WalletManagerTrait>, |
|
0 commit comments