polymesh_api

Trait ChainApi

source
pub trait ChainApi: Clone {
    type RuntimeCall: RuntimeEnumTraits;
    type RuntimeEvent: RuntimeEnumTraits;
    type DispatchInfo: RuntimeTraits;
    type DispatchError: RuntimeEnumTraits;

    // Required methods
    fn get_nonce<'life0, 'async_trait>(
        &'life0 self,
        account: AccountId,
    ) -> Pin<Box<dyn Future<Output = Result<u32, Error>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
    fn block_events<'life0, 'async_trait>(
        &'life0 self,
        block: Option<H256>,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<EventRecord<Self::RuntimeEvent>>, Error>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
    fn event_to_extrinsic_result(
        event: &EventRecord<Self::RuntimeEvent>,
    ) -> Option<ExtrinsicResult<Self>>;
    fn client(&self) -> &Client;

    // Provided methods
    fn events_to_extrinsic_result(
        events: &[EventRecord<Self::RuntimeEvent>],
    ) -> Option<ExtrinsicResult<Self>> { ... }
    fn submit_and_watch<'life0, 'async_trait>(
        &'life0 self,
        xt: ExtrinsicV4,
    ) -> Pin<Box<dyn Future<Output = Result<TransactionResults<Self>, Error>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: Sync + 'async_trait { ... }
}

Required Associated Types§

Required Methods§

source

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

source

fn block_events<'life0, 'async_trait>( &'life0 self, block: Option<H256>, ) -> Pin<Box<dyn Future<Output = Result<Vec<EventRecord<Self::RuntimeEvent>>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

source

fn event_to_extrinsic_result( event: &EventRecord<Self::RuntimeEvent>, ) -> Option<ExtrinsicResult<Self>>

source

fn client(&self) -> &Client

Provided Methods§

source

fn events_to_extrinsic_result( events: &[EventRecord<Self::RuntimeEvent>], ) -> Option<ExtrinsicResult<Self>>

source

fn submit_and_watch<'life0, 'async_trait>( &'life0 self, xt: ExtrinsicV4, ) -> Pin<Box<dyn Future<Output = Result<TransactionResults<Self>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: Sync + 'async_trait,

Submit a signed/unsigned transaction, but don’t wait for it to execute.

Object Safety§

This trait is not object safe.

Implementors§