pub trait Signer: Send + Sync {
// Required methods
fn pubkey(&self) -> [u8; 32];
fn sign<'life0, 'life1, 'async_trait>(
&'life0 self,
canonical_bytes: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<[u8; 64]>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
// Provided methods
fn pq_pubkey(&self) -> Option<Vec<u8>> { ... }
fn pq_sign<'life0, 'life1, 'async_trait>(
&'life0 self,
_canonical_bytes: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
}Expand description
Signing abstraction for Ed25519 envelope signatures.
Native: LocalSigner owns the SigningKey and signs synchronously.
WASM: JsSigner delegates to a JS callback (aegis-vault) and awaits the result.
§Safety (wasm32)
JsSigner holds js_sys::Function which is !Send. We use
unsafe impl Send + Sync on it because wasm32 is single-threaded.
The Send + Sync bounds on this trait are required so that RpcClient<S, T>
can be used with Arc and tokio::spawn on native.