Trait Signer

Source
pub trait Signer: Send + Sync {
    // Required methods
    fn account(&self) -> AccountId;
    fn sign<'life0, 'life1, 'async_trait>(
        &'life0 self,
        msg: &'life1 [u8],
    ) -> Pin<Box<dyn Future<Output = Result<MultiSignature, Error>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             Self: 'async_trait;

    // Provided methods
    fn nonce<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Option<u32>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait { ... }
    fn set_nonce<'life0, 'async_trait>(
        &'life0 mut self,
        _nonce: u32,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait { ... }
    fn lock<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Option<Box<dyn Signer>>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait { ... }
}

Required Methods§

Source

fn account(&self) -> AccountId

Source

fn sign<'life0, 'life1, 'async_trait>( &'life0 self, msg: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = Result<MultiSignature, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Provided Methods§

Source

fn nonce<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Option<u32>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Optional - The signer can manage their nonce for improve transaction performance. The default implmentation will query the next nonce from chain storage.

Source

fn set_nonce<'life0, 'async_trait>( &'life0 mut self, _nonce: u32, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Optional - The signer can manage their nonce for improve transaction performance. If the transaction is accepted by the RPC node, then the nonce we be increased, to allow the next transaction to be signed & submitted without waiting for the next block.

Source

fn lock<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Option<Box<dyn Signer>>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Optional support for locking the signer.

Trait Implementations§

Source§

impl Signer for Box<dyn Signer>

Source§

fn account(&self) -> AccountId

Source§

fn nonce<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Option<u32>> + Send + 'async_trait>>
where 'life0: 'async_trait, Box<dyn Signer>: 'async_trait,

Optional - The signer can manage their nonce for improve transaction performance. The default implmentation will query the next nonce from chain storage.
Source§

fn set_nonce<'life0, 'async_trait>( &'life0 mut self, nonce: u32, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where 'life0: 'async_trait, Box<dyn Signer>: 'async_trait,

Optional - The signer can manage their nonce for improve transaction performance. If the transaction is accepted by the RPC node, then the nonce we be increased, to allow the next transaction to be signed & submitted without waiting for the next block.
Source§

fn sign<'life0, 'life1, 'async_trait>( &'life0 self, msg: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = Result<MultiSignature, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Box<dyn Signer>: 'async_trait,

Source§

fn lock<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Option<Box<dyn Signer>>> + Send + 'async_trait>>
where 'life0: 'async_trait, Box<dyn Signer>: 'async_trait,

Optional support for locking the signer.

Implementations on Foreign Types§

Source§

impl Signer for Box<dyn Signer>

Source§

fn account(&self) -> AccountId

Source§

fn nonce<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Option<u32>> + Send + 'async_trait>>
where 'life0: 'async_trait, Box<dyn Signer>: 'async_trait,

Source§

fn set_nonce<'life0, 'async_trait>( &'life0 mut self, nonce: u32, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where 'life0: 'async_trait, Box<dyn Signer>: 'async_trait,

Source§

fn sign<'life0, 'life1, 'async_trait>( &'life0 self, msg: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = Result<MultiSignature, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Box<dyn Signer>: 'async_trait,

Source§

fn lock<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Option<Box<dyn Signer>>> + Send + 'async_trait>>
where 'life0: 'async_trait, Box<dyn Signer>: 'async_trait,

Implementors§