circles_rpc/methods/
token_info.rs1use crate::client::RpcClient;
2use crate::error::Result;
3use circles_types::{Address, TokenInfo};
4
5#[derive(Clone, Debug)]
7pub struct TokenInfoMethods {
8 client: RpcClient,
9}
10
11impl TokenInfoMethods {
12 pub fn new(client: RpcClient) -> Self {
14 Self { client }
15 }
16
17 pub async fn get_token_info(&self, token: Address) -> Result<TokenInfo> {
19 self.client.call("circles_getTokenInfo", (token,)).await
20 }
21
22 pub async fn get_token_info_batch(&self, tokens: Vec<Address>) -> Result<Vec<TokenInfo>> {
24 self.client
25 .call("circles_getTokenInfoBatch", (tokens,))
26 .await
27 }
28}