Skip to main content

RsmSigner

Trait RsmSigner 

Source
pub trait RsmSigner: Send + Sync {
    // Required methods
    fn signer_address(&self) -> WalletAddress;
    fn sign<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        request_id: &'life1 str,
        account: &'life2 WalletAddress,
        action: &'life3 [u8],
    ) -> Pin<Box<dyn Future<Output = Result<SignedDirective, RsmSignerError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
    fn sign_preallocated<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        request_id: &'life1 str,
        account: &'life2 WalletAddress,
        action: &'life3 [u8],
        nonce: u64,
    ) -> Pin<Box<dyn Future<Output = Result<SignedDirective, RsmSignerError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
    fn status<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<RsmSignerStatus, RsmSignerError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn is_nonce_used<'life0, 'async_trait>(
        &'life0 self,
        nonce: u64,
    ) -> Pin<Box<dyn Future<Output = Result<bool, RsmSignerError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Provider-agnostic RSM directive signer.

Implementations must produce signatures recoverable to signer_address() and preserve nonce/idempotency guarantees for repeated directive requests.

Required Methods§

Source

fn signer_address(&self) -> WalletAddress

Returns the on-chain signer address used for directive signatures.

Source

fn sign<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, request_id: &'life1 str, account: &'life2 WalletAddress, action: &'life3 [u8], ) -> Pin<Box<dyn Future<Output = Result<SignedDirective, RsmSignerError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Claims or reuses the next signer nonce and signs action.

Repeated calls with the same request_id, account, and action must return the same completed directive instead of allocating another nonce.

Source

fn sign_preallocated<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, request_id: &'life1 str, account: &'life2 WalletAddress, action: &'life3 [u8], nonce: u64, ) -> Pin<Box<dyn Future<Output = Result<SignedDirective, RsmSignerError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Signs action using a caller-reserved nonce.

The caller owns nonce allocation; implementations should reject already used nonces rather than silently moving to a different nonce.

Source

fn status<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<RsmSignerStatus, RsmSignerError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Reports signer health and nonce state.

Source

fn is_nonce_used<'life0, 'async_trait>( &'life0 self, nonce: u64, ) -> Pin<Box<dyn Future<Output = Result<bool, RsmSignerError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns whether nonce is already consumed on-chain for this signer.

Implementors§