chainsight-sdk-v2 0.1.0

Chainsight SDK for DFINITY Internet Computer
Documentation
use candid::{
    Principal,
    utils::{ArgumentDecoder, ArgumentEncoder},
};
use ic_cdk::api::call::CallResult;

#[derive(Clone)]
pub struct DefaultTransport;
impl DefaultTransport {
    pub fn new() -> Self {
        DefaultTransport {}
    }
    pub async fn call<T: ArgumentEncoder + Send + Sync, R: for<'a> ArgumentDecoder<'a>>(
        &self,
        canister: &Principal,
        method: &str,
        params: T,
    ) -> CallResult<R> {
        ic_cdk::api::call::call(*canister, method, params).await
    }
}