smbcloud-wallet-kit-v3 1.0.6

smbCloud Wallet Kit V3 for NotWallet Crypto non-custodial Solana crypto wallet.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use {
    crate::models::keypair::KeyPairError,
    smbcloud_wallet_core_http::price_data::get_asset_price::get_asset_price,
};

#[uniffi::export(async_runtime = "tokio")]
pub async fn asset_price(
    asset: String,
    api_key: &str,
    user_agent: &str,
) -> Result<f64, KeyPairError> {
    match get_asset_price(&asset, api_key, user_agent).await {
        Ok(response) => Ok(response.data.value),
        Err(error) => Err(KeyPairError::AssetPrice(error.to_string())),
    }
}