sui_json_rpc_api

Trait CoinReadApiClient

Source
pub trait CoinReadApiClient: ClientT {
    // Provided methods
    fn get_coins<'life0, 'async_trait>(
        &'life0 self,
        owner: SuiAddress,
        coin_type: Option<String>,
        cursor: Option<String>,
        limit: Option<usize>,
    ) -> Pin<Box<dyn Future<Output = Result<CoinPage, Error>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
    fn get_all_coins<'life0, 'async_trait>(
        &'life0 self,
        owner: SuiAddress,
        cursor: Option<String>,
        limit: Option<usize>,
    ) -> Pin<Box<dyn Future<Output = Result<CoinPage, Error>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
    fn get_balance<'life0, 'async_trait>(
        &'life0 self,
        owner: SuiAddress,
        coin_type: Option<String>,
    ) -> Pin<Box<dyn Future<Output = Result<Balance, Error>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
    fn get_all_balances<'life0, 'async_trait>(
        &'life0 self,
        owner: SuiAddress,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Balance>, Error>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
    fn get_coin_metadata<'life0, 'async_trait>(
        &'life0 self,
        coin_type: String,
    ) -> Pin<Box<dyn Future<Output = Result<Option<SuiCoinMetadata>, Error>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
    fn get_total_supply<'life0, 'async_trait>(
        &'life0 self,
        coin_type: String,
    ) -> Pin<Box<dyn Future<Output = Result<Supply, Error>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

Client implementation for the CoinReadApi RPC API.

Provided Methods§

Source

fn get_coins<'life0, 'async_trait>( &'life0 self, owner: SuiAddress, coin_type: Option<String>, cursor: Option<String>, limit: Option<usize>, ) -> Pin<Box<dyn Future<Output = Result<CoinPage, Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Return all Coin<coin_type> objects owned by an address.

Source

fn get_all_coins<'life0, 'async_trait>( &'life0 self, owner: SuiAddress, cursor: Option<String>, limit: Option<usize>, ) -> Pin<Box<dyn Future<Output = Result<CoinPage, Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Return all Coin objects owned by an address.

Source

fn get_balance<'life0, 'async_trait>( &'life0 self, owner: SuiAddress, coin_type: Option<String>, ) -> Pin<Box<dyn Future<Output = Result<Balance, Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Return the total coin balance for one coin type, owned by the address owner.

Source

fn get_all_balances<'life0, 'async_trait>( &'life0 self, owner: SuiAddress, ) -> Pin<Box<dyn Future<Output = Result<Vec<Balance>, Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Return the total coin balance for all coin type, owned by the address owner.

Source

fn get_coin_metadata<'life0, 'async_trait>( &'life0 self, coin_type: String, ) -> Pin<Box<dyn Future<Output = Result<Option<SuiCoinMetadata>, Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Return metadata (e.g., symbol, decimals) for a coin. Note that if the coin’s metadata was wrapped in the transaction that published its marker type, or the latest version of the metadata object is wrapped or deleted, it will not be found.

Source

fn get_total_supply<'life0, 'async_trait>( &'life0 self, coin_type: String, ) -> Pin<Box<dyn Future<Output = Result<Supply, Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Return total supply for a coin

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§

Source§

impl<TypeJsonRpseeInteral> CoinReadApiClient for TypeJsonRpseeInteral
where TypeJsonRpseeInteral: ClientT,