AccountInterfaceExt

Trait AccountInterfaceExt 

Source
pub trait AccountInterfaceExt: Rpc + Indexer {
    // Required methods
    fn get_mint_interface<'life0, 'life1, 'async_trait>(
        &'life0 self,
        address: &'life1 Pubkey,
    ) -> Pin<Box<dyn Future<Output = Result<MintInterface, RpcError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get_account_interface<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        address: &'life1 Pubkey,
        program_id: &'life2 Pubkey,
    ) -> Pin<Box<dyn Future<Output = Result<AccountInterface, RpcError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn get_token_account_interface<'life0, 'life1, 'async_trait>(
        &'life0 self,
        address: &'life1 Pubkey,
    ) -> Pin<Box<dyn Future<Output = Result<TokenAccountInterface, RpcError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get_ata_interface<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        owner: &'life1 Pubkey,
        mint: &'life2 Pubkey,
    ) -> Pin<Box<dyn Future<Output = Result<TokenAccountInterface, RpcError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn get_multiple_account_interfaces<'life0, 'life1, 'async_trait>(
        &'life0 self,
        accounts: &'life1 [AccountToFetch],
    ) -> Pin<Box<dyn Future<Output = Result<Vec<AccountInterface>, RpcError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Extension trait for fetching account interfaces (unified hot/cold handling).

Required Methods§

Source

fn get_mint_interface<'life0, 'life1, 'async_trait>( &'life0 self, address: &'life1 Pubkey, ) -> Pin<Box<dyn Future<Output = Result<MintInterface, RpcError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Fetch MintInterface for a mint account.

Use this instead of get_account + unpack_mint.

Source

fn get_account_interface<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, address: &'life1 Pubkey, program_id: &'life2 Pubkey, ) -> Pin<Box<dyn Future<Output = Result<AccountInterface, RpcError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Fetch AccountInterface for an account.

Use this instead of get_account.

Source

fn get_token_account_interface<'life0, 'life1, 'async_trait>( &'life0 self, address: &'life1 Pubkey, ) -> Pin<Box<dyn Future<Output = Result<TokenAccountInterface, RpcError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Fetch TokenAccountInterface for a token account.

Use this instead of get_token_account.

Source

fn get_ata_interface<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, owner: &'life1 Pubkey, mint: &'life2 Pubkey, ) -> Pin<Box<dyn Future<Output = Result<TokenAccountInterface, RpcError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Fetch TokenAccountInterface for an associated token account.

Use this for all ATAs.

Source

fn get_multiple_account_interfaces<'life0, 'life1, 'async_trait>( &'life0 self, accounts: &'life1 [AccountToFetch], ) -> Pin<Box<dyn Future<Output = Result<Vec<AccountInterface>, RpcError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Fetch multiple accounts with automatic type dispatch.

Use this instead of get_multiple_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§