crypto_pay_api/models/
balance.rs

1use crate::utils::deserialize_decimal;
2
3use super::CryptoCurrencyCode;
4use rust_decimal::Decimal;
5use serde::Deserialize;
6
7#[derive(Debug, Deserialize)]
8pub struct Balance {
9    /// Cryptocurrency alphabetic code.
10    /// Currently, can be “USDT”, “TON”, “BTC”, “ETH”, “LTC”, “BNB”, “TRX”, "SEND" and “USDC” (and “JET” for testnet).
11    pub currency_code: CryptoCurrencyCode,
12
13    /// Total available amount in float.
14    #[serde(deserialize_with = "deserialize_decimal")]
15    pub available: Decimal,
16
17    /// Unavailable amount currently is on hold in float.
18    #[serde(deserialize_with = "deserialize_decimal")]
19    pub onhold: Decimal,
20}