Trait iota_json_rpc_api::CoinReadApiServer

source ·
pub trait CoinReadApiServer: Sized + Send + Sync + 'static {
    // Required methods
    fn get_coins<'life0, 'async_trait>(
        &'life0 self,
        owner: IotaAddress,
        coin_type: Option<String>,
        cursor: Option<ObjectID>,
        limit: Option<usize>,
    ) -> Pin<Box<dyn Future<Output = RpcResult<CoinPage>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_all_coins<'life0, 'async_trait>(
        &'life0 self,
        owner: IotaAddress,
        cursor: Option<ObjectID>,
        limit: Option<usize>,
    ) -> Pin<Box<dyn Future<Output = RpcResult<CoinPage>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_balance<'life0, 'async_trait>(
        &'life0 self,
        owner: IotaAddress,
        coin_type: Option<String>,
    ) -> Pin<Box<dyn Future<Output = RpcResult<Balance>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_all_balances<'life0, 'async_trait>(
        &'life0 self,
        owner: IotaAddress,
    ) -> Pin<Box<dyn Future<Output = RpcResult<Vec<Balance>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_coin_metadata<'life0, 'async_trait>(
        &'life0 self,
        coin_type: String,
    ) -> Pin<Box<dyn Future<Output = RpcResult<Option<IotaCoinMetadata>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_total_supply<'life0, 'async_trait>(
        &'life0 self,
        coin_type: String,
    ) -> Pin<Box<dyn Future<Output = RpcResult<Supply>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided method
    fn into_rpc(self) -> RpcModule<Self> { ... }
}
Expand description

Server trait implementation for the CoinReadApi RPC API.

Required Methods§

source

fn get_coins<'life0, 'async_trait>( &'life0 self, owner: IotaAddress, coin_type: Option<String>, cursor: Option<ObjectID>, limit: Option<usize>, ) -> Pin<Box<dyn Future<Output = RpcResult<CoinPage>> + Send + 'async_trait>>
where Self: '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: IotaAddress, cursor: Option<ObjectID>, limit: Option<usize>, ) -> Pin<Box<dyn Future<Output = RpcResult<CoinPage>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Return all Coin objects owned by an address.

source

fn get_balance<'life0, 'async_trait>( &'life0 self, owner: IotaAddress, coin_type: Option<String>, ) -> Pin<Box<dyn Future<Output = RpcResult<Balance>> + Send + 'async_trait>>
where Self: '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: IotaAddress, ) -> Pin<Box<dyn Future<Output = RpcResult<Vec<Balance>>> + Send + 'async_trait>>
where Self: '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 = RpcResult<Option<IotaCoinMetadata>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Return metadata (e.g., symbol, decimals) for a coin.

source

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

Return total supply for a coin.

Provided Methods§

source

fn into_rpc(self) -> RpcModule<Self>

Collects all the methods and subscriptions defined in the trait and adds them into a single RpcModule.

Object Safety§

This trait is not object safe.

Implementors§