ChainReadAccountOperations

Trait ChainReadAccountOperations 

Source
pub trait ChainReadAccountOperations {
    type Error: Error + Send + Sync + 'static;

    // Required methods
    fn node_balance<'life0, 'async_trait, C>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Balance<C>, Self::Error>> + Send + 'async_trait>>
       where C: 'async_trait + Currency,
             Self: 'async_trait,
             'life0: 'async_trait;
    fn safe_balance<'life0, 'async_trait, C>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Balance<C>, Self::Error>> + Send + 'async_trait>>
       where C: 'async_trait + Currency,
             Self: 'async_trait,
             'life0: 'async_trait;
    fn safe_allowance<'life0, 'async_trait, C>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Balance<C>, Self::Error>> + Send + 'async_trait>>
       where C: 'async_trait + Currency,
             Self: 'async_trait,
             'life0: 'async_trait;
    fn find_account_by_address<'life0, 'life1, 'async_trait>(
        &'life0 self,
        address: &'life1 Address,
    ) -> Pin<Box<dyn Future<Output = Result<Option<AccountEntry>, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn find_account_by_packet_key<'life0, 'life1, 'async_trait>(
        &'life0 self,
        packet_key: &'life1 OffchainPublicKey,
    ) -> Pin<Box<dyn Future<Output = Result<Option<AccountEntry>, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn check_node_safe_module_status<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<bool, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn can_register_with_safe<'life0, 'life1, 'async_trait>(
        &'life0 self,
        safe_address: &'life1 Address,
    ) -> Pin<Box<dyn Future<Output = Result<bool, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn stream_accounts<'a, 'async_trait>(
        &'a self,
        selector: AccountSelector,
    ) -> Pin<Box<dyn Future<Output = Result<BoxStream<'a, AccountEntry>, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'a: 'async_trait;
    fn count_accounts<'life0, 'async_trait>(
        &'life0 self,
        selector: AccountSelector,
    ) -> Pin<Box<dyn Future<Output = Result<usize, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Chain operations that read on-chain node accounts.

Required Associated Types§

Source

type Error: Error + Send + Sync + 'static

Required Methods§

Source

fn node_balance<'life0, 'async_trait, C>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Balance<C>, Self::Error>> + Send + 'async_trait>>
where C: 'async_trait + Currency, Self: 'async_trait, 'life0: 'async_trait,

Returns the native or token currency balance of the current node’s account.

Source

fn safe_balance<'life0, 'async_trait, C>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Balance<C>, Self::Error>> + Send + 'async_trait>>
where C: 'async_trait + Currency, Self: 'async_trait, 'life0: 'async_trait,

Returns the native or token currency balance of the current node’s Safe.

Source

fn safe_allowance<'life0, 'async_trait, C>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Balance<C>, Self::Error>> + Send + 'async_trait>>
where C: 'async_trait + Currency, Self: 'async_trait, 'life0: 'async_trait,

Returns the native or token currency Safe allowance.

Source

fn find_account_by_address<'life0, 'life1, 'async_trait>( &'life0 self, address: &'life1 Address, ) -> Pin<Box<dyn Future<Output = Result<Option<AccountEntry>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Returns account entry given the on-chain address.

Source

fn find_account_by_packet_key<'life0, 'life1, 'async_trait>( &'life0 self, packet_key: &'life1 OffchainPublicKey, ) -> Pin<Box<dyn Future<Output = Result<Option<AccountEntry>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Returns account entry given the off-chain packet_key.

Source

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

Validates the node’s Safe setup.

Source

fn can_register_with_safe<'life0, 'life1, 'async_trait>( &'life0 self, safe_address: &'life1 Address, ) -> Pin<Box<dyn Future<Output = Result<bool, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Checks if the given safe address can be registered with the current node.

Source

fn stream_accounts<'a, 'async_trait>( &'a self, selector: AccountSelector, ) -> Pin<Box<dyn Future<Output = Result<BoxStream<'a, AccountEntry>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'a: 'async_trait,

Returns on-chain node accounts with the given AccountSelector.

Source

fn count_accounts<'life0, 'async_trait>( &'life0 self, selector: AccountSelector, ) -> Pin<Box<dyn Future<Output = Result<usize, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Counts the accounts with the given AccountSelector.

This is potentially done more effectively than counting more elements of the stream returned by ChainReadAccountOperations::stream_accounts.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§