pub mod ed25519;
pub mod secp256k1;
pub use self::ed25519::Ed25519Signer;
pub use self::secp256k1::Secp256k1Signer;
use crate::CryptoError;
use std::fmt::Debug;
#[async_trait::async_trait]
pub trait AuditSigner: Send + Sync + Debug {
fn algorithm(&self) -> &str;
fn public_key_bytes(&self) -> Vec<u8>;
fn public_key_display(&self) -> String;
async fn sign(&self, message: &[u8]) -> Result<Vec<u8>, CryptoError>;
async fn sign_typed(
&self,
_domain_separator: &[u8],
_struct_hash: &[u8],
) -> Result<Vec<u8>, CryptoError> {
Err(CryptoError::UnsupportedOperation(format!(
"{} does not support EIP-712 typed signing",
self.algorithm()
)))
}
fn supports_eip712(&self) -> bool {
false
}
}