use jsonrpsee::proc_macros::rpc;
use sui_sdk_types::Address;
use crate::msgs::{Balance, CoinPage, SuiCoinMetadata, Supply};
#[rpc(client, namespace = "suix")]
pub trait CoinReadApi {
#[method(name = "getCoins")]
async fn get_coins(
&self,
owner: Address,
coin_type: Option<String>,
cursor: Option<String>,
limit: Option<usize>,
) -> RpcResult<CoinPage>;
#[method(name = "getAllCoins")]
async fn get_all_coins(
&self,
owner: Address,
cursor: Option<String>,
limit: Option<usize>,
) -> RpcResult<CoinPage>;
#[method(name = "getBalance")]
async fn get_balance(&self, owner: Address, coin_type: Option<String>) -> RpcResult<Balance>;
#[method(name = "getAllBalances")]
async fn get_all_balances(&self, owner: Address) -> RpcResult<Vec<Balance>>;
#[method(name = "getCoinMetadata")]
async fn get_coin_metadata(&self, coin_type: String) -> RpcResult<Option<SuiCoinMetadata>>;
#[method(name = "getTotalSupply")]
async fn get_total_supply(&self, coin_type: String) -> RpcResult<Supply>;
}